0👍
The error comes from vue-chartjs
; more precisely from line 60 of the function setDatasets
, which is defined inside the file utils.ts
.
The problem can most probably be solved if you change the following line of your code.
this.chartData = { labels: res.data.labels, dataset: [{ data: res.data.data }] }
Instead of dataset
, specify datasets
as follows:
this.chartData = { labels: res.data.labels, datasets: [{ data: res.data.data }] }
If this doesn’t help, the structure of res.data.data
needs to be checked. Make sure, it complies with one of the formats expected by Chart.js.
- [Vuejs]-How can I initialize an input field with the value of a URL query parameter?
- [Vuejs]-Modal won't work in Vue / Firebase App because '$' is not defined
Source:stackexchange.com