Articles in this section
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;

 

WPF Chart Legend with Formatted Text

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied