Answer the question
In order to leave comments, you need to log in
How to pass data to chart?
I'm using the vue-chartkick charting library. There was a problem. I need to transfer my parameter from the database to the chart, in the name field, so that the names are displayed. the data transfer there consists of name - the name of the field and date - the value of this field. That is :data="[{name: "manager", data: 53}]" . I need to pass names of managers to name. I get them through vuex.
filterManagChart () {
return this.$store.getters.filterManagersChart
}
:data="[{name:filterManagChart, data: 53}]"
data:Array[1]
0:Object
data:53
name:Array[11]
data:Array[11]
0:Object
data:53
name:Array[1]
0: "Залупкин"
1:Object
data:53
name:Array[1]
1: "Пупкин"
:data="[{name:filterManagChart[0], data: 53}, {name:filterManagChart[1], data: 53}]"
but it's not very pretty. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question