Title Custom position questions

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

Title Custom position questions

Post by Perry » Tue Dec 16, 2003 10:09 am

Hi,

I have several questions about the Title custom position:

1. When I set Title.CustomPosition := True the grid will be aligned totally to the top. How can I prevent this so the grid stay where it was?

2. When I set Title.Alignment := taLeftJustify it will align totally to the right. I want to align it with the LeftAxis with the custom position. But because I don't know the position of the LeftAxis I can't calculate the Title.Left. How can I get the LeftAxis position so I can use it for the Title.Left?

Any help is very appreciated!

Thank you,
Perry van der Meeren

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

Post by Pep » Tue Dec 16, 2003 11:57 am

1) to prevent this you could change the MarginTop manually as in the following code.

2) You could get the left axis position in the OnBeforeDrawSeries event, the following code works fine :

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.FillSampleValues(10);
Chart1.Title.CustomPosition := true;
Chart1.MarginTop := 10;
end;

procedure TForm1.Chart1BeforeDrawSeries(Sender: TObject);
begin
Chart1.Title.Left:= chart1.Axes.Left.PosAxis;
chart1.Title.Top := 10;
end;
Josep Lluis Jorge
http://support.steema.com

Post Reply