add automatic update of graph in onResume