Skip to main content

Series.LegendTextPattern Property

Gets or sets a string which represents the pattern specifying the text to be displayed within legend items when the XYSeries.ColorEach mode is enabled. .

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v14.2.dll

#Declaration

[XtraSerializableProperty]
public string LegendTextPattern { get; set; }

#Property Value

Type Description
String

A String, which represents the pattern. The default value is Empty.

#Remarks

Use the LegendTextPattern property to define a pattern for displaying text by the legend. 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.

A full list of available placeholders is detailed below.

Pattern Description
{A} Displays a series point argument.
{V} Displays series point values.
{VP} Displays series point values as percentages (for a Pie and Donut, Nested Donut series and Full-Stacked series).
{S} Displays the name of the series.
{G} Displays the name of a stacked group.
{W} Displays the weight (for a Bubble series).
{V1} Displays the first value (for a Range Area series).
{V2} Displays the second value (for a Range Area series).
{VD} Displays the duration between the first and second data point values (for a Range Area series).
{HV} Displays the high value (for a Financial Series series).
{LV} Displays the low value (for a Financial Series series).
{OV} Displays the open value (for a Financial Series series).
{CV} Displays the close value (for a Financial Series series).
NOTE

The LegendTextPattern property is in affect when the XYSeries.ColorEach property is set to true.

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

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

The image below shows this property in action with "{} {S} - {A}: {V}" patterns.

Series_LegendTextPattern

See Also