mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-11 13:43:08 +02:00
36 lines
488 B
TypeScript
36 lines
488 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',
|
||
|
distribution: 'series'
|
||
|
}]
|
||
|
}
|
||
|
}, this.opts || {}));
|
||
|
}
|
||
|
}
|
||
|
});
|