Send to back/front

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
hgg
Newbie
Newbie
Posts: 4
Joined: Fri Aug 03, 2001 4:00 am
Location: Denmark
Contact:

Send to back/front

Post by hgg » Tue May 25, 2004 9:30 am

Hi,

How do you send series back and forward on the chart, e.g. I have a chart with 5 series on it (A,B,C,D,E) I now want the order on the chart to be B-C-A-D-E thus moving the A series down by 2 in the display order on the chart - is there something like a layermanager or something ? I need to do it runtime.

regards

-Torben (using Delphi 7.1 & Teechart 6)

hgg
Newbie
Newbie
Posts: 4
Joined: Fri Aug 03, 2001 4:00 am
Location: Denmark
Contact:

Post by hgg » Tue May 25, 2004 10:19 am

P.S.

Hi again - tried the following which didn't work. Button 2 should move series A up...or ... ?

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, TeEngine, Series, StdCtrls, ExtCtrls, TeeProcs, Chart;

type
TForm1 = class(TForm)
Chart1: TChart;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
ASeries: TLineSeries;
BSeries: TLineSeries;
CSeries: TLineSeries;

public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
I : Integer;
begin
ASeries:= TLineSeries.Create(Chart1);
BSeries:= TLineSeries.Create(Chart1);
CSeries:= TLineSeries.Create(Chart1);
for I := 0 to 100 do begin
ASeries.AddXY(I,sin(I),'',clRed);
BSeries.AddXY(I,sin(I),'',clGreen);
CSeries.AddXY(I,sin(I),'',clBlue);
end;
ASeries.ParentChart := Chart1;
BSeries.ParentChart := Chart1;
CSeries.ParentChart := Chart1;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Chart1.SeriesUp(ASeries);
end;

end.

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

Post by Pep » Tue May 25, 2004 11:27 am

Hi,

to do this you should use the ExchangeSeries method. Please see the Help for details.

Post Reply