question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to update the data in line chart

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

21reactions
marjan-georgievcommented, Jan 17, 2017

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

1reaction
akrbm4commented, Apr 24, 2019

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Update the data in an existing chart - Microsoft Support
Changes you make will instantly show up in the chart. Right-click the item you want to change and input the data--or type a...
Read more >
Update, Change, and Manage the Data Used in a Chart in Excel
To edit the data selection of a chart, right click the chart and select the Select Data option - or select the chart,...
Read more >
How to auto update a chart after entering new data in Excel?
1. Select the data range and click Table under Insert tab, see screenshot: · 2. In the Create Table dialog box, if your...
Read more >
Updating Charts - Chart.js
Adding and removing data is supported by changing the data array. To add data, just add data into the data array as seen...
Read more >
Excel Tips: How to Make Charts Auto Update - GCF Global
Luckily, there is an easier way. Simply format your source data as a table, then create a chart based on that table. When...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found