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....


Unit: SDL_rchart
Class: TRChart
Declaration: [1] procedure Text (x,y: double; size: integer; txt: string);
[2] procedure Text (x,y: double; size: integer; txt: string; dx, dy: integer; Alignment: TAlignment);

The method Text is used to provide short labels for data points within a chart. It displays the text txt at the position [x,y]. There are two versions available: version [1] positions the label at the specified location and uses the text alignment specified by the property TextAlignment. Version [2] allows to offset the text by a specific number of pixels given by the parameters dx and dy. The text alignment is specified by the parameter Alignment.

Only the first 15 characters of the text are stored internally. The size of the font (in points) is determined by the parameter size. The type of the font is determined by the Font  property. The transparency, the style and the colors are controlled by the properties TextBkStyle, TextFontStyle, DataColor, and TextBkColor, respectively.

Hint 1: The method Text has primarily been designed to label some data by (short) alphanumeric labels. So, do not use it to display any longer messages within the chart. In order to display user defined labels the array property TextLabels should be used, which provides more flexibility for labeling parts of a chart.

Hint 2: In the Light Edition the number of chart elements (including any text labels) is restricted to 1000 elements.

Example: This method is used in the following example program (see for downloading the code): cluster, convexhull, dendro, geodata, printcht, rctextlabel, simplepca

Last Update: 2013-Jun-19