Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 2379

Summary: In 3D, Bar Series Clicked method doesn't return accurately where bars overlap
Product: .NET TeeChart Reporter: christopher ireland <chris>
Component: SeriesAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED NOTABUG    
Severity: normal    
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:
Attachments: Gif of Bar issue

Description christopher ireland 2020-10-16 07:43:42 EDT
Created attachment 949 [details]
Gif of Bar issue

Using the following code:

        private void InitializeChart(TChart chart)
        {
            void Chart_MouseMove(object sender, MouseEventArgs e)
            {
                for (var i = 0; i < chart.Series.Count; i++)
                {
                    var index = chart.Series[i].Clicked(e.Location);
                    if(index > -1)
                    {
                        chart.Header.Text = $"bar{i}, value:{index}";
                        break;
                    }
                }
            }

            chart.Aspect.View3D = true;
            chart.MouseMove += Chart_MouseMove;


            for (var i = 0; i < 4; i++)
            {
                chart.Series.Add(typeof(Bar)).FillSampleValues();
            }

            ((Bar)chart.Series[0]).MultiBar = MultiBars.Stacked;
        }

You can see that where the Bars overlap there is an issue as to whether the correct value is being returned.
Comment 1 christopher ireland 2020-10-23 10:06:25 EDT
Reversing the order of the enumeration, e.g.

for (var i = chart.Series.Count - 1; i >= 0; i--)

resolves this issue.