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

人盡茶涼 提交于 2019-12-11 13:35:10

问题


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:


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!



来源:https://stackoverflow.com/questions/20434344/error-bar-change-upper-lower-and-center-errors-independently-of-each-other

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!