v2 first commit
This commit is contained in:
30
resources/assets/js/components/Charts/LineChart.js
vendored
Normal file
30
resources/assets/js/components/Charts/LineChart.js
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
import { Line, mixins } from 'vue-chartjs';
|
||||
import globalOptionsMixin from "./../../components/Charts/globalOptionsMixin";
|
||||
|
||||
export default {
|
||||
name: 'line-chart',
|
||||
extends: Line,
|
||||
mixins: [mixins.reactiveProp, globalOptionsMixin],
|
||||
props: {
|
||||
extraOptions: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
ctx: null
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$watch(
|
||||
'chartData',
|
||||
(newVal, oldVal) => {
|
||||
if (!oldVal) {
|
||||
this.renderChart(this.chartData, this.extraOptions);
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user