Refreshing graph on data change