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

 

WPF Chart with Trendlines

 

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