Fixed bug where the graph was updated on a single click