5

I posted this earlier but have just registered on the site today,

I tried using the

  YourChartArea.AxisX.IsStartedFromZero = true;

but its still starting at -1 :(

I even tried incremented my Xaxis value (value +1), the data is plotted at point 2 on the X-axis, yet the X-axis is still starting from -1.

Any other suggestions please

Thanks in advance

3.1 FTW
  • 51
  • 1
  • 3

2 Answers2

7

I think this may help:

Chart1.ChartAreas[0].AxisX.Minimum = 0;

nycdan
  • 2,819
  • 2
  • 21
  • 33
  • 3
    Thank you so much I cant select to mark as right answer as I just registered and need like 15points? but your solution was perfect. Thanks :) – 3.1 FTW Feb 25 '11 at 21:43
0

According to the docs, that property

Gets or sets a flag which indicates whether the minimum value of the axis will be automatically set to zero if all data point values are positive

Since you are getting a -1, I'd wager that you have some negative values.

recursive
  • 83,943
  • 34
  • 151
  • 241
  • sorry for late reply, I stated a sec ago that it did work, so my apologies, I also could not mark as correct solution as I dont have enough points to do so, I just registered about 10 mins ago, and greatful I did.Thank you both :) – 3.1 FTW Feb 25 '11 at 21:45