Asp.Net Chart Control - Truncated Values on X Axis

半腔热情 提交于 2019-12-12 01:23:01

问题


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:


This is what I did when I had a similar problem

YAxis.Minimum = YourStartDate.AddSeconds(-1).ToOADate();


来源:https://stackoverflow.com/questions/11454233/asp-net-chart-control-truncated-values-on-x-axis

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