Skip to main content
A newer version of this page is available. .

TotalLabel.TextPattern Property

Gets or sets the text pattern the Chart Control uses to generate the Total Label’s text.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v18.2.dll

Declaration

[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
[XtraSerializableProperty]
public string TextPattern { get; set; }

Property Value

Type Description
String

The text pattern. The default value is Empty.

Remarks

Use the TextPattern property to define a pattern for a text that total labels display. Various placeholders enclosed in braces correspond to the available display patterns. For example, a pair of placeholders specified together (e.g., {A} - {V}), will cause each data point to be represented by both its argument and value, separated by a hyphen.

Note

Total labels are hidden by default for a series. To see how the TextPattern property affects the label format, set the TotalLabel.Visible property to true.

A full list of available placeholders is detailed below.

Pattern Description
{S} Displays the name of the series.
{G} Displays the name of a stacked group.
{A} Displays a series point argument.
{TV} Displays total group value.

You can also use standard and custom format specifiers, together with the placeholders (e.g., {TV:F1}).

Note

Before specifying the {S} placeholder for a series, make sure a series name is specified in the Series.DisplayName property.

To use X-axis quarter year values within a label text, use the “{A:q}” pattern.

To learn more, refer to the Format Specifiers topic in MSDN.

In addition, you can specify a pattern using the Pattern Editor (the editor is invoked by clicking the ellipsis button of the TextPattern property in the Properties window of the Chart Designer).

Example

PieSeriesView pieView = (PieSeriesView)pieChartControl.Series["Land Area"].View;
pieView.TotalLabel.Visible = true;
pieView.TotalLabel.TextPattern = "Total\r\n{TV:F2} km\xB2";

The following code snippets (auto-collected from DevExpress Examples) contain references to the TextPattern property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also