y axis start from 10 rather than 0 in mschart using windows application

折月煮酒 提交于 2019-12-23 21:22:28

问题


HI i want to start bar from 10 rather than 0. is it possible and how?

chart1.ChartArea["ChartArea1"].AxisY.IsStartedfromZero=false

chart1.ChartArea["ChartArea1"].AxisY.minimum=10 //but this line replace 0

another command to bar start from 10 in ms chart.


回答1:


you are probably using the the wrong ChartType, what your code does is shift the baseline from Zero and instead start from 10

I presume what you really want is a Range Bar chart wherein you will have 2 values per bar representing the low and high values which would help in representing the bar midway.

Something like Product A low - 10 High 25 now this should show you a bar extending from 10 to 25. In this fashion you can set up for the other points.

EDIT Now its a bit more clear (from the link) for this you will have to use

Chart1.ChartAreas[0].AxisY.Crossing = 10;

and remove the AxisY.Minimum and you should be fine.




回答2:


Refer to the Bar Chart Custom Attributes to know about setting the start point of bar in mscharting.



来源:https://stackoverflow.com/questions/8383795/y-axis-start-from-10-rather-than-0-in-mschart-using-windows-application

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