aligning the chart title
aligning the chart title
I'd like to have the chart title left-aligned to the y-axis. Selecting Alignment=left aligns the title with the margin of the chart, so it starts over the y-axis title, rather than over the y axis itself.
Custom positioning isn't quite what my customer is looking for, since using an absolute value is probably slightly off in some instances. And in any case, turning on custom positioning of the title expands the border of the graph such that the chart title appears on the graph itself, rather than above it (which is not desired).Re: aligning the chart title
Hi Trusler,
What about a TAnnotation tool? The following seems to give a quite good result for me here:
And you could call the following at your OnScroll, OnZoom and OnUndoZoom to force the text to be positioned on place even when the labels make the margin on the axis to be changed.
What about a TAnnotation tool? The following seems to give a quite good result for me here:
Code: Select all
with Chart1.Tools.Add(TAnnotationTool) as TAnnotationTool do
begin
Chart1.Title.Visible:=false;
Chart1.MarginTop:=25;
Text:='TChart';
Shape.Font.Color:=clBlue;
Shape.Transparent:=true;
Shape.Font.Size:=8;
Shape.Font.Name:='Verdana';
Left:=Chart1.Axes.Left.PosAxis;
Top:=Chart1.Axes.Left.IStartPos - 20;
end;
Code: Select all
Chart1.Draw;
if (Chart1.Tools.Count>0) then
(Chart1.Tools[0] as TAnnotationTool).Left:=Chart1.Axes.Left.PosAxis;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |