MENU
.net Powerful JavaScript charts
About
RGraph is a JavaScript charts library based on HTML5 SVG and canvas. RGraph is mature (over 16 years old) and has a wealth of features making it an ideal choice to use for showing charts on your website.

More »

 

Download
Get the latest version of RGraph (version 6.20, 1st December 2024) from the download page. You can read the changelog here. There's also older versions available, minified files and links to cdnjs.com hosted libraries.

Download »

 

License
RGraph can be used for free under the GPL or if that doesn't suit your situation there's an inexpensive (£129) 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 closed]