We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ErrorBar Chart for Standard Deviation

Hello, 

I'm trying to draw ErrorBars for a standard deviation function I was given on a Chart of type Line which displays averages.

I have the following model bound to the chart control

public class ChartDataModel 
{
    public string GroupValuesName {get;set;}
    public List<double> Values {get;set;}
    public double Average {get;set;}
    public double StandardDeviation {get;set;}   
}

I'm calculating the standard deviation which is a double in the following manner: 

var model = new ChartDataModel();
model.GroupValuesName = "GroupName";
model.Values = GetValues();
model.Average = model.Values.Average();

var count = model.Values.Count();
var sum = model.Values.Sum(value => (value - model.Average) * (value - model.Average));

model.StandardDeviation = Math.Sqrt(sum/count);

I want to show the standard deviation double value as the VerticalNegativeErrorValue and VerticalPositiveErrorValue of the ErrorBar in my chart line series.

I'm passing the data to the chart on the c# server side.

All the examples in the documentation show how to bind the server side model to the Chart control and set the series XName and YName values, where the YName in my situation would be the Average property of my data model.

What type should my series be and how would I draw my double model.StandardDeviation properties as the Positive and Negative Error value of the ErrorBar?












1 Reply

AT Anandaraj T Syncfusion Team March 17, 2017 01:07 PM UTC

Hi Pantelis, 

Thanks for using Syncfusion products. 

We found that you have created a support incident under your account for the same query. We suggest you to follow up the support incident for better solution. 

Please let us know if you have any concern. 

Regards, 
Anand 


Loader.
Live Chat Icon For mobile
Up arrow icon