Page 1 of 1

FMX Textout example?

Posted: Fri Oct 27, 2017 10:17 pm
by 9337315
I have tried and not found any examples of using a simple textout to the FMX tchart.
i have just tried a simple example of a tchart and a button

Code: Select all

procedure TForm2.Button1Click(Sender: TObject);
begin
       Chart1.Canvas.AssignFont(Arial);
       Chart1.Canvas.TextOut(20,20,'hello');
end;
with no luck. A working example would be very much appreciated.

Re: FMX Textout example?

Posted: Tue Oct 31, 2017 8:55 am
by yeray
Hello,

Custom drawing functions usually require to be called in a drawing event such as OnAfterDraw. Ie:

Code: Select all

procedure TForm1.Chart1AfterDraw(Sender: TObject);
begin
  Chart1.Canvas.TextOut(20,20,'hello');
end;