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 »

Large numbers are not displayed correctly on my Y-axis


Posted by Joachim at 17:23 on Wednesday 15th November 2023 [link]
Hello,
i've large numbers on the y-axis and it seems that there is not enough space.
I've tested it with the demo file RGraph/demos/line-basic.html and this data:
data: [9000,6000,8000,5000,4000,2000,3000],

How can i solve this issue?
Thank you in advance.
Attached image:
Attached image

Posted by Richard at 20:00 on Wednesday 15th November 2023 [link]
You should increase the left margin - which will mean that there's more space available for the labels. For example you could set it to 60 pixels wide:
// ...
marginLeft: 60,
// ...

On that demo though you'll need to set both the marginLeft property of the Line chart and also the drawing API background grid object - otherwise if they're both different it won't look quite correct.

Posted by Joachim at 09:46 on Thursday 16th November 2023 [link]
Setting it in both objects did the Trick.
Thank you very much.

[Replies are now closed]