How to set the order of series in code?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
vsg
Newbie
Newbie
Posts: 1
Joined: Tue Jan 08, 2002 5:00 am

How to set the order of series in code?

Post by vsg » Wed Jun 23, 2004 5:07 pm

I know how to open the Editor and on the Series page, move series' up/down. However, I would like to do this in code. How is this possible? We are using version 5.02.

Thanks.

SMP

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Wed Jun 23, 2004 9:00 pm

Hi.

Sure, it can be done at runtime via code. To swap two series in chart series list, you can use the following code:

Code: Select all

// exchange 3rd and 1st series
  Chart1.ExchangeSeries(1,3);
Alternatively you can also use chart SeriesUp and SeriesDown method to scroll series up or down in the series list:

Code: Select all

Chart1.SeriesUp(Series2); // move series2 up 1 place
// assumption : index of series2 is > 1
Marjan Slatinek,
http://www.steema.com

Post Reply