Page 1 of 1

How to add and remote a FastLineSeries in runtime ?

Posted: Sun Mar 22, 2009 12:34 am
by 10045871
I want to add and remove series to and from a Tchart. I suppose that AddSeries can be used for adding series. But for removing the series, there is very few information in the user's guide. Could you provide some examples about adding and deleting series from a Chart ?
Thank you in advance.

Patrick :roll:

Posted: Mon Mar 23, 2009 10:07 am
by yeray
Hi Patrick,

You could use the series' variable to remove it from the chart:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var line1: TLineSeries;
point1: TPointSeries;
begin
  line1 := TLineSeries.Create(nil);
  point1 := TPointSeries.Create(nil);

  Chart1.AddSeries(line1);
  Chart1.AddSeries(point1);

  line1.FillSampleValues(25);
  point1.FillSampleValues(25);

  Chart1.RemoveSeries(point1);
  point1.Free;
end;

Or you could remove it using the series' index in the series list:

Code: Select all

Chart1.RemoveSeries(1);

Thank you

Posted: Mon Mar 23, 2009 11:24 pm
by 10045871
Many thanks for the help. This works quite well.

Re: How to add and remote a FastLineSeries in runtime ?

Posted: Thu Oct 02, 2014 7:50 am
by yeray
Hi Patrick,

I've split your new post into a new thread:
http://www.teechart.net/support/viewtop ... =3&t=15208