About
RGraph is a JavaScript charts library based on HTML5 SVG and canvas. RGraph is mature (over 15 years old) and has a wealth of features making it an ideal choice to show charts on your website.

More »

 

Download
Get the latest version of RGraph (version 6.17) from the download page. There's also older versions available, minified files and links to cdnjs.com hosted libraries.

More »

 

License
RGraph can be used for free under the GPL or if that doesn't suit your situation there's an inexpensive (£99) commercial license available.

More »

Having the yaxisScaleMin property set to 1 throws off the Y-axis scaling


Posted by larrybud at 15:38 on Tuesday 13th September 2022 [link]
I have a series of data all with integer values. I have the Y Axis inverted, and the yaxisScaleMin set to 1, and the max value set to automatic.

Note the scaling of the Y axis. The values are "off", 1,3,5,6,8,10....
Attached image:
Attached image

Posted by Richard at 16:09 on Tuesday 13th September 2022 [link]
This is because you now have a range of 9 (1 -> 10) instead of 10 (0 -> 10) and it's showing 5 labels. And 9 / 5 equals 1.8 - ie not a whole number - so the scale will be 1, 2.8, 4.6, 6.4, 8.2 and 10. But... the default is not to show decimals so those numbers get rounded to the numbers that you're seeing - 1,3,5,6,8,10.

So the solution here is to allow the use of decimals which you can do with:

yaxisScaleDecimals: 1

[Replies are now closed]