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
SelectChart
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |
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
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