if `hoverinfo` of trace is set to `skip` , any event has not occured.
If hoverinfo of trace is set to skip , No event handler works.
Please see it: https://codepen.io/freddicola/pen/vYRemyN
I cannot understand why the hoverinfo is related to the event handling.
I think that is not related to anything.
var data = [
{
x: ['giraffes', 'orangutans', 'monkeys'],
y: [20, 14, 23],
type: 'bar',
selected: {
marker: {
opacity: 1,
},
},
unselected: {
marker: {
opacity: 0.2,
},
},
hoverinfo: "skip",
}
];
const config = {
responsive: true,
}
const layout = {
dragmode: "zoom",
clickmode: "select+event",
};
const plot = document.getElementById('myDiv');
Plotly.newPlot(plot, data, layout, config);
plot.on("plotly_click", (data) => {
alert(data);
});
plot.on("plotly_selected", (data) => {
alert(data); // NO events are captured on here~!
});

That's by design. If you set it to none you should still get the event even though Plotly.js will not handle it.
Ah, my apologies: your CodePen is about click and selection events, not hover events, which is what I was referring to above. Yes this is indeed very strange!
Ah, my apologies: your CodePen is about click and selection events, not hover events, which is what I was referring to above. Yes this is indeed very strange!
Thanks for your interest 👍, to avoid confusing, I'll depict that more : )