Chartjs-Why can I not push data into labels?

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));
}

Leave a comment