Page 1 of 1

Title Custom position questions

Posted: Tue Dec 16, 2003 10:09 am
by 8576430
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

Posted: Tue Dec 16, 2003 11:57 am
by Pep
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