Open cldougl opened 7 years ago
This needs to wait for https://github.com/plotly/plotly.js/issues/1573 to be released, which will fix this event but require the annotation to have the attribute captureevents: true
.
In https://plot.ly/javascript/text-and-annotations/#styling-and-formatting-annotations - the last part:
.on('plotly_clickannotation', function(event, data) {
Plotly.relayout('myDiv', 'annotations[' + data.index + ']', 'remove');
});
is supposed to mean that you can click on an annotation and it will disappear. But that doesn't work. You can click on the data point again to get the annotation to disappear, but not on the annotation.
While you're in there, might be good to modernize the relayout calls... to use myPlot
instead of 'myDiv'
and null
instead of 'remove'
(which is deprecated)
clickannotations
to https://plot.ly/javascript/plotlyjs-events/ and mentioncaptureevents
in the example.