Reputation: 53
The line chart is not getting updated when I update the datasource with new data. All the other chart types are updating when I change their datasource. I noticed that the line-chart updates if I do a window resize.
Check my code on stackblitz
https://stackblitz.com/edit/angular-ojyf6g
Upvotes: 1
Views: 187
Reputation: 2250
You need to change the reference of your data source, instead of updating it.
public addNewValue() {
const newItem = {
"Value": Math.random()*100,
"Timestamp": "2019-11-26T14:34:59.203Z",
"IsError": false
}
this.adata = [...this.adata, newItem];
console.log(this.adata);
}
This is what is recommended in the documentation.
Upvotes: 2