Click here to Skip to main content
15,886,091 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello. i set the Axis X maximum value like under the source.


float x = 0;
float y = 0;


for (int i = 0; i < 400; i++)
{
    x = ((float)i * 0.01f);
    y = i;
    chart1.Series[0].Points.AddXY(x, y);
}

chart1.ChartAreas[0].AxisX.IntervalOffset = 0.01;
chart1.ChartAreas[0].AxisX.Maximum = 1;
chart1.ChartAreas[0].AxisX.Maximum = 4;


and executed program.
but the i can't see the Axis X Maximum value (4).. i can see 0 , 1, 2, 3 .
why was look like this?.. is it need to setting more ?..

What I have tried:

I changed the axis x interval. but.. it was still..
Posted
Updated 24-Aug-16 5:23am
Comments
Richard MacCutchan 24-Aug-16 11:30am    
Most likely the default minimum is 0, so the closed interval [0:3] give 4 points, with the 4 point at the extreme right of the chart. Change it to 5 and see what happens.

1 solution

Did you noticed that you set Maximum 2 times?
C#
chart1.ChartAreas[0].AxisX.Maximum = 1;
chart1.ChartAreas[0].AxisX.Maximum = 4;

I guess you meant
C#
chart1.ChartAreas[0].AxisX.Minimum = 1;
chart1.ChartAreas[0].AxisX.Maximum = 4;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900