Change Series at Runtime

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
kev
Newbie
Newbie
Posts: 42
Joined: Tue Apr 06, 2004 4:00 am
Location: Texas

Change Series at Runtime

Post by kev » Fri Jul 29, 2005 2:07 pm

Is there a way to change a FastLine Series into a LineSeries and back at runtime? I can do this executing the ChartEditor at runtime and it works fine. I would like to just make a user checked option for this. Why do I want to do this? Because I am doing high speed multichannel Data Acquisition which works very well using FastLine. However, I would like to see my sample density after the chart has been populated. This can be seen perfectly with Series Points turned on which is not available in FastLine. It seems to me that if I can do this through the ChartEditor, I should be able to do it programatically.

Thanks,
Kev

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Jul 29, 2005 2:22 pm

Hi Kev,

Yes, you can do that using something like:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var tmp: TChartSeries;
begin
  tmp := Chart1[0];
  ChangeSeriesType(tmp,TFastLineSeries);
end;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

kev
Newbie
Newbie
Posts: 42
Joined: Tue Apr 06, 2004 4:00 am
Location: Texas

Post by kev » Fri Jul 29, 2005 2:43 pm

Yes I saw that, but...

I am using TChart 7Pro for Builder 6. I saw a couple of examples on the newsgroups, but they are for Delphi and I so far have not been able to figure out how to convert to C++.

thanks,
Kev

kev
Newbie
Newbie
Posts: 42
Joined: Tue Apr 06, 2004 4:00 am
Location: Texas

Change Series at Runtime (Builder)

Post by kev » Mon Aug 01, 2005 4:25 pm

Anyone want to take a stab at this one? See the previous post.

thanks,
kev

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Aug 02, 2005 11:29 am

Hi Kev,

you can do :

Code: Select all

TChartSeries *ser;
ser = Series1;
ChangeSeriesType(ser,__classid(TPointSeries));

kev
Newbie
Newbie
Posts: 42
Joined: Tue Apr 06, 2004 4:00 am
Location: Texas

Change Series at Runtime Builder

Post by kev » Tue Aug 02, 2005 7:16 pm

I must have tried every other "cast" besides that one. It works fine.

Thanks,
Kev

Post Reply