Align Legend to Chart title

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Perry
Newbie
Newbie
Posts: 5
Joined: Fri Nov 15, 2002 12:00 am
Location: Holland

Align Legend to Chart title

Post by Perry » Thu Nov 27, 2003 2:45 pm

Hello,
I have the Chart Title Aligned as taLeftJustify.
Now I want the legend to be on the same row as the Title. In my case the legend will always be one line.
Unfortunatly can't I find a way to get the postion of the Title.

Is there a way to do this via the Legend position custom Left en Top properties?

Thank you,
Perry

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

Post by Pep » Thu Nov 27, 2003 4:27 pm

Hi Perry,

to do this you can use the following code :

Code: Select all

  with Chart1 do
  begin
    Legend.Alignment := latop;
    Legend.CustomPosition := true;
    Draw;
    Legend.Top := Chart1.Title.Top;
    Legend.Left := Chart1.Title.Left + Chart1.Title.Width + 10;
  end;
Josep Lluis Jorge
http://support.steema.com

Perry
Newbie
Newbie
Posts: 5
Joined: Fri Nov 15, 2002 12:00 am
Location: Holland

Thanks

Post by Perry » Fri Nov 28, 2003 8:12 am

Thank you Josep,

Sometimes it is so simple!
But you have to see it :D

Perry

Post Reply