Jump to content
Software FX Community

How to left justify line graph with y-axis


Recommended Posts

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

post-5467-13922406430927_thumb.jpg

Link to comment
Share on other sites

 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".

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...