Multiple series from TChartGalleryPanel

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
aecspades
Newbie
Newbie
Posts: 7
Joined: Fri Sep 30, 2005 4:00 am

Multiple series from TChartGalleryPanel

Post by aecspades » Thu Mar 22, 2007 4:09 pm

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.

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

Post by Pep » Mon Mar 26, 2007 3:12 pm

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.

Post Reply