Centering labels on X axis ticks

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by hisuwh on 25th February 2014
Is there a way to centre x-axis labels on the ticks?

As you can see here:
uwhworlds.com/graphdemo.html

The labels are centred between the ticks which is quite misleading. I would prefer it if they were centred on the ticks.

Is there any way to do this?

Thanks in advance
Posted by Richard on 25th February 2014
Hi there,

You can control the X tickmarks with the numxticks option:

obj.Set('numticks', 3);

If you have a hmargin set this will of course throw the alignment out. If you wanted to keep the hmargin then you could always turn the X axis off entirely and use the drawing API X axis instead:

www.rgraph.net/fiddle/view/a-line-chart-with-hmargin-and-points-aligned-with-the-tickmarks



Richard, RGraph Support
www.rgraph.net
If RGraph has helped you - please share the website - thanks!

Add a reply




« Back to message list