views:

145

answers:

1

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 date 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?

A: 

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.

drharris