hippofish/src/client/app/desktop/views/pages/admin/admin.chart.chart.ts
2018-08-24 07:02:52 +09:00

36 lines
534 B
TypeScript

import Vue from 'vue';
import { Line } from 'vue-chartjs';
import * as mergeOptions from 'merge-options';
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, mergeOptions({
responsive: false,
scales: {
xAxes: [{
type: 'time',
distribution: 'series'
}]
}
}, this.opts || {}));
}
}
});