Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

Support Legend Text Styling (To Visualize Hover)

Open jwedel opened this issue 2 years ago • 3 comments

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:

  • 'normal' (DEFAULT)
  • 'bold'
  • 'underlined'

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

jwedel avatar Nov 06 '23 13:11 jwedel

+1 for this

on3dd avatar Aug 14 '24 05:08 on3dd

+1

albertn-wtg avatar May 27 '25 06:05 albertn-wtg

Bump. But it should also include italics.

andrewlapointe avatar Oct 28 '25 20:10 andrewlapointe