Page 1 of 1

Change Series at Runtime

Posted: Fri Jul 29, 2005 2:07 pm
by 9232023
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

Posted: Fri Jul 29, 2005 2:22 pm
by narcis
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;

Posted: Fri Jul 29, 2005 2:43 pm
by 9232023
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

Change Series at Runtime (Builder)

Posted: Mon Aug 01, 2005 4:25 pm
by 9232023
Anyone want to take a stab at this one? See the previous post.

thanks,
kev

Posted: Tue Aug 02, 2005 11:29 am
by Pep
Hi Kev,

you can do :

Code: Select all

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

Change Series at Runtime Builder

Posted: Tue Aug 02, 2005 7:16 pm
by 9232023
I must have tried every other "cast" besides that one. It works fine.

Thanks,
Kev