redraw graph when window size changes