[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Collapse]Charts Suite
   [Collapse]Chart Control
    [Expand]Getting Started
    [Expand]Fundamentals
    [Expand]Providing Data
    [Collapse]Chart Elements
     [Expand]Diagram
     [Collapse]Series
       Series Points
       Series Point Labels
      [Expand]Indicators
       Series Titles
       Total Labels
      Panes
     [Expand]Axes
      Legends
      Chart Titles
      Annotations
    [Expand]Appearance Customization
    [Expand]End-User Features
    [Expand]Design-Time Features
    [Expand]Examples
    [Expand]Additional Resources
   [Expand]Chart3D Control
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Series Point Labels

Labels can accompany series points to provide additional information. The following image demonstrates labels that show the series point's actual value:

This document consists of the following sections:

Expanded How to Display Series Labels

Series labels are hidden by default. Set the Series.LabelsVisibility property to true to show labels containing point values.

Expanded How to Set a Series Label Text Pattern

Specify the SeriesLabel.TextPattern property to format series label text. The pattern comprises regular text (which is displayed as is) and placeholder strings enclosed in braces. Placeholders define which values are shown in labels. You can also apply format specifiers to these values.

In the following image, series labels display points values with the series display name:

The code below shows how to assign the {}{S}: ${V:F1} M string to the TextPattern property.

Below is a list of available placeholders.

Pattern Description
{S}Displays the name of the series.
{A}Displays a series point argument.
{V}Displays series point values.
A Pie (Donut) series specific placeholders
{VP}Displays series point values as percentages.
{TV}Displays total group value.
Stacked series specific placeholders
{VP}Displays series point values as percentages.
{G}Displays the name of a stacked group.
{TV}Displays total group value.
A 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 using 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 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.

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

Note

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

To show X-axis quarter year values on the legend, use the "{A:q}" pattern.

Refer to the Format Specifiers topic in MSDN for more details.

Expanded How to Resolve Series Label Overlapping

The possibility that series labels overlap increases with the number of series points you have on a chart. The Chart control provides several algorithms to resolve these overlapping problems using the SeriesLabel.ResolveOverlappingMode property. The following table describes the various algorithms used to resolve label overlapping and shows an image with the result:

The Property Value The Resulting Image Description
SeriesLabel.ResolveOverlappingMode = Default The default algorithm changes label positions to avoid overlapping.
SeriesLabel.ResolveOverlappingMode = HideOverlapped Some labels are automatically hidden to avoid overlapping if two or more labels overlap.
SeriesLabel.ResolveOverlappingMode = JustifyAroundPoint Only labels that overlap change their positions. They are moved around their corresponding points, but their indents from the point center do not change.
SeriesLabel.ResolveOverlappingMode = JustifyAllAroundPoint All labels (not only overlapped) change their positions. They are moved around their corresponding points, but their indents from the point center do not change.
SeriesLabel.ResolveOverlappingMode = None No attempt is made to resolve labels' overlapping issues.

You can also adjust the gap between series labels using the LabelsResolveOverlappingMinIndent properties:

Use the following markup to set the Default overlapping mode, and specify minimal space between labels to 10:

The following table lists the classes and properties that are used to resolve overlapping labels:

Class or Property Description
XYDiagram2D.LabelsResolveOverlappingMinIndent Specifies the minimal distance between series labels.
SeriesLabel.ResolveOverlappingMode Specifies the resolve overlapping mode.

Expanded How to Show Labels for Zero Values

The Chart control does not display labels for points with zero values by default. To show them, use the BarSeries2D.ShowZeroValueLabels attached property as demonstrated in the example below:

The results of the code are on the following image:

Expanded How to Modify Labels' Layout

Use the LabelPosition attached property to define labels' position.

In the following image, Pie series labels are positioned in two columns:

The following code demonstrates how to accomplish this:

 

You can set an angle that specifies how a label is tilted relative to a series point. The MarkerSeries2D.Angle property defines this angle (measured in degrees) and counterclockwise from the horizontal. A value of 0 is to the left, 90 is up, 180 is to the right, etc.

The table shows the Angle property in action:

The property value Image
MarkerSeries2D.Angle = 0
MarkerSeries2D.Angle = 90

Use the following markup to set a label's tilt angle:

Expanded How to Customize Label Appearance

You can change the label text settings, or label shape using a System.Windows.DataTemplate class instance. The following image shows an example:

The code example below customizes the Side-by-Side Bar series labels using data templates:

The markup above uses the following properties:

Property Description
SeriesLabel.Indent Specifies the length of the connector that joins a label and a series point.
SeriesLabel.ConnectorThickness Defines label connector visiblilty.
ChartTextElement.ElementTemplate Defines the template that specifies how to display series labels.
Foreground, FontFamily, FontStyle, FontSize, FontWeigth and FontStretch
(inherited from System.Windows.Controls.Control)
Customize label text.

Expanded See Also

Is this topic helpful?​​​​​​​