Showing/Hiding Based on Visibility of Lines in Chart
See original GitHub issueI have a line chart with a legend and 3 lines drawn. When you click the legend the lines show/hide and the graph adjusts accordingly. Out of the box the datalabels do not hide whenever a line is hidden. I am currently using this method of hiding the datalabels:
options: {
plugins: {
datalabels: {
display: (context: any) => {
return !context.dataset._meta[0].hidden;
},
},
},
},
This works, but the _meta[0].hidden
thing seems like a hack/not something we’re supposed to be using. Is there a different approach that is more stable?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Show Hidden Data in Excel Chart or Sparkline - Contextures
Instead of showing all the data, the chart only shows data from the visible rows. The same problem can occur with Excel sparklines...
Read more >2 Methods to Hide or Show Specific Lines in a Line Chart in ...
Next, press the “Ctrl” again. And then click the line chart. After that, you can also release the button. After that, click the...
Read more >Showing/Hiding lines with LineChart - Stack Overflow
I have the following code to display lines on my chart using ChartsRealm. How can I show/hide individual lines on the chart?
Read more >Hide / show sheet on dashboard based on filter selection
I am new to Tableau (1st week) and I'm trying to find a solution to a problem I'm having in showing / hiding...
Read more >Showing/hiding the legend - TIBCO Product Documentation
... provides information that helps the viewer identify what is represented in a visualization. You can decide whether or not the legend should...
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
That’s a bug, will be fixed in next release (labels will always be hidden if the dataset is hidden).
As a workaround, you can use: