I'm submitting a ... (check one with "x")
[ ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here
Current behavior
Shows the same data all the time in the plot
Expected behavior
Update the data, specifically the series.valuewhen list item is clicked
Reproduction of the problem
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
ng2d3 version: x.x.x
"ng2d3": "^2.0.0",
Angular version: 2.x.x
"angular-cli": "1.0.0-beta.19-3",
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 ]
Chrome
Language: [all | TypeScript X.X | ES6/7 | ES5]
Typescript, HTML
@SikFar Why did you close the issue? Did you solve it, in which case how? I'm currently trying to figure out how to update the data in a line-chart but with no success.
You need to pass it a new array in order for the change detection to trigger. The charts use immutable inputs.
Simplest way would be to just do results = [...results]. This will generate a new array and trigger the change detection. This has already been answered: https://github.com/swimlane/ngx-charts/issues/118
Thanks @marjan-georgiev that worked!
Not 100% sure this is the full fix. The chart needs me to mouse over it, for it to update. Is there a way to update it without requiring the user to move the mouse over the chart to see the update?
Not 100% sure this is the full fix. The chart needs me to mouse over it, for it to update. Is there a way to update it without requiring the user to move the mouse over the chart to see the update?
I'm experiencing the same problem. Is there a way around this?
Most helpful comment
You need to pass it a new array in order for the change detection to trigger. The charts use immutable inputs.
Simplest way would be to just do
results = [...results]. This will generate a new array and trigger the change detection. This has already been answered: https://github.com/swimlane/ngx-charts/issues/118