ICanvas.TextOut
ICanvas
procedure TextOut(X, Y: Integer; Const Text: WideString);
Type Library
TeeChartx
Description
The TextOut method displays the "St" string parameter at the specified X Y screen coordinates. Text is outputted to the correct internal Canvas. The X and Y coordinates must be valid and fit inside the Chart rectangle. It uses the current Chart.Canvas.Font attributes.
Writes text at the named co-ordinates.
Example [Visual Basic]:
TChart1.Canvas.TextOut 30, 100, "My message"
TextOut Example
This code displays a message at TChart1 center position:
Private Sub TChart1_OnAfterDraw()
' This prepares the Font attributes
TChart1.Canvas.Font.Name = TChart1.Header.Font.Name
' This sets the Text background mode to Transparent
TChart1.Canvas.Brush.Style = bsClear
' Now a 'Welcome!' message is displayed at TChart1 centre
TChart1.Canvas.TextOut (TChart1.Canvas.Left + _
(TChart1.Canvas.Width / 2)), _
(TChart1.Canvas.Top + _
(TChart1.Canvas.Height / 2)), "Welcome!"
End Sub