0
votes

I created a chart in visual studio c# windows forms. The Problem is all values in the x axis is not showing on the form when form is loading. The x values are showing in alternative manner. ie, The chart showing the x axis values are

Feb, Apr, Jun, Aug, Oct, Dec

The x axis values Jan, March, May, Jul, Sep, Nov are not showing in the form when loading.

Then I deleted last two X points from the code (ie, The X values Nov & Dec). Then all the x values are visible in the chart.

What will i do for getting displayed all x axis values in the form.

The Code is Given Below. Where Ruppes is the Series name.

chart1.Series["Ruppees"].Points.AddXY("Jan",label28.Text);
            chart1.Series["Ruppees"].Points.AddXY("Feb", label29.Text);
            chart1.Series["Ruppees"].Points.AddXY("Mar", label30.Text);
            chart1.Series["Ruppees"].Points.AddXY("Apr", label31.Text);
            chart1.Series["Ruppees"].Points.AddXY("May", label32.Text);
            chart1.Series["Ruppees"].Points.AddXY("Jun", label33.Text);
            chart1.Series["Ruppees"].Points.AddXY("Jul", label34.Text);
            chart1.Series["Ruppees"].Points.AddXY("Aug", label35.Text);
            chart1.Series["Ruppees"].Points.AddXY("Sep", label36.Text);
            chart1.Series["Ruppees"].Points.AddXY("Oct", label37.Text);
            chart1.Series["Ruppees"].Points.AddXY("Nov", label38.Text);
            chart1.Series["Ruppees"].Points.AddXY("Dec", label39.Text);
1

1 Answers

0
votes

The Axis Interval needs to be set, e.g.

chart1.ChartAreas.FirstOrDefault().AxisX.Interval = 1;