Made the graph dynamically resize