Chart Legend

The Legend feature of the RadChart makes it easy for you to provide description regarding the series which are visualized within the control. In order to add the legend feature in your application, you need to initialize a new object of type RadLegend.

Chart Legend definition:

<telerikChart:RadPieChart x:Name="pieChart" HeightRequest="300">
        <local:ViewModel />
        <telerikChart:PieSeries DisplayName="Value" LegendTitleBinding="Category" ItemsSource="{Binding Data1}" ValueBinding="Value"/>
<telerikChart:RadLegend HeightRequest="200" 
                        LegendProvider="{x:Reference Name=pieChart}"/>

Figure 1: RadLegend in combination with PieChart

Pie Chart legend

As shown in Figure 1, each item within the RadLegend represents particular series. The most important property which you need to set is the LegendProvider. It should point to the chart object whose series will be included in the legend.

Here are the most important properties of the RadLegend control. In brackets is commented the type of the property:

  • LegendProvider(RadChartBase): The Chart control whose series will be described in the legend.
  • LegendItemFontSize(double): The size of the item's title text.
  • LegendItemFontColor(Color): The color of the item's title text.
  • LegendItemIconSize(Size): The size of the title icons.
  • Orientation(LegendOrientation): Sets the orientation of the legend. Can be Horizontal or Vertical.

The control can be used in combination with RadCartesianChart as well.

<telerikChart:RadCartesianChart x:Name="chart" HeightRequest="300">
    <local:ViewModel />
    <telerikChart:CategoricalAxis />
    <telerikChart:NumericalAxis />
    <telerikChart:LineSeries CategoryBinding="Category" 
                            DisplayName=" Data1"
                            ItemsSource="{Binding Data1}" />
    <telerikChart:LineSeries CategoryBinding="Category" 
                             DisplayName=" Data2"
                             ItemsSource="{Binding Data2}" />
    <telerikChart:LineSeries CategoryBinding="Category" 
                             DisplayName=" Data3"
                             ItemsSource="{Binding Data3}" />
    <telerikChart:RadLegend LegendProvider="{x:Reference Name=chart}" 

Figure 2: RadLegend in combination with CartesianChart

Cartesian Chart legend


The LegendTitleBinding is a property which can be set specifically for the PieSeries. It points to the property of the data item which will be used as a title in the legend. For all other series, the DisplayName property will be used instead.

    <telerikChart:PieSeries DisplayName="Value" 
                            ItemsSource="{Binding Data1}" 

See Also

In this article
Not finding the help you need?