Implemented event to update graph dynamically.