maxiaoxiao 1 an în urmă
părinte
comite
39551f3466

+ 4 - 0
src/components/echartsTemplate/3dBar.vue

@@ -44,6 +44,7 @@ let option = {
   },
   // 设置y轴
   yAxis: {
+    min: 0,
     // 显示y轴
     axisLine: {
       show: false,
@@ -245,16 +246,19 @@ export default {
       option.grid.bottom = v.gridbottom;
       option.xAxis.data = v.xData;
       option.series = [];
+      let alldata = [];
       v.yData.forEach((item, k) => {
         let o = cloneDeep(seriesItem); // JSON.parse(JSON.stringify(seriesItem));
         o.name = v.xData[k];
         o.data = item;
+        alldata = [...alldata, ...o.data];
         // if (v.interval) {
         //   option.xAxis.axisLabel.interval = 0;
         //   option.xAxis.axisLabel.rotate = 0;
         // }
         option.series.push(o);
       });
+      option.yAxis.max = Math.max(...alldata);
       // v.areaStyle ? (option.series[0].areaStyle = v.areaStyle) : null;
 
       return option;

+ 20 - 7
src/components/echartsTemplate/sankey.vue

@@ -5,19 +5,32 @@
 <script>
 // #5BB57A
 let option = {
-  // tooltip: {
-  //   trigger: "item",
-  //   triggerOn: "mousemove",
-  // },
+  grid: {
+    left: "20%",
+    top: "20%",
+    right: "40%",
+    bottom: "20%",
+  },
+  tooltip: {
+    trigger: "item",
+    triggerOn: "mousemove",
+  },
   // animation: false,
   series: {
     type: "sankey",
     layout: "none",
-    left: "10%",
+    left: "20%",
+    bottom: "10%",
     emphasis: {
       focus: "adjacency",
     },
-    label: { position: "right" },
+    label: {
+      position: "right",
+      formatter: function (params) {
+        let name = params.name;
+        return name.length > 5 ? name.substr(0, 5) + "..." : name;
+      },
+    },
     data: [],
     links: [],
     lineStyle: {
@@ -25,7 +38,7 @@ let option = {
       curveness: 0.5,
     },
     nodeWidth: 10,
-    nodeAlign: 'left',
+    nodeAlign: "left",
   },
 };
 export default {

+ 8 - 7
src/views/cockpitNew1/gdbh.vue

@@ -96,11 +96,12 @@ export default {
   top: 10px !important;
   .content {
     // border: #00FFFF 1px solid;
-    position: absolute;
-    left: 2%;
+    // position: absolute;
+    // left: 2%;
+    // top: 10px;
     width: 98%;
-    height: 140px;
-    top: 10px;
+    height: 100px;
+    margin-bottom: 20px;
   }
 
   .item {
@@ -173,9 +174,9 @@ export default {
   }
   #gdbh_echart {
     width: 100%;
-    height: 100%;
-    position: relative;
-    top: 100px;
+    height: calc(100% - 110px);
+    // position: relative;
+    // top: 110px;
   }
 }
 </style>