updateGraph() can be used in callback