Add a new dashboard page.

This commit is contained in:
Jorge Gonzalez 2019-08-26 18:15:41 +02:00 committed by Ludovic Fernandez
parent 89150e1164
commit fd24b1898e
133 changed files with 17303 additions and 11112 deletions

View file

@ -0,0 +1,30 @@
<script>
import { Doughnut } from 'vue-chartjs'
export default {
extends: Doughnut,
props: {
chartdata: {
type: Object,
default: null
},
options: {
type: Object,
default: null
}
},
watch: {
chartdata: function (newData, oldData) {
// TODO - bug, 'update()' not update the chart, remplace for renderChart()
// console.log('new data from watcher...', newData, oldData, this.$_.isEqual(newData.datasets[0].data, oldData.datasets[0].data))
if (!this.$_.isEqual(newData.datasets[0].data, oldData.datasets[0].data)) {
// this.$data._chart.update()
this.renderChart(this.chartdata, this.options)
}
}
},
mounted () {
this.renderChart(this.chartdata, this.options)
}
}
</script>