Open namanpatel6 opened 5 years ago
Use Redux and when you click on legend have a function that does something like this: I have this function in my reducer:
function setActiveOffice(
state: Reporting,
action: ReportingActions.SetActiveOffice
) {
if (
state.activeOfficeSelection.some(
(office: { name: string }) => office.name === action.office
)
) {
_.remove(state.activeOfficeSelection, function(el: { name: string }) {
if (el.name === action.office) {
return true;
} else {
return;
}
});
return tassign(state);
} else {
state.activeOfficeSelection.push({ name: action.office });
return tassign(state);
}
}
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
Any update on this?
There is any update for this feature ?
@patelnaman6 Did you mean show the same data as onActivate
and onDeactivate
events?
I mean, when you hover over any chart data (bar, line), you get some data insight but if you click on legend, you only get the label name.
@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 ?
@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 ?
Could be possible to do but would require another Input to enable/disable this feature. This could work much like activeEntries
one, but instead of highlighting a serie, would be toggling the visibility.
I need this to
Any update on this?
hello, did you manage to solve this problem?
I'd also need this.
this library has 457 issues opened, I'm pretty sure you're better off implementing your own thing or just going raw with D3
I implemented myself, you can get inspiration here: ngx-multi-bar-chart-click-legend-hide-show-value
Hello, I have already managed to solve the problem adding an example in case it can help other people.
This would be quite useful for me on several projects too
I'm submitting a ... (check one with "x")
ngx-charts
tag) or the gitter chat for support questionsCurrent 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