bind events for the graph