Can I resize my chart with CSS?
« Back to message list
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 2013Is 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
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
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