Page 1 of 1

Order of Labels

Posted: Thu Mar 04, 2010 11:30 am
by 15654986
Hi,

I have an issue with the order of my labels in the chart series points.

I add 4 data points where the X Values are not in the order in which they are going to appear in the chart.
The points in the chart series are in the correct x-order, but the labels for those points are the labels as added in the code, and do not follow the order of the data points.

A small example will clarify my problem:

Code: Select all

Steema.TeeChart.Styles.Bar bar = new Steema.TeeChart.Styles.Bar();
m_tchart.Series.Add(bar);
bar.Add(5, 5, "Test 5");
bar.Add(3, 3, "");
bar.Add(10, 10, "Test 10");
bar.Add(7, 7, "");
So, the order of the points in the charts is by x value, being 3,5,7,10
But the first point in the chart will get label "Test 5", the second point will have empty label, the third point will have label "Test 10" and so on.

See the screenshot for the resulting chart.

How can I solve this?

Many thanks,
Marijke.

Re: Order of Labels

Posted: Fri Mar 05, 2010 9:01 am
by yeray
Hi Marijke,

I've reproduced it and added to the defect list to be fixed in future releases (TF02014710). In the meanwhile you could set the series XValues order to None before adding your points:

Code: Select all

Steema.TeeChart.Styles.Bar bar = new Steema.TeeChart.Styles.Bar();
m_tchart.Series.Add(bar);
bar.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.None; //workaround
bar.Add(5, 5, "Test 5");
bar.Add(3, 3, "");
bar.Add(10, 10, "Test 10");
bar.Add(7, 7, "");

Re: Order of Labels

Posted: Fri Apr 09, 2010 11:08 am
by yeray
Hi Marijke,

After reviewing this, we don't consider it to be a bug but an expected behaviour for design reasons. Sometimes, one would like to add labels in order and sometimes not and TeeChart needs to know if the order of addition matters or not.