Data sorting

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
khera
Newbie
Newbie
Posts: 2
Joined: Wed Feb 18, 2004 5:00 am

Data sorting

Post by khera » Tue Mar 23, 2004 1:44 pm

Hello everybody,

I've got a big problem. I use TeeChart Pro v.6.01 with C++ Builder 6. I create a chart with DBChart component and create series for this chart like this:

for(int i=0; i<iSeriesCount; i++)
{
NewSeries = new TLineSeries (CView);
NewSeries->ParentChart = CView;
}

Then I associate data for this series like this:

for(int i=0; i<iSeriesCount; i++)
{
CView->SeriesList->Items->XLabelsSource = ClientDataSet->Fields->FieldByName(myName)->FieldName;
CView->SeriesList->Items->YValues->ValueSource = ClientDataSet->Fields->FieldByName(myName1)->FieldName;
CView->SeriesList->Items->DataSource = ClientDataSet;
CView->SeriesList->Items->CheckDataSource();
if(myName.FieldType == ftString)
CView->SeriesList->Items->SortByLabels(mySort);
else
{
CView->SeriesList->Items->XValues->Order = mySsort;
CView->SeriesList->Items->XValues->Sort();
CView->SeriesList->Items->Repaint();
}
}
CView->Repaint();

Unfortunatelly the sorting which I'm using doesn't work correctly. Data that are visible on Data Tab in Chart Editor are sorted, but on my chart they aren't. What I'm doing wrong?

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Apr 06, 2004 3:43 pm

Hi,

Try calling Series.CheckDataSource after you change the order.

Post Reply