Page 1 of 1

[Solved] Put annotations over drawlines

Posted: Wed Mar 29, 2006 9:09 am
by 9343260
Hello,

Is it possible to set the "Z-position" of the different components of the chart ?

For instance : When I put an annotation and a drawline on the same place, the drawline is not hidden by the annotation, which is a bit annoying. Can I tell the drawline to be "behind" the annotation ?

Posted: Mon Apr 03, 2006 10:10 am
by Pep
Hi,

using the following code, the line draws behind the Annotation tool :

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.tools.Add(TDrawLineTool.Create(Chart1));
end;

procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  with (Chart1.Tools.Add(TAnnotationTool.Create(Chart1)) as TAnnotationTool) do
  begin
    ParentChart := Chart1;
    Text := 'xxxx';
    Shape.CustomPosition := True;
    Position := ppLeftTop;
    Shape.Left := x;
    shape.Top:=y;
  end;
end;

Posted: Tue Apr 04, 2006 12:12 pm
by 9343260
Thanks, it works.