Page 1 of 1
sorting summary series by group value
Posted: Wed Nov 12, 2008 1:17 pm
by 10546183
I try to sort a summary series by the group value.
This work if the group values are text, but if the group value is numeric or dates it is wrong.
In this cases the labels are sorted by the numeric text/ date as text not the value.
eg numeric is sorted like this:
0.1.11.2.2222,9
should be
0,1,2,9,11,2222
How can I solve this?
Jørgen
Posted: Mon Nov 17, 2008 12:49 pm
by Pep
Hi Jørgen,
changing the axis label style to talValue should solve it :
Chart1.Axes.Left.LabelsStyle := talValue;
Posted: Mon Nov 17, 2008 1:50 pm
by 10546183
This doesn't work for datetime values.
The are displayed as 0,1,2,3,4....
Jørgen
Posted: Mon Nov 17, 2008 4:15 pm
by Pep
Hi Jørgen,
have you set the values to datetime ?
TChart1.Series(0).YValues.DateTime = True
Posted: Tue Nov 18, 2008 2:57 pm
by 10546183
I tried to set .DateTime = True
but this doesn't help
The problem is with grouped DBCharts
The values are grouped by a datetime field.
I have now changed my code to sort the dataset. This works, but it should have worked with teechart sorting to.,
Is it possible to sort a grouped chart where the grouped value is DateTime/ numbers ?
Jørgen
Posted: Mon Nov 24, 2008 6:29 pm
by Pep
Hi J
it should work just using :
Code: Select all
dbchart1.Axes.Bottom.LabelStyle := talValue;
series1.xvalues.DateTime := true;
Series1.XValues.Order:= loAscending;
ComboBox1.ItemIndex:=2;
ComboBox2.ItemIndex:=0;
I've tried it here with the demo "dbChart_Summary.pas" included into the TeeNew8 demo project, just adding the above lines into the formShow and openning the table it sorts the datapoints by date.