mirror of
https://github.com/MisskeyIO/misskey
synced 2024-12-23 02:58:18 +09:00
41 lines
579 B
TypeScript
41 lines
579 B
TypeScript
|
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 || {}));
|
||
|
}
|
||
|
}
|
||
|
});
|