ngx-charts: Line chart doesn't support real time data.

I’m submitting a … (check one with “x”)

[ 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 The line chart doesn’t support the real-time feature.

Expected behavior The line chart supports the real-time feature.

Please tell us about your environment: OS X 10.12.1

  • ng2d3 version: 1.7.3

  • Angular version: 2.1.0

  • Browser: chrome

  • Language: Typescript 2.0.3

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

As stated above, the data must be immutable.

Try this: data = [...data]

to generate a new data array from the existing one. This will make the component register the change and trigger update.

@marjan-georgiev - we should add a post in docs about this…

Related to real time data, I have created a plunkr: https://plnkr.co/edit/Nij7gO4jgqdN2mNPIFJp

My problem is that the memory consumption of the browser grows with time. Even though I slice the results array.

Any suggestions pls? 😃

This was done specifically for performance. If we wanted to get change detection to work with mutable objects, we would have to compare the data on every cycle, which is super expensive. With immutable data, we need to only compare the reference.

Read more: http://blog.thoughtram.io/angular/2016/02/22/angular-2-change-detection-explained.html http://blog.angular-university.io/how-does-angular-2-change-detection-really-work/