'Chart JS axis label CCS onHover
Is there a way to applied a custom style to chart js axis labels when hovered? (using ChartJS 3.7.1)
The plugin below (CodePen example) detects axis labels hovered. I am wondering if it could be adapted to apply a custom style (i.e. bold font) ?
const plugin = {
id: 'labelsHover',
afterEvent: (chart, event, opts) => {
const evt = event.event;
const [found, labelInfo] = findLabel(getLabelHitboxes(chart.scales), evt);
if (evt.type === 'mousemove' && found) {
console.clear();
console.log('Apply custom CSS to', labelInfo);
}
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
