mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
31 lines
586 B
JavaScript
31 lines
586 B
JavaScript
import { Bar, mixins } from 'vue-chartjs'
|
|
import globalOptionsMixin from '@/components/Charts/globalOptionsMixin'
|
|
|
|
export default {
|
|
name: 'bar-chart',
|
|
extends: Bar,
|
|
mixins: [mixins.reactiveProp, globalOptionsMixin],
|
|
props: {
|
|
extraOptions: {
|
|
type: Object,
|
|
default: () => ({}),
|
|
},
|
|
},
|
|
data() {
|
|
return {
|
|
ctx: null,
|
|
}
|
|
},
|
|
mounted() {
|
|
this.$watch(
|
|
'chartData',
|
|
(newVal, oldVal) => {
|
|
if (!oldVal) {
|
|
this.renderChart(this.chartData, this.extraOptions)
|
|
}
|
|
},
|
|
{ immediate: true },
|
|
)
|
|
},
|
|
}
|