Hi all,
I am fairly new to the TChart components. I created a polar plot based on a set of series already present in our program. The chart used to be a simple line chart.
Is there any way to loop through the series of my TChart component and switch them to line or polar plot at will? The client would like to have a radio button with the options "Line" and "Polar Plot", with the graph changing appropriately.
Is this easy to do? And if so, a bit of sample code would be very much appreciated!
Changing the chart/series type on the fly
-
- Newbie
- Posts: 15
- Joined: Mon Nov 20, 2006 12:00 am
- Location: The Netherlands
- Contact:
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Steve,
Yes, you can do something like in the What's New?\Welcome!\New in Series\Contour Foot example in the features demo (which uses radio buttons). You'll find the features demo at the program group created by TeeChart's binary installer.
You can also do something like this:
Yes, you can do something like in the What's New?\Welcome!\New in Series\Contour Foot example in the features demo (which uses radio buttons). You'll find the features demo at the program group created by TeeChart's binary installer.
You can also do something like this:
Code: Select all
uses TeePolar;
procedure TForm9.FormCreate(Sender: TObject);
var i: Integer;
begin
for i := 0 to Chart1.SeriesCount - 1 do
Chart1[i].FillSampleValues();
end;
procedure TForm9.Button1Click(Sender: TObject);
var
i: Integer;
tmp: TChartSeries;
begin
for i := 0 to Chart1.SeriesCount - 1 do
begin
tmp:=Chart1[i];
if (tmp is TLineSeries) then
ChangeSeriesType(tmp,TPolarSeries)
else
ChangeSeriesType(tmp,TLineSeries);
end;
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 |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 15
- Joined: Mon Nov 20, 2006 12:00 am
- Location: The Netherlands
- Contact:
-
- Newbie
- Posts: 15
- Joined: Mon Nov 20, 2006 12:00 am
- Location: The Netherlands
- Contact: