How to get poltly onclick data object while dynamically?

We want onclick data object to do some calculations in our application related functionalities. So while doing horizontal or vertical, we need onclick data object before loading plotly component. How to get it, please help on this. We stuck and it may not be possible to achieve our functionality, if we don’t get data object dynamically. Appreciate your help. Thanks

Can you share an example on CodePen ?