Hello!
I want to dynamically generate several TLineSeries at run time, but my code keeps making errors.
TLineSeries *PolygonLSeries[10] = new TLineSeries(NULL);
How can I do this?
Thank you in advance.
Dynamic generation of Multiple TLineSeries
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi IIHR,
You can do something like this:
An example using arrays would be:
un exemple de array podria ser :
(*.cpp file):
Charts and series in *.h file defined as follows:
You can do something like this:
Code: Select all
int NumSeries = 10;
for (int i=0; i < NumSeries; i++) {
Chart1->AddSeries(new TLineSeries(this));
Chart1->Series[i]->FillSampleValues();
}
un exemple de array podria ser :
(*.cpp file):
Code: Select all
RandCharts = new TChart *[RandChartCount];
RandSeries = new TLineSeries *[RandChartCount];
for(int i=0;i<RandChartCount;++i)
{
// create charts and series
RandCharts[i] = new TChart(this);
RandSeries[i] = new TLineSeries(this);
RandCharts[i]->Parent = ScrollBox1;
RandCharts[i]->AddSeries(RandSeries[i]);
Code: Select all
TChart **RandCharts;
TLineSeries **RandSeries;
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 |