Resize Chart with CSS

Share RGraph:   Share or Like RGraph on Facebook!

« 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 canvas.style.width = 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.

Thanks
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;

RGraph.Redraw();



Richard, RGraph Support

Add a reply




« Back to message list