rob_patterson42@hotmail.com Posted January 17, 2009 Report Share Posted January 17, 2009 My question is concerning a line graph chart with the following sample points: x=9.5, y=14 x=10, y=16 x=10.2, y=21 x=10.9, y=28 x=11.6, y=30 My x-axis displays the following numeric values, using a whole number "step": 9, 10, 11, 12. As a result, the starting value at x=9.5 is not left justified to the y-axis because the starting value on the x-axis is 9. My question is, what methodology can be used to have the "left-most" initial value of the x-axis be 9.5, and the other x-axis values continue with the 10, 11, 12 pattern? Your thoughts are appreciated. Rob Quote Link to comment Share on other sites More sharing options...
AndreG Posted January 19, 2009 Report Share Posted January 19, 2009 Have you tried changing the max and the min of the X axis? chart1.AxisX.Min = 9.5;chart1.AxisX.Max = 12;chart1.AxisX.Step = 1; Quote Link to comment Share on other sites More sharing options...
rob_patterson42@hotmail.com Posted January 19, 2009 Author Report Share Posted January 19, 2009 Andre, Yes, but when I tried that my initial x-value label was missing/blank. Regards, Rob Quote Link to comment Share on other sites More sharing options...
AndreG Posted January 19, 2009 Report Share Posted January 19, 2009 That is because your initial value is not a multiple of your step. There a 2 ways to get around this (that I can think of). The first would be to set your step to .5. Then you would also get 10.5 and 11.5. If that is not the desired outcome, you might have to use custom steps. chart1.AxisX.Min = 9.5;chart1.AxisX.Max = 12;chart1.AxisX.LabelsFormat.Decimals = 1;double[] myStep = { .5, 1, 1 };chart1.AxisX.CustomSteps = myStep; Note that custom steps will start over when the array is finished. So if you set your max to 13, you will need to add a "1" to the array. Otherwise the axis will take another "half step". Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.