I'm currently in the process of developing an application using Vue.js along with Chartjs. A persistent issue I am facing involves making an http call to a service, fetching data, parsing it, and then passing it into my Chartjs component. The problem lies in encountering an error that says
Cannot read property '_meta' of undefined
.
Below are the key segments of my component:
<template>
<Chartjs :data="chartData" />
</template>
export default {
data () {
return {
chartData: false
}
},
created () {
this.getData()
},
methods: {
getData() {
const opts = {
url: 'some_url',
method: 'get'
}
request.callRoute(opts).then(results => {
this.chartData = results.data
}).catch(err => {
console.log(err)
})
}
},
components: {
Chartjs
}
}
It's noteworthy that the chart displays properly when I manually input data into the chartData
field from the response. However, the issue arises when I initiate an http request for the data.
Could anyone shed some light on what could be causing this problem?
Appreciate your help!