From de30afc054a9f72b49d2b81d4c7d6891a5e97e12 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期五, 08 十二月 2023 11:07:57 +0800
Subject: [PATCH] 车间正品率优化

---
 src/views/cockpitPage/components/DeviceChart.vue |   44 ++++++++++++++++++++++++++++++++++++++------
 1 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/src/views/cockpitPage/components/DeviceChart.vue b/src/views/cockpitPage/components/DeviceChart.vue
index 79d1705..7479b4a 100644
--- a/src/views/cockpitPage/components/DeviceChart.vue
+++ b/src/views/cockpitPage/components/DeviceChart.vue
@@ -57,6 +57,7 @@
       myChart = echarts.init(chartDom);
       let option;
       let lineColor = "#35ddc74d";
+      let spirit = "/cockpitPage/order-bg.png";
       if (data) {
         option = {
           color: ["#00FFFF", "#dcb018"],
@@ -64,6 +65,14 @@
             trigger: "axis",
             axisPointer: {
               type: "none",
+            },
+            textStyle: {
+              color: "#00FFFF",
+            },
+            borderColor: "#00FFFF",
+            backgroundColor: "#238d8d6b",
+            valueFormatter: function (value) {
+              return value + "%";
             },
           },
           grid: {
@@ -79,6 +88,9 @@
               show: false,
               startValue: that.startValue, // 浠庡ご寮�濮�
               endValue: that.endValue, // 涓�娆℃�у睍绀哄嚑涓�
+              zoomOnMouseWheel: false,
+              moveOnMouseWheel: true,
+              moveOnMouseMove: true,
             },
           ],
           legend: {
@@ -104,7 +116,7 @@
                 // rotate:45,
                 margin: 10,
                 show: true,
-                fontSize:12,
+                fontSize: 12,
                 textStyle: {
                   color: function (params, index) {
                     let colorList = ["#dcb018", "#00FFFF"];
@@ -154,24 +166,44 @@
               axisTick: {
                 show: false,
               },
-
               axisLabel: {
                 textStyle: {
                   color: "#00FFFF",
                 },
-                formatter: "{value}%",
+                formatter: function (value) {
+                  return `${value}%`;
+                },
               },
             },
           ],
           series: [
             {
-              type: "bar",
+              type: "pictorialBar",
               name: "",
-              barWidth: "15",
+              symbol: spirit,
+              symbolRepeat: true,
+              symbolMargin: "25%",
+              symbolClip: true,
+              symbolSize: [4, 11],
+              barCategoryGap: "40%",
               label: {
                 show: true,
                 position: "right",
-                color: "#00FFFF",
+                formatter: function (params) {
+                  if (params.dataIndex % 2 == 0) {
+                    return `{a|${params.value}%}`;
+                  } else {
+                    return `{b|${params.value}%}`;
+                  }
+                },
+                rich: {
+                  a: {
+                    color: "#00FFFF",
+                  },
+                  b: {
+                    color: "#dcb018",
+                  },
+                },
               },
               itemStyle: {
                 normal: {

--
Gitblit v1.8.0