| | |
| | | <template> |
| | | <div :class="className" :style="{ height: height, width: width }" /> |
| | | <div id="myPieChart" :style="{ height: height, width: width }" /> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | handler(newVal) { |
| | | console.log('newVal', newVal) |
| | | this.seriesData = [] |
| | | this.namelist = [] |
| | | const arr = [] |
| | | |
| | | newVal.forEach(item => { |
| | |
| | | }, |
| | | methods: { |
| | | initChart() { |
| | | this.chart = echarts.init(this.$el, 'macarons') |
| | | if (this.chart) { |
| | | this.chart.dispose() |
| | | } |
| | | const chartDom = document.getElementById('myPieChart') |
| | | this.chart = echarts.init(chartDom) |
| | | this.chart.clear() |
| | | this.setOptions() |
| | | }, |
| | | setOptions() { |