SelectChart

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
ttripp
Newbie
Newbie
Posts: 10
Joined: Wed Mar 16, 2005 5:00 am

SelectChart

Post by ttripp » Tue Dec 20, 2005 9:12 pm

I have the following code:

TChartSeriesClass list[5] = {__classid(TFastLineSeries), __classid(TLineSeries), __classid(THorizLineSeries), __classid(TBarSeries), __classid(THorizBarSeries)};

ChartGalleryPanel1->CreateChartList(EXISTINGARRAY(list));

ChartGalleryPanel1->SelectChart(ChartGalleryPanel1->Charts[2]);

I am trying to select a chart in the gallery panel programmatically and saw an example of this elsewhere in the forum, however, the SelectChart parameter requires a TGalleryChart, not a TChartGalleryPanel. How do I get there?

Thanks

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Dec 21, 2005 10:02 am

Hi ttripp,

I suggest you to have a look at the "Chart Gallery Example" at "All Features\Welcome!\Components\Gallery" in the TeeChart features demo, available at TeeChart's program group.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

ttripp
Newbie
Newbie
Posts: 10
Joined: Wed Mar 16, 2005 5:00 am

Post by ttripp » Thu Dec 22, 2005 2:24 am

Thanks,

I created the gallery at design time and guess I thought this example did the same thing.

ttripp
Newbie
Newbie
Posts: 10
Joined: Wed Mar 16, 2005 5:00 am

Post by ttripp » Sun Dec 25, 2005 7:13 pm

Actually the brief example in the demo only opened up other cans of worms.

The correct answer--design time and for future reference--is:

TChartSeriesClass list[5] = {__classid(TFastLineSeries), __classid(TLineSeries), __classid(THorizLineSeries), __classid(TBarSeries), __classid(THorizBarSeries)};

ChartGalleryPanel1->CreateChartList(EXISTINGARRAY(list));

ChartGalleryPanel1->SelectChart(ChartGalleryPanel1->Charts->Items[1]); //the second item is selected

Post Reply