Correct graph dimensions when resizing the browser