|
|
|
@ -7,9 +7,11 @@ import * as echarts from 'echarts';
|
|
|
|
|
// require('echarts/theme/macarons') // echarts theme
|
|
|
|
|
const echart = inject('echart')
|
|
|
|
|
import resize from './mixins/resize'
|
|
|
|
|
import {toRefs} from "vue";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
mixins: [resize],
|
|
|
|
|
expose: ['setData'],
|
|
|
|
|
props: {
|
|
|
|
|
className: {
|
|
|
|
|
type: String,
|
|
|
|
@ -26,7 +28,13 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
chart: null
|
|
|
|
|
chart: null,
|
|
|
|
|
chartData:[
|
|
|
|
|
{value: 320, name: '低压报警'},
|
|
|
|
|
{value: 149, name: '高温报警'},
|
|
|
|
|
{value: 100, name: '位置报警'},
|
|
|
|
|
{value: 59, name: '电池电量报警'}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
@ -42,6 +50,10 @@ export default {
|
|
|
|
|
this.chart = null
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
setData(e) {
|
|
|
|
|
console.log(e)
|
|
|
|
|
this.initChart()
|
|
|
|
|
},
|
|
|
|
|
initChart() {
|
|
|
|
|
this.chart = echarts.init(this.$el, 'macarons')
|
|
|
|
|
|
|
|
|
@ -62,12 +74,7 @@ export default {
|
|
|
|
|
roseType: 'radius',
|
|
|
|
|
radius: [15, 95],
|
|
|
|
|
center: ['50%', '38%'],
|
|
|
|
|
data: [
|
|
|
|
|
{ value: 320, name: '低压报警' },
|
|
|
|
|
{ value: 149, name: '高温报警' },
|
|
|
|
|
{ value: 100, name: '位置报警' },
|
|
|
|
|
{ value: 59, name: '电池电量报警' }
|
|
|
|
|
],
|
|
|
|
|
data: this.chartData,
|
|
|
|
|
animationEasing: 'cubicInOut',
|
|
|
|
|
animationDuration: 2600
|
|
|
|
|
}
|
|
|
|
|