-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBarChart.vue
55 lines (52 loc) · 992 Bytes
/
BarChart.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<script>
import { Bar } from 'vue-chartjs'
// const { reactiveProp } = mixins
export default {
extends: Bar,
// mixins: [reactiveProp],
props: {
labels: {
type: Array,
required: true
},
data: {
type: Array,
required: true
},
scales: {
type: Object,
required: true
}
},
mounted () {
this.renderChart(
{
labels: this.labels,
datasets: this.data,
},
{
responsive: true,
maintainAspectRatio: false,
scales: {
xAxes: [
{
scaleLabel: {
display: true,
labelString: this.scales.x
}
}
],
yAxes: [
{
scaleLabel: {
display: true,
labelString: this.scales.y
}
}
]
}
}
)
}
}
</script>