friends! Today I want to ask you next question - how to change points on x-axis?

See what I have.

chart1.Series[0].Points.Clear();
chart1.Series[0].Color = Color.Red;
chart1.Series[0].BorderWidth = 2;
...
for (double i = step; i <= T; i += step)
{...
   chart1.Series[0].Points.AddXY(i, SomeVar);
}

And so I have that. enter image description here

But I don't want to see number 11. Can you understand me what I want? :)

有帮助吗?

解决方案

Try to change the min max values of your axis, this will hide the auto generated axis labels.

chart1.ChartAreas[0].AxisX.Minimum = 0;
chart1.ChartAreas[0].AxisX.Maximum = 10;

其他提示

You can use Maximum and Minimum properties of AxisX here.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top