0👍
You should to push labels to this.chartData.labels
instead of this.chartData.labels[0]
.
created(){
biService.getBIGraphStatsForCompany()
.then(result => result.data.propertyStatsPerMonth.forEach(field => {
this.chartData.datasets[0].data.push(field.lossEmptyUnits)
this.chartData.labels.push(field.date)
}))
.catch(error => console.error(error));
}
- Chartjs-How can I export data from a csv file or excel file to a javascript object?
- Chartjs-How to embed chart.js in angular-seed
Source:stackexchange.com