AddTextLabel

Declaration: ChartBook.Charts[].AddTextLabel(PosX, PosY: double; TxtColor: TColor; Txt: string; PropertyTemplate: integer): integer;

The method AddTextLabel can be used to add a new user defined text label. The parameters PosX and PosY define the position of the label, the parameter TxtColor specifies the color of the text, and the parameter Txt contains the text. The layer of the label is set to the active layer.

All other formatting options of the new text label either are obtained from an existing label addressed by the parameters PropertyTemplate (which is the number of the template label [1..30]), or are set to the following default values, if PropertyTemplate is zero or invalid:

AttachToData true
Alignment taCenter
ColorBkg clWhite
ColorBrd clBlack
ShadowDx 0
ShadowDy 0
ColorShadow clGray
Transparent false
Mode tlSimple

The function returns the number of the new label [1..30], or a zero value if no free label is available (a label is considered to be available if its Mode parameter is tlOff.