Events and contorls on R Plotly on tomcat/jboss server

I am trying to mimic the click event and hover event on the graph.
I have a Html extract of the bar graph which i have developed in R. I’m using iframe to embed it in a different web app.
Now I’m sending ping to the server but not getting the same response message/e Object from the server as shown in Demo.

do I have to right any server side script to handle this.
the webapp is and the Html extract both on the same tomcat server.