Legend strikethrough not appearing when using generateLabels
See original GitHub issueExpected Behavior
When I click on a dataset label in the legend, the corresponding dataset hides and the label has a strikethrough.
Current Behavior
The dataset hides but there is no strikethrough.
Steps to Reproduce
https://codepen.io/roxennnn/pen/yLgqRvv
Context
My goal is to change the dataset legend color, removing the opacity present in the dataset’s backgroundColor
. I could do this using the generateLabels
property in options.plugins.legend.labels
. However, there is no strikethrough anymore when hiding a dataset.
Environment
- Chart.js version: 3.1.1
- Browser name and version: Firefox (v87.0b2) and Chrome (v89.0.4389.114)
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Legend strikethrough not appearing when using ...
1. var ctx = document.getElementById('myChart'); ; 2. var myChart = new Chart(ctx, { ; 3. type: 'bar', ; 4. data: { ; 5....
Read more >chart.js - Chartjs legend onclick doesn't strikethrough
1 Answer 1 ... This is because you never set the hidden property in your generateLabels so chart.js does not know which labels...
Read more >How to Change Legend Effect to Shade Unshade Instead of ...
To do this we need to use the generateLabels () function. ... how to draw charts in Chart JS by showing you in...
Read more >Legend
When using the 'chartArea' option the legend position is at the moment not configurable, it will always be on the left side of...
Read more >Hidden one of the labels by default · Issue #2794 · chartjs ...
Assume I have 5 labels in the legend, when I click one of them, Label will be rendered with a strike-through effect, and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
getDatasetMeta
is perfect for me! Thank you again!No objections