added a basic way to resize and repaint the graphs