Add evnet handler callback to generate graph