ngx-charts bar chart is not refreshing results array updated #ngx-charts

Created on 1 Feb 2019  路  7Comments  路  Source: swimlane/ngx-charts

I'm submitting a ... (check one with "x")

  • [x] bug report - search github for a similar issue or PR before submitting
  • [ ] feature request
  • [x] support request - use StackOverflow (add the ngx-charts tag) or the gitter chat for support questions

Current behavior

Expected behavior

Reproduction of the problem

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • ngx-charts version: x.x.x

  • Angular version: x.x.x

  • 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 ]

  • Language: [all | TypeScript X.X | ES6/7 | ES5]

Most helpful comment

did you try:
this.data = [...this.data];
The above works for me.

All 7 comments

I want to update Bar Chart data dynamically when user clicks on Submit button. I tried to push the data to array but Bar chart is not updating with data

Thank you in advance

usually it works, would be helpful if you provide stackblitz example

did you try:
this.data = [...this.data];
The above works for me.

this.data = [...this.data]; this worked for me as well

it doesn't refresh graph, even if I change results data

i have the same issue like @mfatihkc. Data is being changed via subscription

Verified you are creating a new array not just mutating the array. As point above you need something like this.data = [...this.data];... this.data.push will not work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ronybarbosa picture ronybarbosa  路  3Comments

Hypercubed picture Hypercubed  路  3Comments

emeric0101 picture emeric0101  路  3Comments

lokeshdaiya picture lokeshdaiya  路  3Comments

workfel picture workfel  路  3Comments