Hi all,
Hopefully this is an easy one. I\'ve set up a legend with an onclick event but would like the mouse cursor to change to \"pointer\" when I hover ove
I found a different way to make this work. This lines up more literally in my mind. Perhaps the framework was updated in the interim since this was initially answered.
// This event fires anytime you mouse over the chart canvas.
onHover: function (event) {
event.target.style.cursor = 'default';
},
responsive: true,
maintainAspectRatio: false,
legend: {
display: true,
position: 'bottom',
onHover: function (event, legendItem) {
// There is only a legendItem when your mouse is positioned over one
if (legendItem) {
event.srcElement.style.cursor = 'pointer';
}
}
}
In case anyone wants to know more, here are the docs for events and the legend.