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

SeriesView.LabelPattern Property

Specifies a string pattern that formats series label text.

Namespace: DevExpress.WinUI.Charts

Assembly: DevExpress.WinUI.Charts.v22.1.dll

NuGet Package: DevExpress.WinUI

Declaration

[DP("", Handler = "UpdateSeriesLabels")]
public string LabelPattern { get; set; }

Property Value

Type Description
String

A format pattern.

Remarks

A pattern can contain regular text (displayed as is) and placeholders in braces. You can apply a format specifier to a placeholder to format numeric and date/time values. Use a colon to separate a placeholder and specifier.

The following table contains the available placeholders:

Pattern Description
{A} Displays a series point argument.
{V} Displays a series point value.
{VP} Displays series point values as percentages (for pie, funnel, and full-stacked series).
{S} Displays the series name .
{G} Displays the name of a stacked group.

See the following topics for more information about specifiers:

If a pattern starts with a placeholder in the XAML markup, insert empty brackets into the beginning of the pattern as follows: “{}{V}”.

Example

The following example customizes the appearance of area series labels:

Area series labels are customized

<Charts:AreaSeriesView ShowMarkers="True"
                       ShowContour="True"  
                       ShowLabels="True"
                       LabelAngle="20" 
                       LabelIndent="30"
                       LabelPattern="{}${V}K">
    <Charts:AreaSeriesView.LabelConnectorStrokeStyle>
        <dxd:StrokeStyle DashArray="2 2" Thickness="1"/>
    </Charts:AreaSeriesView.LabelConnectorStrokeStyle>
    <Charts:AreaSeriesView.LabelTemplate>
        <DataTemplate>
            <Border BorderThickness="1" 
                    Opacity="1.0" 
                    BorderBrush="{Binding Path=PointColorBrush}">
                <Border.Background>
                    <SolidColorBrush Color="White"/>
                </Border.Background>
                <TextBlock Text="{Binding Path=Text}" 
                           Padding="5,1" 
                           Foreground="Black"
                           FontFamily="SegoeUI"
                           FontStyle="Normal"
                           FontSize="14"
                           FontWeight="Light"
                           FontStretch="Normal"/>
            </Border>
        </DataTemplate>
    </Charts:AreaSeriesView.LabelTemplate>
</Charts:AreaSeriesView>
See Also