Reputation: 1533
I can set the chart into the Excel but when I draw a chart using c# the X-Axis value is not have perfect gap.
like if i set
serie1.Points.AddXY(0.003247884, 16808.99);
serie1.Points.AddXY(0.006495768, 16794.35);
serie1.Points.AddXY(0.009743652, 16783.6);
serie1.Points.AddXY(0.012991540, 16767.22);
serie1.Points.AddXY(0.016239420, 16760.1);
serie1.Points.AddXY(0.019487300, 16748.68);
serie1.Points.AddXY(0.022735190, 16729.46);
I want X-serices 1.00000 , 2.00000 , 3.00000 , an so on...
in Excel the chart is
but in C# desktop application
Upvotes: 3
Views: 11124
Reputation: 358
Did you mean the axis intervals should increment by 1?.. Set the AxisX interval to 1
chart1.ChartAreas[0].AxisX.Minimum = 0;
chart1.ChartAreas[0].AxisX.Interval = 1;
Upvotes: 0
Reputation: 6060
To set the interval:
chart1.ChartAreas[0].AxisX.Minimum = 0;
chart1.ChartAreas[0].AxisX.Interval = 0.01; // Whatever you like
To "ignore" the X-Values and make them 1,2,3,4,etc.:
chart1.Series[0].IsXValueIndexed = true;
Upvotes: 2