We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"@angular/core": "^15.0.0", "chart.js": "^4.0.1", "ng2-charts": "^4.1.1"
Replacing data in lineChartData does not refresh chart.
public lineChartData: ChartConfiguration<'line'>['data'] = { labels: [], datasets: [] }; public lineChartOptions: ChartOptions<'line'> = { responsive: true }; public lineChartLegend = true;
It correctly display data the first time, but not subsequent. Logging labels and data show they are updated.
@Input() public set performanceResults(value: PortfolioPerformance[]) { this._performanceResults = value; this.setupChartData(); } setupChartData() { this.removeData(); let labels = this.generateLabels(); labels.forEach(element => { this.lineChartData.labels.push(element); }); let data = this.generateDatesets(); data.forEach(element => { this.lineChartData.datasets.push(element); }); }
<div style="display: block"> <canvas baseChart width="800" height="400" [type]="'line'" [data]="lineChartData" [options]="lineChartOptions" [legend]="lineChartLegend" > </canvas> </div>
I was hoping lineChartData.update() would fix but that does not exist.
Any help would be much appreciated!
The text was updated successfully, but these errors were encountered:
Just fixed it by reinitializing lineChartData
setupChartData() { this.lineChartData = { labels: [], datasets: [] }; let labels = this.generateLabels(); labels.forEach(element => { this.lineChartData.labels.push(element); }); let data = this.generateDatesets(); data.forEach(element => { this.lineChartData.datasets.push(element); }); }
If this is correct, please close.
Sorry, something went wrong.
No branches or pull requests
"@angular/core": "^15.0.0",
"chart.js": "^4.0.1",
"ng2-charts": "^4.1.1"
Replacing data in lineChartData does not refresh chart.
It correctly display data the first time, but not subsequent. Logging labels and data show they are updated.
I was hoping lineChartData.update() would fix but that does not exist.
Any help would be much appreciated!
The text was updated successfully, but these errors were encountered: