I have a radar chart made using Chart.js and I would like to change the color of the tick label when hovering over it. It’s been a couple of days I’ve tried almost everything.
I tried using the onmousemove
event handler or the onHover
callback but nothing worked. The only thing I managed is to change the cursor when hovering over the tick labels. Is there anything I can do to implement this behaviour?
Edit
What I mean by "tick label" is what I highlighted in the following picture:
2
Answers
There is a workaround to change the colour of text on the hover of the label.
Do try this and let me know if you need any more help.
In Chart.js, for a radar chart, the "tick labels" can refer to the labels on the axes that extend from the center of the chart to the outer edges. If you want to change the color of these labels when hovering over them, you can use a combination of the onHover callback and the getElementsAtEvent method.
onHover: function (event, chart) {
var point = chart.getElementAtEvent(event);
}