Category / Section
How to set or modify the label of the each legends ?
1 min read
Description:
This article describes how to define the label for the legend items of the series.
Solution:
You can the content of the legend icon label by changing the content of the series label by using the Label property in the series as in the following code examples.
Note: The screenshot is having the header for the legend that is defined by using the Header property of the ChartLegend.
XAML
<chart:SplineSeries Interior="DarkBlue" Label="SplineSeries" ItemsSource="{Binding}" XBindingPath="Speed" YBindingPath="Rate"/> <chart:SplineAreaSeries Opacity="0.7" Interior="SkyBlue" Label="SplineAreaSeries" ItemsSource="{Binding}" XBindingPath="Speed" YBindingPath="Rate"/>
C#
multiChart.Series[0].Label = "Spline"; multiChart.Series[1].Label = "SplineArea";
Output:
Figure 1: SfChart with legend.