How to add and remote a FastLineSeries in runtime ?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Sciensoria
Newbie
Newbie
Posts: 20
Joined: Tue Jul 03, 2007 12:00 am
Contact:

How to add and remote a FastLineSeries in runtime ?

Post by Sciensoria » Sun Mar 22, 2009 12:34 am

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:

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Mon Mar 23, 2009 10:07 am

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);
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Sciensoria
Newbie
Newbie
Posts: 20
Joined: Tue Jul 03, 2007 12:00 am
Contact:

Thank you

Post by Sciensoria » Mon Mar 23, 2009 11:24 pm

Many thanks for the help. This works quite well.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Thu Oct 02, 2014 7:50 am

Hi Patrick,

I've split your new post into a new thread:
http://www.teechart.net/support/viewtop ... =3&t=15208
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply