redrawing chart on window resize