How to change a TFastLineSeries into a TLineSeries?
How to change a TFastLineSeries into a TLineSeries?
I have a TFastLineSeries that I want to convert into a TLineSeries. Is there a function that I can use like CloneChartSeries that will create a new object of a different class type?
Hi QTech,
Yes, you could combine CloneChartSeries and ChangeSeriesType metods as follows:
Yes, you could combine CloneChartSeries and ChangeSeriesType metods as follows:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var tmp: TChartSeries;
series1: TFastLineSeries;
series2: TLineSeries;
begin
series1 := TFastLineSeries.Create(self);
Chart1.AddSeries(series1);
series1.FillSampleValues(25);
tmp := CloneChartSeries(series1);
series2 := ChangeSeriesType(tmp, TLineSeries) as TLineSeries;
Chart1.AddSeries(series2);
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |