Resize Chart with CSS

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« 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 Curt Jeffreys on 25th October 2013
I've noticed that resizing the canvas using html properties (ie = 900px) disables .Set('chart.resizable', true);

Is there a way to prevent or correct this? After resizing a browser window user's must do a refresh of the page to get chart resize to work again.

Posted by RGraph Support on 28th October 2013
Hi there,

Instead of using CSS properties like you're doing you should use the HTML attributes. This does though have the side-effect of resetting the canvas so you'll need to redraw the chart. Resizing shouldn't be affected by this. Eg:

myChart.canvas.width = 600;
myChart.canvas.height = 250;


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

Help support RGraph - single site license only £99

Add a reply

« Back to message list