New to Telerik UI for WinUI? Download free 30-day trial

Label Definitions

If you wish to customize the default labels of the chart series, you can use a ChartSeriesLabelDefinition.

To see labels in the series you have to set the ShowLabels property to True.

More than one label definition can be set on each series by adding ChartSeriesLabelDefinition items to the LabelDefinitions collection of the chart series (see the Example below).


The ChartSeriesLabelDefinition class exposes the following properties:

  • Binding: Gets or sets the DataPointBinding instance that will retrieve the content of each label.
  • Format: Gets or sets the string used to format the label content, using the String.Format method.
  • Margin: Gets or sets the offset of each label from the four box edges.
  • HorizontalAlignment: Gets or sets the horizontal alignment of each label relative to the DataPoint it is associated with.
  • VerticalAlignment: Gets or sets the vertical alignment of each label relative to the DataPoint it is associated with.
  • LabelTemplate: Gets or sets the DataTemplate instance that may be used to define custom labels.
  • LabelTemplateSelector: Gets or sets the DataTemplateSelector instance that may be used to provide context-specific data templates, depending on the provided DataPoint.
  • DefaultVisualStyle: Gets or sets the Style instance that defines the default appearance of the labels. The Style should target the TextBlock type.
  • Strategy: Gets or sets a custom ChartSeriesLabelStrategy instance that may be used to override the labels' appearance, content and layout.


This example shows how to bind the label's content to a custom property from your business model.

Example 1: Defining the model

public class Data 
    public string Category { get; set; } 
    public double Value { get; set; } 
    public string LabelProperty { get; set; } 

Example 2: Populating with data

public sealed partial class MainPage : Page 
    public MainPage() 
        this.myChart.Series[0].ItemsSource = CreateData(); 
    public List<Data> CreateData() 
        List<Data> collection = new List<Data>(); 
        collection.Add(new Data { Category = "Apples", Value = 10, LabelProperty = "First Point" }); 
        collection.Add(new Data { Category = "Oranges", Value = 8, LabelProperty = "Second Point" }); 
        collection.Add(new Data { Category = "Pineapples", Value = 21, LabelProperty = "Third Point" }); 
        return collection; 

Example 3: Defining the RadCartesianChart and LabelDefinitions

 <Grid xmlns:telerikChart="using:Telerik.UI.Xaml.Controls.Chart"> 
    <telerikChart:RadCartesianChart  x:Name="myChart" Width="300" Height="300"> 
        <telerikChart:BarSeries ShowLabels="True"> 
                <telerikChart:ChartSeriesLabelDefinition x:Name="myDef" HorizontalAlignment="Center" VerticalAlignment="Center"  > 
                        <telerikChart:PropertyNameDataPointBinding PropertyName="LabelProperty" /> 
                        <Style TargetType="TextBlock"> 
                            <Setter Property="Foreground" Value="Red" /> 
                <telerikChart:ChartSeriesLabelDefinition x:Name="otherDef" HorizontalAlignment="Center" VerticalAlignment="Top" > 
                        <telerikChart:PropertyNameDataPointBinding PropertyName="Value" /> 
                        <Style TargetType="TextBlock"> 
                            <Setter Property="Foreground" Value="Yellow" /> 
                <telerikChart:PropertyNameDataPointBinding PropertyName="Category"/> 
                <telerikChart:PropertyNameDataPointBinding PropertyName="Value"/> 

Figure 1: Result from Example 3

WinUI RadChart Chart Label Definiton Bar Series

In this article
Not finding the help you need?