Better charts
This commit is contained in:
parent
59e2ed8ab0
commit
4dee7d91b1
12 changed files with 255 additions and 374 deletions
|
|
@ -0,0 +1,40 @@
|
|||
import Vue from 'vue';
|
||||
import { Line } from 'vue-chartjs';
|
||||
|
||||
export default Vue.extend({
|
||||
extends: Line,
|
||||
props: {
|
||||
data: {
|
||||
required: true
|
||||
},
|
||||
opts: {
|
||||
required: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
data() {
|
||||
this.render();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.render();
|
||||
},
|
||||
methods: {
|
||||
render() {
|
||||
this.renderChart(this.data, Object.assign({
|
||||
responsive: false,
|
||||
scales: {
|
||||
xAxes: [{
|
||||
type: 'time',
|
||||
time: {
|
||||
displayFormats: {
|
||||
quarter: 'YYYY/MM/D h:mm'
|
||||
}
|
||||
},
|
||||
distribution: 'series'
|
||||
}]
|
||||
}
|
||||
}, this.opts || {}));
|
||||
}
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue