Category / Section
How to get line graph average for WPF Chart (SfChart)?
1 min read
You can get the line graph average for WPF Chart (SfChart) by using trend lines. The Trend lines are used to draw lines in the chart area. The average for bar chart can be viewed by setting TrendLine and its Type to Average. The StrokeThickness, Stroke, and Label properties are used to customize the appearance of trend lines.
XAML
<Syncfusion:BarSeries Palette="Metro" Label="CompanyTurnOverDetails" ItemsSource="{Binding CompanyDetails}" XBindingPath="CompanyName" YBindingPath="CompanyTurnOver"> <Syncfusion:BarSeries.Trendlines> <!--TrendLines drawn will show the average of the graph--> <Syncfusion:Trendline StrokeThickness="2" Stroke="Aqua" Type="Power" Label="Average"></Syncfusion:Trendline> </Syncfusion:BarSeries.Trendlines> </Syncfusion:BarSeries>