Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Extended click event. Get what point or trace is clicked

Is there a way to receive click event (or filter existing one) when one of my trace is clicked or when particular point is clicked. Right now on click event I received point for each trace I have

If hovermode is set to ‘closest’ then click event will return only one point and not one for each trace

var layout: PlotlyLayout = {

hovermode: ‘closest’

here’s an example of a workaround:

Hiya! Plotly now has improved and consolidated Plotly.js event documentation here:

Please feel free to suggest documentation improvements in a pull request:

Has anyone found a better way to do this? I’ve tried using the code in the codepen, but it isn’t accurate enough to ascertain the exact item clicked on a scatter plot with multiple traces, I need to be able to work my way back to the label of the line that was clicked.