Hi,
欢迎在MSDN论坛发帖。
我这边使用下面的代码,x轴 不是从零起点开始的,你可以参考一下。
chart1.Series[0].XValueType = ChartValueType.DateTime;
DateTime x = new DateTime(2008, 11, 21);
List<DateTime> dts = new List<DateTime>();
for (int i = 0; i < 5; i++)
{
dts.Add(x.AddDays(i));
chart1.Series[0].Points.AddXY(dts[i], i + 10);
}
Best Regards,
Hart
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints
to MSDN Support, feel free to contact MSDNFSF@microsoft.com.