The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



AddTextLabel


Unit:SDL_rchart
Class:TRChart
Declaration:function 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..MaxTxtLbl ]), or are set to the following default values, if PropertyTemplate is zero or invalid:

AttachToData true
Alignment taCenter
ColorBkg ChartColor
ColorBrd ChartFrameColor
ShadowDx 0
ShadowDy 0
ColorShadow clGray
Transparent false
Mode tlSimple

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

Example: This method is used in the following example program (see http://www.lohninger.com/examples.html for downloading the code): rctextlabel



Last Update: 2012-Oct-20