Skip to main content

TdxChartCustomLabels.TextFormat Property

Specifies a formatting pattern for value labels.

Declaration

property TextFormat: TdxChartTextFormat read; write;

Property Value

Type Description
TdxChartTextFormat

The formatting pattern for value labels.

Remarks

Use the TextFormat property to define a formatting pattern for labels. The formatting pattern can consist of static content and one or more placeholder fields. A placeholder field is an expression enclosed in curly brackets that starts with a supported placeholder variable followed by a colon and a value formatting expression.

Text Format Example

The following expression displays a series value with two decimal places followed by a measurement unit on every simple series value label: {V:0.00}M km².

VCL Chart: A Series Value Label Format Example

Supported Placeholder Field Variables

{V}
A series point value. If custom display text is defined for a series point value, the {V} placeholder variable displays this text instead of the actual value.
{A}
A series point argument. If custom display text is defined for a series point argument, the {A} placeholder variable displays this text instead of the actual value.
{S}
A series caption.
{TV}
A total value in a simple series. This placeholder variable is not supported in an XY series.

Supported Formatting Expressions

The Chart control supports all Spreadsheet-compatible formats as well as the following formatting expressions for date/time values:

c

A label displays a date followed by a time value. ShortDateFormat and LongTimeFormat field values define date and time formats, respectively.

Note

The time value is hidden if it matches midnight.

ddddd
A label displays only a date value. The ShortDateFormat field value defines the date format.
dddddd
A label displays only a date value. The LongDateFormat field value defines the date format.
t
A label displays only a time value. The ShortTimeFormat field value defines the time format.
tt
A label displays only a time value. The LongTimeFormat field value defines the time format.

Placeholder Field Errors

A label displays the following string if the formatting pattern contains an unsupported placeholder field: 'Variable "" not found!'.

VCL Chart Control: A Placeholder Field Error

Default Value

The TextFormat property’s default value is an empty string.

Simple Series

The default TextFormat property value indicates that a simple series point label displays an argument followed by a value separated by a colon and a space character:

VCL Chart Control: A Default Simple Series Label Example

The default simple point label formatting corresponds to the following formatting pattern: '{A}: {V}'.

XY Series

The default TextFormat property value indicates that an XY series point label displays only a series value as is:

VCL Chart Control: A Default XY Simple Label Example

The default XY point label formatting corresponds to the following pattern: '{V}'.

See Also