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



TextLabels


Unit:SDL_polchart
Class: TPolChart
Declaration: property TextLabels[ix: integer]: TpcTextLabel;

The array property TextLabels contains the specifications of up to MaxTxtLbl user-defined text labels. These labels are not part of the data container and have been designed to provide a flexible means of labeling a chart. The parameter ix may vary between 1 and MaxTxtLbl.

The property TextLabels provides the following sub-properties:
property PosRad: double;
property PosPhi: double;
property AttachToData: boolean;
property ColorBkg: TColor;
property ColorBorder: TColor;
property ColorShadow: TColor;
property TransParent: boolean;
property Alignment: TAlignment;
property Font: TFont;
property Mode: TTxtLblMode;
property Caption: string;
property ShadowDx: integer;
property ShadowDy: integer;
property OnChange: TNotifyEvent;

PosRad Radial position. The position is interpreted in chart coordinates (real world coordinate system of the chart), if the property AttachToData is TRUE. Otherwise PosRad is interpreted as x-coordinate (pixels!) within the chart window.
PosPhi Angular position. The position is interpreted as chart coordinates (real world coordinate system of the chart), if the property AttachToData is TRUE. Otherwise PosPhi is interpreted as y-coordinate (pixels!) within the chart window.
AttachToData The property AttachToData determines how the position coordinates PosRad and PosPhi are interpreted by the chart. If AttachToData is TRUE the position values are seen as real world chart coordinates, thus "attaching" the label to the chart contents (panning or zooming the chart, also moves the labels). If AttachToData is FALSE, the position information is interpreted as screen coordinates (pixels) relative to the left top corner of the chart window, where PosRad determines the horizontal coordinate and PosPhi determines the vertical one. In this case the label stays in its place when the data chart is zoomed or panned. Please note that changing the attach mode during run-time requires to convert the current label coordinates from screen to chart coordinates and vice versa - otherwise the label will most probably get "lost" (use the methods R2M and M2R for conversion).
ColorBkg Color of the label background. The background color is only effective if the Transparent property is false. Note that the color of the text can be adjusted by setting the Color property of the Font.
ColorBorder Color of the label frame (Mode = tlBox) or the line below the label (Mode = tlUnderline ).
ColorShadow Color of the shadow of a label (Mode = tlShadow ). By default, ColorShadow is clGray.
ShadowDx, ShadowDy Horizontal and vertical shift of the shadow (Mode = tlShadow ).
Transparent The background of the label is transparent if the property Transparent is set TRUE. In this case the background color is ignored. Please note that the Transparent property has no effect for shadowed labels (Mode = tlShadow ).
Alignment The property Alignment determines the horizontal alignment of the text. Alignment may have the following values: taLeftJustify, taRightJustify, and taCenter.
Font The font of the label. You can select any font, style and color by setting the font properties (see Delphi manual for details).
Mode Defines the layout of the label (tlOff... label is invisible, tlSimple... just text without any lines tlUnderline... text is underlined, tlBox... a rectangular box is drawn around the label, tlShadow... a non-transparent box with a shadow is drawn)
Caption The text to be displayed. The text may have a maximum length of 255 characters. When the text contains an LF character (ASCII 10) a new line is generated, allowing a label to show several lines.
OnChange Event triggered when any parameter of the text label is changed.

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


Last Update: 2023-Dec-13