Error Bar change upper, lower and center errors independently of each other

1.9k views Asked by At

The charting that's included in .NET seems to have some pretty neat features (For free!), but I can't find a way to set the upper, lower and center markers on the error bars. I can set it to StandardError, FixedError(n), StandardDeviation or Percentage(n), but I can't find a way to specify that the Upper Error for this point is 100, the Lower Error is at 65 and the Center Point is at 98. The use-case is that I'm cheating and using error bars to display the Min, Max and Mean for a specific value as well as a Column series for your value.

seriesErrors("ErrorBarSeries") = "DataSeries"
seriesErrors("ErrorBarType") = "StandardError"
seriesErrors("ErrorBarStyle") = "Both"
seriesErrors("ErrorBarCenterMarkerStyle") = "Line"

The namespace for this abomination is System.Windows.Forms.DataVisualization.Charting.

As you can probably tell by the use of parentheses to specify a collection, this is in VB.Net, although I'm sure C# is having the same limitation as it's the object that I'm confused with.

Thanks!

1

There are 1 answers

0
The1nk On BEST ANSWER

Figured it out. Apparently, you need to Series.Points.AddXY(xValue, CenterMarkerInErrorBar, LowerBoundsInErrorBar, UpperBoundsInErrorBar) .. But that wasn't documented anywhere that I could find from Microsoft.

Also, if you see the above information, you can't use the first two lines, as they'll break the error bars .. somehow. The last two lines and the code in this post will work fine, though.

Special thanks to MSChart C# Error Bar Graph With Dynamic Upper and Lower Bounds for the answer!