效果
饼图.gif
饼图组件 pie.vue
import echarts from 'echarts'
import { debounce } from '@/utils'
require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
export default {
props: {
opinion: {
type: Array,
default: []
},
opinionData: {
type: Array,
default: []
},
title: {
type: String,
default: ''
}
},
name: '',
data() {
return {
charts: '',
}
},
methods: {
drawPie(id) {
this.charts = echarts.init(document.getElementById(id), 'macarons')
this.charts.off('click');