Asp.Net Chart Control - Truncated Values on X Axis

2019-08-16 08:29发布

Man I'm really stuck. I've been trying to get through this for nothing less than a week.

I'm plotting a horizontal bar chart, a simple (Y) Hours vs (X) Avg. Rate. The number of hours is fixed, I must always show from 0h to 23h, in order to maintan its readability.

The bad part of this is that whenever I have a bar plotted on 0h, it gets truncated for its positioning (right aside of X axis), like the image below.

I got some suggestions already, but I couldn't get it done:

1 - Start hour from 23h of the day before. So that I could hide the first and last values, and the actual 0h (from "today") will be a little higher. But I'm having hard times with minimum and maximum properties to achieve this.

2 - Plot the 0h a little higher (wow, genius!). But how would I do this?

Any help? Thanks in advance.

Ps: Ok, SOF couldn't let upload images on my very first post, so here is the link: http://i.stack.imgur.com/A6Bh2.png

1条回答
兄弟一词,经得起流年.
2楼-- · 2019-08-16 09:13

This is what I did when I had a similar problem

YAxis.Minimum = YourStartDate.AddSeconds(-1).ToOADate();
查看更多
登录 后发表回答