第一个X datetime值和Y轴之间的间隙 [英] Gap between the first X datetime value and the Y axis
问题描述
在我的应用程序中,我使用mschart来显示数据,使用ax轴的datetime值和Y轴的数值(双)值。
In my application, I use mschart to display data using a x axis with datetime value and an Y axis with numeric (double) values.
Y轴和第一个X值之间有一个小的差距:
However, I have noticed that there is a small gap between the Y axis and the first X value:
是否有办法强制图表正好在Y轴上开始?
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);
}
聚合值是一个包含2个x,y属性的类,TimeStamp )和Value(double)
Aggregated value is a class containing the 2 x, y properties, TimeStamp (datetime) and Value (double)
推荐答案
我发现答案,
我不得不手动设置最小和最大值对于我的x轴,使用
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
这篇关于第一个X datetime值和Y轴之间的间隙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!