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.

chart does not update when data is changed

See original GitHub issue

I am using the sample pie chart:

public pieChartData =  {
    chartType: 'PieChart',
    dataTable: [
      ['Task', 'Hours per Day'],
      ['Work',     11],
      ['Eat',      2],
      ['Commute',  2],
      ['Watch TV', 2],
      ['Sleep',    7]
    ],
    options: {'title': 'Tasks'},
  };

However, later if I change this.pieChartData.dataTable[1][1] = 100, the chart does not update.

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
mppfilescommented, Jan 18, 2018

You must force a chart redraw. I used it like this:

this.cchart.wrapper.setDataTable(this.pieChartData.dataTable);
this.cchart.redraw();
0reactions
Rithvik-Reddy-zzcommented, Sep 10, 2020

I have a case where I have to redraw the chart after unhiding the parent div. The chart when drawn in the hidden div seems to have an issue while calculating the width and few other variables. That seems to be the issue with google charts it self. The draw function works as expected when there is a change in data but it doesn’t redraw to adjust the width of columns when there is no change in data. Is there something I can do to redraw/refresh the chart in this context?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Excel Chart Not Updating with New Data (2 Suitable Solutions)
2 Solutions If Excel Chart Is Not Updating with New Data · Steps: · Step 1: Create Defined Names and Set Dynamic Formulas...
Read more >
Charts not updating when data is updated
Hello, I have built an Excel dashboard template that has 46 charts referencing cells in a table on the same worksheet.
Read more >
KB0163: Charts linked with Excel data link do not update after ...
Excel sends a notification to other programs when data in a cell range has changed. Due to a design limitation, described in Microsoft's...
Read more >
[SOLVED] Chart not updating - Excel Help Forum
Problem: The charts (5 of) have stopped updating when the data changes. F9 makes no difference. If I reselect the same data source...
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 >

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