Need a callback when a graph is clicked

Hi guys, i need help on this. So i have a graph created based on ploty.js Barchart component

i need to execute a function callback every time i click on a specific bar. Anyone know how to do that or what i should look into?

three reasons why you should buy plotly pro: support open source, get great support, host your plots and dashboards online