From 0175cda6150656bc74b34c6f6c71edd1e1fc653c Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@iotlink.com>
Date: 星期四, 04 二月 2021 18:22:54 +0800
Subject: [PATCH] treee, 修复tab切换时树的选中状态.添加区域

---
 src/pages/visual/components/eCharts/pie.vue |   39 ++++++++++++++++++++++++++++++++-------
 1 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/src/pages/visual/components/eCharts/pie.vue b/src/pages/visual/components/eCharts/pie.vue
index b941d79..3f5c154 100644
--- a/src/pages/visual/components/eCharts/pie.vue
+++ b/src/pages/visual/components/eCharts/pie.vue
@@ -35,6 +35,13 @@
         // }
       },
       deep:true
+    },
+    "TreeDataPool.showTreeBox":{
+      handler:function(val,oldVal){
+        if(val !== oldVal){
+          this.handleResize()
+        }
+      }
     }
   },
   computed: {
@@ -45,18 +52,32 @@
           formatter: "{a} <br/>{b}: {c} ({d}%)"
         },
         legend: {
+          //show: false,
           type:"scroll",
-          orient: "vertical",
-          // x:'right',
-          right:'30px',
-          top:'12%'
+          orient: "horizontal",
+          left: '10px',
+          right: '10px',
+          top: '35px',
+          align: 'auto',
+          textStyle: {
+            color: 'rgba(136,136,136,.6)'
+          },
+          pageTextStyle:{
+            color: 'rgba(136,136,136,.6)'
+          }
         },
         series: [
           {
             name: this.seriesName,
+            fontSize: 14,
             type: "pie",
             radius: this.radiusType,
-            center: ["40%", "50%"],
+            top: 40,
+            height: "90%",
+            // labelLine: {
+            //   length: 15
+            // },
+            //center: ["50%", "95%"],
             avoidLabelOverlap: false,
             itemStyle: {
                 emphasis: {
@@ -91,11 +112,15 @@
   methods: {
     init(){
       this.myChart.setOption(this.options)
+    },
+    handleResize(){
+      this.myChart.resize()
     }
   },
   mounted() {
-    this.myChart = this.$echarts.init(document.getElementById(this.domId))
-    this.myChart.setOption(this.options)
+    this.myChart = this.$echarts.init(document.getElementById(this.domId));
+    this.myChart.setOption(this.options);
+    this.myChart.resize();
   },
   destroyed() {
     this.myChart.dispose()

--
Gitblit v1.8.0