Category / Section
How to format the legend text in WPF Chart (SfChart)?
1 min read
You can format the legend text by customizing the Font properties in WPF Chart (SfChart).
XAML
<chart:ChartLegend x:Name="Legend1" Header="Multiple Series" FontFamily="Bradley Hand ITC" FontSize="20" FontStretch="Expanded" FontStyle="Italic" FontWeight="ExtraBold" Foreground="DarkGreen"/>
C#
ChartLegend legend2 = new ChartLegend(); legend2.Header = "Multiple Series"; legend2.FontFamily = new FontFamily("Bradley Hand ITC"); legend2.FontSize = 20; legend2.FontStretch = FontStretches.Expanded; legend2.FontStyle = FontStyles.Italic; legend2.FontWeight = FontWeights.ExtraBold; legend2.Foreground = Brushes.DarkGreen; this.chart1.Legend = legend2;