Added functionality to update the graph when pressing the refresh button.