diff --git a/src/components/echartsPie.vue b/src/components/echartsPie.vue index 9ebc812..5a5b5f4 100644 --- a/src/components/echartsPie.vue +++ b/src/components/echartsPie.vue @@ -54,34 +54,35 @@ export default { methods: { // 获取配置 getOption() { + // 指定图表的配置项和数据 let isAllZero = this.dataList.every(item => { - // console.log(item,"item") + // console.log(item,"item") return item.value == 0 }) - console.log(isAllZero,"isAllZero") - let option=null - if(isAllZero==true){ - for(let i =0;i { - + this.myChart = echarts.init(document.getElementById(this.id)); // 使用刚指定的配置项和数据显示图表。 this.myChart.setOption(this.getOption()); @@ -183,7 +184,7 @@ export default { // 更新图表 updateEcharts() { this.myChart.setOption(this.getOption(), true); - console.log( this.dataList," this.dataList") + console.log(this.dataList, " this.dataList") } } }