开发者

MSChart X-axis is starting from -1 instead of 0

开发者 https://www.devze.com 2023-02-13 17:41 出处:网络
I posted this earlier but have just regist开发者_如何学编程ered on the site today, I tried using the

I posted this earlier but have just regist开发者_如何学编程ered on the site today,

I tried using the

  YourChartArea.AxisX.IsStartedFromZero = true;

but its still starting at -1 :(

I even tried incremented my Xaxis value (value +1), the data is plotted at point 2 on the X-axis, yet the X-axis is still starting from -1.

Any other suggestions please

Thanks in advance


I think this may help:

Chart1.ChartAreas[0].AxisX.Minimum = 0;


According to the docs, that property

Gets or sets a flag which indicates whether the minimum value of the axis will be automatically set to zero if all data point values are positive

Since you are getting a -1, I'd wager that you have some negative values.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号