1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-12-22 10:38:16 +09:00
MisskeyIO/src/client/app/desktop/views/pages/admin/admin.chart.chart.ts

38 lines
565 B
TypeScript
Raw Normal View History

2018-08-24 05:37:19 +09:00
import Vue from 'vue';
import { Line } from 'vue-chartjs';
2018-08-24 07:02:52 +09:00
import * as mergeOptions from 'merge-options';
2018-08-24 05:37:19 +09:00
export default Vue.extend({
extends: Line,
props: {
data: {
required: true
},
opts: {
required: false
}
},
watch: {
data() {
this.render();
}
},
mounted() {
this.render();
},
methods: {
render() {
2018-08-24 07:02:52 +09:00
this.renderChart(this.data, mergeOptions({
2018-08-24 07:17:17 +09:00
responsive: true,
maintainAspectRatio: false,
2018-08-24 05:37:19 +09:00
scales: {
xAxes: [{
type: 'time',
distribution: 'series'
}]
}
}, this.opts || {}));
}
}
});