From 2e6cfde0e6533c734bd5fe81a5d62b931098f6a3 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期二, 05 十二月 2023 16:51:51 +0800
Subject: [PATCH] 人员,物料y轴超出文字点点点

---
 src/views/cockpitPage/components/MachineStartupRate.vue |   29 ++++++++++++++++++++---------
 1 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/src/views/cockpitPage/components/MachineStartupRate.vue b/src/views/cockpitPage/components/MachineStartupRate.vue
index 5e66228..e9eed89 100644
--- a/src/views/cockpitPage/components/MachineStartupRate.vue
+++ b/src/views/cockpitPage/components/MachineStartupRate.vue
@@ -5,7 +5,7 @@
         <img src="/cockpitPage/machine-top.png" alt="" />
         <div class="top-title">
           <span>鏈哄櫒寮�鏈虹巼</span>
-          <span class="top-rate">{{ "60%" }}</span>
+          <span class="top-rate">{{ startupRate + "%" }}</span>
         </div>
       </div>
       <div class="chart" ref="chart"></div>
@@ -18,17 +18,22 @@
 import * as echarts from "echarts";
 export default {
   components: {},
-  props: {},
+  props: {
+    startupRate: {
+      type: String,
+      default: "",
+    },
+  },
   data() {
     return {};
   },
   mounted() {
-    let chartData = [
-      { value: 20, name: "闂茬疆" },
-      { value: 20, name: "缁翠慨" },
-      { value: 60, name: "宸ヤ綔" },
-    ];
-    this.pieChart("chart", chartData);
+    // let chartData = [
+    //   { value: 20, name: "闂茬疆" },
+    //   { value: 20, name: "缁翠慨" },
+    //   { value: 60, name: "宸ヤ綔" },
+    // ];
+    // this.pieChart("chart", chartData);
   },
   watch: {},
   methods: {
@@ -71,6 +76,7 @@
               label: {
                 color: "#01f7fd",
                 fontSize: 14,
+                padding: [0, -60],
                 formatter: function (params) {
                   return `{a|${params.name}} {b|${params.value + "%"}}`;
                 },
@@ -94,8 +100,13 @@
               },
               labelLine: {
                 show: true,
-                length: 50,
+                length: 40,
                 color: "blue",
+                length2: 70,
+              },
+              labelLayout: {
+                verticalAlign: "bottom",
+                dy: -5,
               },
               data: data,
             },

--
Gitblit v1.8.0