RGraph is a JavaScript charts library based on
HTML5 SVG and canvas. RGraph is mature (over 17 years
old) and has a wealth of features making it an ideal
choice to use for showing charts on your website.
In version 6.21 a new datagrid object has been added.
This makes it easy to add static or dynamic data
tables to your pages. It can be used whether you use the
canvas or SVG libraries or entirely standalone.
Get the latest version of RGraph (version 6.21, 10th April 2025) 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.
It's in the canvas section of the website but does apply to SVG charts too.
Posted by darekbod at 22:14 on Sunday 23rd March 2025[link]
Are you trying to change the size based on the screen size? - No by changing div container.
When I changing DIV console('...') is called - which means the action is caught correctly - then graf() must be called, then new RGraph.SVG.Bar({...}).wave(); must be called, but instead new chart is made it disappears and the SVG container disappears too from document. No allert is generated, no error, just gone and only console('...') is repeated...
Posted by Richard at 23:11 on Sunday 23rd March 2025[link]
Instead of trying to set the .innerHTML of (presumably) the container - try calling the RGraph.SVG.reset('chart-container') function - just before you try and draw the chart again.
Posted by Richard at 16:32 on Tuesday 25th March 2025[link]
After some conversation on Facebook about this issue this was the result:
----------8<----------
Thank you for sending me the code. I've created a test page on CodePen that resets the object every time the div is resized. I think that you could maybe combine this with the responsive function, which is documented here: