adding onclick behavior to graph