From edde2a3ea44ab5e9dfe6a69bbf933259c0e105c8 Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Thu, 28 Sep 2023 13:00:52 +0800 Subject: [PATCH] fix:立行立改 --- src/views/toCarryOutLegislativeReforms/summaryPage/components/reportTypeEcharts.vue | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/views/toCarryOutLegislativeReforms/summaryPage/components/reportTypeEcharts.vue b/src/views/toCarryOutLegislativeReforms/summaryPage/components/reportTypeEcharts.vue index 388a22f..a81c9a0 100644 --- a/src/views/toCarryOutLegislativeReforms/summaryPage/components/reportTypeEcharts.vue +++ b/src/views/toCarryOutLegislativeReforms/summaryPage/components/reportTypeEcharts.vue @@ -1,5 +1,5 @@ <template> - <div :class="className" :style="{ height: height, width: width }" /> + <div id="myPieChart" :style="{ height: height, width: width }" /> </template> <script> @@ -40,6 +40,7 @@ handler(newVal) { console.log('newVal', newVal) this.seriesData = [] + this.namelist = [] const arr = [] newVal.forEach(item => { @@ -74,7 +75,12 @@ }, 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() { -- Gitblit v1.8.0