I have a vertical axis with labels.
Now, I need to add a custom label, showing the last value of the series.
If I add the new custom label with this code
lastValue := mySeries.YValues[k];
with mySeries.GetVertAxis.Items.Add(lastValue) do
begin
Transparent := False;
Transparency := 50;
Color := clBlue;
end;
all previous labels become invisible.
How can I add a custom label without hiding all other labels?
Thanks
FM
Custom labels and axis labels
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi FM,
To achieve what you request you should use Canvas.TextOut method in the AfterDraw event:
To achieve what you request you should use Canvas.TextOut method in the AfterDraw event:
Code: Select all
procedure TForm1.Chart1AfterDraw(Sender: TObject);
begin
Chart1.Canvas.Font.Color:=clRed;
Chart1.Canvas.TextOut(Chart1.Axes.Left.PosAxis-25,
Series1.CalcYPos(Series1.LastValueIndex),
FloatToStr(Series1.YValue[Series1.LastValueIndex]));
end;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |