jefferyBogart
jefferyBogart

Reputation: 1

MSChart X-Axis displaying even numbers?

I have an MSChart displaying data but noticed that my X-axis is displaying even numbers (i.e. 2,4,6,8) rather than all of them (i.e.1,2,3,4,5,6) etc

anyone know how to fix this?

Upvotes: 0

Views: 2328

Answers (2)

NewBie
NewBie

Reputation: 41

You can refer to your ChartArea using the index also. So try the following:

Chart1.ChartAreas[0].AxisX.Minimum =0;
Chart1.ChartAreas[0].AxisX.Maximum =10;
Chart1.ChartAreas[0].AxisX.Interval = 1;

Hope this helps you!

Upvotes: 1

Michael
Michael

Reputation: 1879

Set the Area axis interval to 1 should fix the problem for you. You can set things programatically as well:

        Chart1.ChartAreas["Default"].AxisX.Minimum = 0;
        Chart1.ChartAreas["Default"].AxisX.Maximum = 10;
        Chart1.ChartAreas["Default"].AxisX.Interval = 1;

Upvotes: 1

Related Questions