misskey-awawa/src/client/app/desktop/views/pages/admin/admin.chart.chart.ts

36 lines
488 B
TypeScript
Raw Normal View History

2018-08-23 20:37:19 +00:00
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',
distribution: 'series'
}]
}
}, this.opts || {}));
}
}
});