adjust graph on resize