Reputation: 311
For example, I added xy points in Series1 with this code.
//mock graph
chart1.Series[0].Points.Clear();
for (int i = 1; i < 10; i++)
{
chart1.Series[0].Points.AddXY(i, i);
}
chart1.Invalidate();
In short, my code adds 9 points from x=1 to x=9.
Problem is the graph also shows x=0 and x=10 which I don't want.
Anyone know how to fix this?
Upvotes: 0
Views: 109
Reputation: 311
Found it myself. For anyone who has same problem.
In properties, select ChartAreas, select Axes. In Scale, set IsMarginVisible to false.
Upvotes: 2