问题
In my application, I use mschart to display data using a x axis with datetime value and an Y axis with numeric (double) values.
However, I have noticed that there is a small gap between the Y axis and the first X value:
Is there a way to force the graph to start exactly on the Y axis?
EDIT: Here is what I use to populate my series:
foreach (AggregatedValue value in line.Value)
{
series.Points.AddXY(value.TimeStamp.ToLocalTime(), value.Value);
}
Aggregated value is a class containing the 2 x, y properties, TimeStamp (datetime) and Value (double)
回答1:
I found the answer, I had to set manually the Minimum and Maximum value for my x-axis, using
chart.ChartAreas[0].AxisX.Minimum and chart.ChartAreas[0].AxisX.Maximum
来源:https://stackoverflow.com/questions/14841761/gap-between-the-first-x-datetime-value-and-the-y-axis