浏览代码

网络图提交到测试环境

tyler 2 年之前
父节点
当前提交
f375502536
共有 1 个文件被更改,包括 7 次插入7 次删除
  1. 7 7
      src/components/TreeChart/index.vue

+ 7 - 7
src/components/TreeChart/index.vue

@@ -390,7 +390,7 @@ export default {
           // that.fontSize = 10 * zoom
           currentOption.textStyle.fontSize = 10 * zoom;
           currentOption.series[0].label.fontSize = 8 * zoom;
-          currentOption.series[0].label.width = 100 * zoom;
+          currentOption.series[0].label.width = 110 * zoom;
           currentOption.series[0].label.distance = 18 * zoom;
           currentOption.series[0].leaves.distance = 18 * zoom;
           option && that.myChart.setOption(currentOption);
@@ -416,16 +416,16 @@ export default {
         this.center[0] = '-70%';
         this.center[1] = (dep * 2) + '0%';
 
-      }else if (newWidth < 500) {
+      }else if (newWidth > 200 && newWidth < 500) {
         this.center[0] = '-50%';
-        this.center[1] = (dep) + '0%';
+        this.center[1] = (dep * 1.5) + '0%';
 
-      }else if (newWidth < 1000) {
+      }else if (newWidth > 500 && newWidth < 1000) {
         this.center[0] = '-10%';
-        this.center[1] = (dep ) + '0%';
+        this.center[1] = (dep) + '0%';
 
-      } else {
-        this.center[0] = newWidth * 1.2;
+      } else if (newWidth > 1000){
+        this.center[0] = this.center[0] = elesArr.length > 60 ? newWidth * 1.2 : newWidth * 0.6;
         this.center[1] = (dep ) + '0%';
       }
       this.chartWidth = newWidth;