Page 1 of 1

SelectChart

Posted: Tue Dec 20, 2005 9:12 pm
by 9236318
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

Posted: Wed Dec 21, 2005 10:02 am
by narcis
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.

Posted: Thu Dec 22, 2005 2:24 am
by 9236318
Thanks,

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

Posted: Sun Dec 25, 2005 7:13 pm
by 9236318
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