Reputation: 9
is there any way to display a custom label on mouse hover chartJS annotations like it displayed on ChartJS? For example, when you create a line chart of points, and you hover one of the points, it displays the label of that point. I want something similar to that but on annotation.
Upvotes: 0
Views: 860
Reputation: 453
onHover API
options: {
// LOOK AT ME!!! I'M SO IMPORTANT!!!
onHover: function onHover (evt, activeElements) {
if (!activeElements || !activeElements.length) return;
// logic operation
this.update();
},
},
https://www.chartjs.org/docs/latest/configuration/legend.html
Upvotes: 1