Page 1 of 1

Multiple series from TChartGalleryPanel

Posted: Thu Mar 22, 2007 4:09 pm
by 9343673
I'm using a TChartGalleryPanel to provide a user with a list of chart types to selected, then using that to graph multiple rows of data. Each row of data is its own series, so I need to create a series for each row.

The first call to TChartGalleryPanel1.SelectedChart[0] or TChartGalleryPanel1.GetASeries() works fine, but I need multiple instances of the same series 'type'. There is a GetSeriesClass() method, but it is undocumented - is that what I should be using?

I'm sure that there should be a simple way to do this but:

Code: Select all

series := TChartGalleryPanel1.SelectedChart[0];
newseries := series.Create(self);
chart.AddSeries(newseries);
...doesn't work. There's probably some way in Delphi to do the same thing that you would do in Java:

Code: Select all

newseries := series.Clone();
...but I'm not sure if that's what I should be doing in this case or there is some other TChart method that I should be using.

Thanks for any help that you can give.

Posted: Mon Mar 26, 2007 3:12 pm
by Pep
Hi,

I think the better way you can check how to do all referent to the TChartGalleryPanel component is in the TeeChart Office project (included into the TeeChart Pro installation), you can find the project sources under : c:\Program Files\Steema Software\TeeChart X for Delphi X\Examples\TeeChartOffice\Sources.
It uses that component to allow to add several instances of TChartSeries.