Reputation: 13
I am trying to make a javascript google chart that renders and when I test responsiveness the chart does not move until I refresh the screen and the chart re-renders. Where I see this becoming a problem is turning an Ipad or phone to portrait or resizing of a window and the chart no longer being centered. Is there a way to re-render the Charts on the screen size changing?
Upvotes: 1
Views: 1312
Reputation: 61275
sure, just need to re-draw when the the 'resize'
event occurs,
something like...
window.addEventListener('resize', drawChart, false);
function drawChart() {
chart.draw();
}
Upvotes: 2