Disabling click events on a specific trace

I have constructed a figure with two traces – a scatter plot and a bar chart – overlaid on top of each other. I’ve successfully used clickmode=‘event+select’ to listen for click events. However, I get click events on both the bar and the scatter. I would like to limit the user to selecting only the bar graph. Is this possible?

Here’s how: https://codepen.io/etpinard/pen/BaaopPW

Amazing, thank you so much!

1 Like