Hi,
Using C++ how can i clone a chart (not the series data, just the chart)? I don't know object pascal so i can't translate to C++.
Also, i'd like to clone charts so i can access them something like this Chart[1], Chart[2] for convenience (like an array).
thank you,
russ
p.s. I'm using Rad Studio 10.3.1 and working in C++ Builder.
CloneChart in C++
Re: CloneChart in C++
You can do this as follows:
Code: Select all
void __fastcall TForm1::FormCreate(TObject *Sender)
{
TChart *Charts[2];
Charts[0] = new TChart(this);
Charts[0]->Parent = this;
TLineSeries *series = new TLineSeries(this);
Charts[0]->AddSeries(series);
series->FillSampleValues();
Charts[1] = new TChart(this);
CloneChart(Charts[1], Charts[0], this, false);
Charts[1]->RemoveAllSeries();
Charts[1]->Parent = this;
Charts[1]->Top=Charts[0]->Height;
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |