3👍
✅
Try making a computed property to calculate the chart data:
Look at chart.js
at https://www.webpackbin.com/bins/-KpNBtUKQ67-jSFRHtNe
datasets: [
{
label: 'Ticketstatus',
backgroundColor: '#f87979',
data: this.orderStatusChartData
}
.
computed: {
orderStatusChartData () {
let chartData = []
this.statOrderstatus.forEach(function(orderStatus) {
chartData.push(orderStatus.doc_count)
})
return chartData
}
Source:stackexchange.com