如何在图表控件中绘制x = 0的值?
在我的图表控件中,值是从x = 1绘制的,但我需要从x = 0绘制它
我正在使用visual studio 2010和.net 4.0版本
chartArea1.AxisX.IsMarginVisible = false;
chartArea1.AxisX.Minimum = 0D;
chartArea1.InnerPlotPosition.Auto = false;
chartArea1.InnerPlotPosition.Height = 72F;
chartArea1.InnerPlotPosition.Width = 74F;
chartArea1.InnerPlotPosition.X = 14F;
chartArea1.InnerPlotPosition.Y = 7F;
chartArea1.Name = "ChartArea1";
chartArea1.Position.Auto = false;
chartArea1.Position.Height = 45F;
chartArea1.Position.Width = 45F;
chartArea1.Position.X = 1F;
chartArea1.Position.Y = 10F;
chart1.Series["x1"].ChartType = SeriesChartType.Point;
for (int x = 0; x <= 15; x++)
{
chart1.Series["x1].Points.AddXY(x,l_oxvalues[x]);
}
chart1.Series["x1"].ChartArea = "ChartArea1";
上面的代码正在绘制x = 1的值,而不是从0开始
答案 0 :(得分:0)
解决了,下面的行给了我们解决方案
myChart.ChartAreas [0] .AxisX.Minimum = 0;