Hide/Show the corresponding data from the chart on legend click
See original GitHub issueI’m submitting a … (check one with “x”)
- bug report - search github for a similar issue or PR before submitting
- feature request
- support request - use StackOverflow (add the
ngx-charts
tag) or the gitter chat for support questions
Current behavior
A legend item on clicking does not hide/show the corresponding data from the chart
Expected behavior
On clicking the legend item, the corresponding data from the chart should show/hide
Reproduction of the problem
What is the motivation / use case for changing the behavior?
Required for projects
Please tell us about your environment:
Windows 10, Angular 7, ngxcharts 10, Chrome
- ngx-charts version: 10.0.0
- Angular version: 7.0.0
- Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
All
- Language: [all | TypeScript X.X | ES6/7 | ES5] Typescript
Issue Analytics
- State:
- Created 5 years ago
- Reactions:12
- Comments:13 (2 by maintainers)
Top Results From Across the Web
Hide/Show the corresponding data from the ... - Stack Overflow
I am working with angular 6 and ngx-chart and I need on clicking the legend item, the corresponding data from the chart should...
Read more >Show or hide a chart legend or data table - Microsoft Support
Select a chart and then select the plus sign to the top right. Point to Legend and select the arrow next to it....
Read more >Ngx Multi Bar Chart Click Legend Hide Show Value (forked)
Starter project for Angular apps that exports to the Angular CLI.
Read more >Hide Unhide Data Series in Chart on Legend Click | CanvasJS
By combining this with the legend events we can create charts that toggle data series visibility on click of corresponding legend items.
Read more >Chart js show/hide legend - Javascript - Java2s.com
<html lang="en"> <head> <title>Chart.js - Hide/Show Legend From Button Click</title> </head> <body translate="no"> <div style="width:45%;"> <canvas ...
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
@KingDarBoja i think that the goal of this bug is to implement show/hide serie method, if we have two series in the same chart, we can hide one and have still one is showing. isn’t it ?
Use Redux and when you click on legend have a function that does something like this: I have this function in my reducer:
Then use as with | async across all your relevant charts which display the data about the same top-level entities. This is using @ngrx/store