Hi,
I draw additional labels to the bottom axis using BottomAxis.DrawAxisLabel.
The attached picture shows the labels 200 and 500 added.
Now I want the custom labels to get the same format as the default labels from the bottom axis.
How can I set the properties for the custom labels (f.e. font style, font size, ...)?
Best regards
Heinz
DrawAxisLabel - Formatting
Re: DrawAxisLabel - Formatting
Hi Heinz,
I'm afraid you have to assign the properties you want to the Canvas before calling the DrawAxisLabel method. Something like this:
I'm afraid you have to assign the properties you want to the Canvas before calling the DrawAxisLabel method. Something like this:
Code: Select all
procedure TForm1.Chart1AfterDraw(Sender: TObject);
var val: Double;
begin
val:=250;
Chart1.Canvas.Font.Style:=Chart1.Axes.Bottom.LabelsFont.Style;
Chart1.Canvas.Font.Color:=Chart1.Axes.Bottom.LabelsFont.Color;
Chart1.Canvas.Font.Size:=Chart1.Axes.Bottom.LabelsFont.Size;
Chart1.Canvas.Font.Name:=Chart1.Axes.Bottom.LabelsFont.Name;
with Chart1.Axes.Bottom do DrawAxisLabel(CalcXPosValue(val), PosAxis+TickLength+2, 0, FloatToStr(val));
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: DrawAxisLabel - Formatting
Hello Yeray,
that was the missing link.
Many thanks and best regards
Heinz
that was the missing link.
Many thanks and best regards
Heinz