Series.LegendTextPattern Property

Gets or sets the legend item text pattern when the XYSeries.ColorEach mode is enabled.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v20.1.dll

Declaration

public string LegendTextPattern { get; set; }
Public Property LegendTextPattern As String

Property Value

Type Description
String

A String that specifies the label text pattern. The default value is String.Empty.

Remarks

Use the LegendTextPattern property to define a text pattern for legend items. The LegendTextPattern contains text and placeholders enclosed in braces. Placeholders define values that should be shown in labels. The {A} - {V} pattern displays a series point argument and value in each label.

You can also use standard and custom format specifiers with placeholders and data field values. For example, the {V:F1} specifier shows point values with a single decimal digit.

When the chart is bound to data, the text pattern can contain data field values. For example, if the data source contains the Discount field, you can add this field to the pattern as follows: {S}: {V:F2} (Discount: {Discount:P0}).

The following tables list the placeholders that are available for the Chart Control and Chart3D Control:

Chart Control

Pattern Description
{S} Displays the name of the series.
{A} Displays a series point argument.
{V} Displays series point values.
Pie (Donut) series specific placeholders
{VP} Displays series point values as percentages.
{TV} Displays a total group value.
Stacked series specific placeholders
{VP} Displays series point values as percentages.
{G} Displays the name of a stacked group.
{TV} Displays a total group value.
Bubble series specific placeholders
{W} Displays the weight.
Range series specific placeholders
{V1} Displays the first value.
{V2} Displays the second value.
{VD} Displays the duration between the first and second data point values formatted with a common time format (e.g., HH:MM:SS for date time values and #.## for numeric values).
{VDTD} Displays the duration between the first and second date-time data point values in days.
{VDTH} Displays the duration between the first and second date-time data point values in hours.
{VDTM} Displays the duration between the first and second date-time data point values in minutes.
{VDTS} Displays the duration between the first and second date-time data point values in seconds.
{VDTMS} Displays the duration between the first and second date-time data point values in milliseconds.
Financial series specific placeholders
{OV} Displays the open value.
{HV} Displays the high value.
{LV} Displays the low value.
{CV} Displays the close value.
Waterfall series specific placeholders
{V} Displays a value change for a rising and falling bar in relation to the previous bar value.
{VABS} Displays an absolute point value.

Chart3D Control

Placeholder Description
{S} Displays the DisplayName of the series.
{X} Displays XAxis3D values.
{Y} Displays YAxis3D values.
{Z}, {V} Displays ZAxis3D values.
Bubble series specific placeholders
{W} Displays the weight.

If you use the {S} placeholder, make sure that the Series.DisplayName property for the Chart Control or the Series3D.DisplayName property for the Chart3D Control is specified.

You can use the Chart Control's Pattern Editor to specify the label text pattern. For more information, refer to the following help topic: Pattern Editor.

The following image shows the legend with the "{} {S} - {A}: {V}" pattern.

Series_LegendTextPattern

See Also