X axis origin label


« 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 Larry Mahar on 11th June 2013
Is it possible to have the x axis label at the origin displayed? Looks like the first label is always the first tick mark after the origin.
Posted by RGraph support on 11th June 2013
Hi there,

It can be done with the Scatter chart - which is the only chart the supports an X scale - inconjunction with the X axis drawing API object.

dev.rgraph.net/fiddle/view/471010a860fcaecb26906cd53033414c


Richard, RGraph Support

5 developer license with Priority support for £299:
   www.rgraph.net/license#five-developer
Posted by Paul on 23rd September 2013
Hi, I am currently evaluating RGraph and would love to know how to do this as I have spent a couple of hours trying but got nowhere. Unfortunately I cannot access the above fiddle link as it's password protected. Would greatly appreciate your help, as the lack of zero (aka origin) labels on the x and y axes of a scatter graph is the only thing that currently seems lacking. I will definitely need to be able to explicitly label the zero points on my graphs and am surprised I haven't been able to figure out how to. Thanks so much in advance, Paul
Posted by RGraph support on 23rd September 2013
Hi there,

That link is just outdated - try this one instead:

www.rgraph.net/fiddle/view/a-scatter-chart-with-x-labels-that-start-from-zero

For Y axis labelsthat start from zero there's also the Y axis drawing API object - or you could try setting the chart.ymin option to 0.001 - it will probably be rounded to 0 and shouldn't affect the scale much if at all.




Richard, RGraph Support
Please remember to link to the RGraph website

Help support RGraph - single site license only £99
   www.rgraph.net/license#single-site
Posted by Paul on 23rd September 2013
Many thanks for your fast response! This seems like it will be a perfect solution if I can just figure out how to ensure the xaxis is always correctly positioned (I need to allow the canvas, and hence the graph, to be resized with the browser window). Thanks again for you help.
Posted by RGraph support on 24th September 2013
Hi there,

To get an auto-resizing canvas would require you to use the window.onresize event so that you can then set the .width and .height attributes of the canvas tag.

Or if you want the canvas to be resized manually there's always the resizing feature.




Richard, RGraph Support
Please remember to link to the RGraph website

Help support RGraph - single site license only £99
   www.rgraph.net/license#single-site

Add a reply

 




« Back to message list
RGraph on social media