Dear Sir,
I wanted to add Text to my chart with help of Canvas. Now my Problem is, that my text shouldn't be fixed with pixels, it should be added to the Chart with x, y cordination of the X and Y Axis.
Is it possible?
Next Problem:
I add the text now onAfterDraw. But the text is only visible when zooming. How could I see text text all time?
Add Text to Chart
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hello,
Yes, this is possible doing something like in this code:
Yes, this is possible doing something like in this code:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.FillSampleValues();
Chart1.Draw;
end;
procedure TForm1.Chart1AfterDraw(Sender: TObject);
var X,Y: Integer;
begin
X:=Chart1.Axes.Bottom.CalcXPosValue(2);
Y:=Chart1.Axes.Left.CalcYPosValue(100);
Chart1.Canvas.TextOut(X,Y,'My Custom Text');
end;
This is because you need to force the chart being drawn before calling Draw method as done in the snippet above.Next Problem:
I add the text now onAfterDraw. But the text is only visible when zooming. How could I see text text all time?
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 |