Added code to resize graph when window is resized