开发者

Zedgraph- Force curve graph to start from y-axis for datetime x points

开发者 https://www.devze.com 2023-01-03 22:20 出处:网络
In Zedgraph (asp.net) I have a datapoint list where the x values are of datetime. When the curve is drawn, the start of the graph does not begin from the y-axis. There\'s a gap between the y-axis and

In Zedgraph (asp.net) I have a datapoint list where the x values are of datetime. When the curve is drawn, the start of the graph does not begin from the y-axis. There's a gap between the y-axis and the first point. I am using XAxis.Scale.MajorUnit = DateUnit.Day.

I see a dat开发者_开发知识库e tic label at the y-axis level which is a day before the day of the first point. Basically ZedGraph is inserting a new point, a day before, (no value for y) before the first point, creating the gap. Is there a Zedgraph setting to stop this?

When I use textlabels (XAxis.Type = AxisType.Text) instead of datetime labels (XAxis.Type = AxisType.Date), it works fine but I want to use the date type.

Any ideas?


Have a look at these properties:

XAxis.Scale.MinAuto = false;
XAxis.Scale.MinGrace = 0;
XAxis.Scale.Min = (whatever your minimum DateTime is);

Chances are, MinGrace is what you're looking for, and the associated property XAxis.Scale.MaxGrace should control any gap on the maximum side.

0

精彩评论

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