chartjs / Chart.js

Simple HTML5 Charts using the <canvas> tag
https://www.chartjs.org/
MIT License
64.7k stars 11.92k forks source link

Support Legend Text Styling (To Visualize Hover) #11571

Open jwedel opened 12 months ago

jwedel commented 12 months ago

Feature Proposal

Proposal

I propose to to add a new fontStyle property (or something similar) to the LegendItem interface.

This should allow at least the following values:

Use Case

We use an on click handler to hide datasets using the legend. This is currently a 'hidden feature' as there is no visual clue to the user that the legend is an interactive user element. You have to know it or read the documentation.

To increase accessibility, we would like to change the text style of the currently hovered element to 'bold' or 'underlined'.

Side Note

This could be a general pattern to implement for other labels in ChartJS.

Possible Implementation

No response

on3dd commented 2 months ago

+1 for this