From 20ac76481e2748bec983dbf460cd44995ae08c0c Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 22 十一月 2022 10:53:02 +0800
Subject: [PATCH] 1.看板字体整体增大

---
 src/utils/myEcharts.js |  207 ++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 169 insertions(+), 38 deletions(-)

diff --git a/src/utils/myEcharts.js b/src/utils/myEcharts.js
index edc7679..7f9b95f 100644
--- a/src/utils/myEcharts.js
+++ b/src/utils/myEcharts.js
@@ -399,6 +399,7 @@
       top: '10%',
       containLabel: true
     },
+    // animation: false, // 鍙栨秷鍔ㄧ敾
     xAxis: {
       show: false
     },
@@ -421,7 +422,7 @@
           color: function(value, index) {
             return value === '0' ? 'transparent' : '#fff'
           },
-          fontSize: 18,
+          fontSize: 20,
           // formatter: function(value, index) {
           //   return [
           //     '{lg|' + (index + 1) + '銆�   }' + '{title|' + value + '} '
@@ -494,7 +495,7 @@
             show: true,
             position: 'right',
             formatter: '{c}',
-            fontSize: 14,
+            fontSize: 20,
             color: '#fff'
             // formatter: '{c}%',
           }
@@ -933,34 +934,35 @@
         borderColor: '#fff'
       }
     },
-    xAxis: [{
-      type: 'category',
-      boundaryGap: true,
-      axisLabel: {
-        interval: 0,
-        formatter: '{value}',
-        fontSize: 14,
-        margin: 20,
-        textStyle: {
-          color: colorX
-        }
-      },
-      axisLine: {
-        lineStyle: {
-          color: '#032c58'
-        }
-      },
-      splitLine: {
-        show: false,
-        lineStyle: {
-          color: '#032c58'
-        }
-      },
-      axisTick: {
-        show: false
-      },
-      data: ['鍛ㄤ竴', '鍛ㄤ簩', '鍛ㄤ笁', '鍛ㄥ洓', '鍛ㄤ簲', '鍛ㄥ叚', '鍛ㄦ棩']
-    }],
+    xAxis: [
+      {
+        type: 'category',
+        boundaryGap: true,
+        axisLabel: {
+          interval: 0,
+          formatter: '{value}',
+          fontSize: 18,
+          margin: 20,
+          textStyle: {
+            color: colorX
+          }
+        },
+        axisLine: {
+          lineStyle: {
+            color: '#032c58'
+          }
+        },
+        splitLine: {
+          show: false,
+          lineStyle: {
+            color: '#032c58'
+          }
+        },
+        axisTick: {
+          show: false
+        },
+        data: ['鍛ㄤ竴', '鍛ㄤ簩', '鍛ㄤ笁', '鍛ㄥ洓', '鍛ㄤ簲', '鍛ㄥ叚', '鍛ㄦ棩']
+      }],
     yAxis: [
       {
         // max: 800,
@@ -969,7 +971,7 @@
         type: 'value',
         axisLabel: {
           textStyle: {
-            fontSize: 14,
+            fontSize: 18,
             color: colorY
           }
         },
@@ -1015,7 +1017,8 @@
           show: true,
           position: 'top',
           textStyle: {
-            color: '#fff'
+            color: '#fff',
+            fontSize: 16
           }
         },
         itemStyle: {
@@ -1158,7 +1161,7 @@
           title: {
             width: 50,
             align: 'right',
-            fontSize: 18
+            fontSize: 20
           }
         }
       }
@@ -1183,7 +1186,7 @@
         align: 'left',
         verticalAlign: 'center',
         lineHeight: 40,
-        fontSize: 18,
+        fontSize: 20,
         formatter: function(value, index) {
           return data[index].value + ''
         }
@@ -1286,13 +1289,13 @@
       textStyle: {
         rich: {
           name: {
-            fontSize: 18,
+            fontSize: 22,
             fontWeight: 'normal',
             color: '#fff',
             padding: [10, 0]
           },
           val: {
-            fontSize: 32,
+            fontSize: 22,
             fontWeight: 'bold',
             color: '#fff'
           }
@@ -1374,11 +1377,11 @@
             padding: [0, -50, 25, -50],
             rich: {
               icon: {
-                fontSize: 16,
+                fontSize: 18,
                 color: 'red'
               },
               name: {
-                fontSize: 16,
+                fontSize: 18,
                 padding: [0, 10, 0, 4],
                 color: '#fff'
               },
@@ -1394,3 +1397,131 @@
   }
   return option
 }
+
+// 杞﹂棿鐢熶骇  鐢熶骇淇℃伅  鐢熶骇杩涘害 杩涘害鏉�
+export function progress(param1, param2) {
+//   param1  鎶ュ伐鏁伴噺
+  //  param2   浠诲姟鏁伴噺
+
+  // 鎷垮埌鏁版嵁涔嬪悗闇�瑕佽绠楀嚭鐩稿闀垮害  param2鐨勭浉瀵归暱搴︿负100
+  let relativeValue = ''// 鐩稿鍊�  缁胯壊鑳屾櫙
+
+  relativeValue = (param1 / param2) * 100
+  // 鐧惧垎姣旀暟鍊肩殑浣嶇疆
+  var position = 'right'
+  // if (param1 >= 50) {
+  //     position = 'inside';
+  // } else if (param1 < 50) {
+  //     position = 'right';
+  // }
+
+  var option = {
+    // animation: false, // 鍙栨秷鍔ㄧ敾
+    // animationDuration: 5000,
+    grid: {
+      top: 'center',
+      left: '0%',
+      right: '0%',
+      // height: '%',
+      // containLabel: false
+      containLabel: true
+
+    },
+    xAxis: {
+      type: 'value',
+      axisLabel: {
+        show: false
+      },
+      max: 100,
+      axisTick: {
+        show: false
+      },
+      axisLine: {
+        show: false
+      },
+      splitLine: {
+        show: false
+      }
+    },
+    yAxis: [{
+      type: 'category',
+      data: [],
+      axisLabel: {
+        show: false
+      },
+      axisTick: {
+        show: false
+      },
+      axisLine: {
+        show: false
+      },
+      splitLine: {
+        show: false
+      },
+      z: 10
+    }, {
+      type: 'category',
+      axisLabel: {
+        show: false
+      },
+      axisTick: {
+        show: false
+      },
+      axisLine: {
+        show: false
+      },
+      splitLine: {
+        show: false
+      },
+      data: []
+    }],
+    series: [{
+      name: '',
+      type: 'bar',
+      barWidth: '100%',
+      // barMaxWidth: '100%',
+      label: {
+        normal: {
+          show: true,
+          // position: ['24', '38%'],
+          position: (param1.toString() + param2.toString()).length <= 6 ? ['24', '38%'] : 'insideLeft',
+          // formatter: '{c} %',
+          formatter: param1 + '/' + param2,
+          textStyle: {
+            color: '#FFFFFF',
+            fontWeight: 'bold',
+            fontFamily: 'Microsoft YaHei',
+            fontSize: 18
+          }
+        }
+      },
+      itemStyle: {
+        normal: {
+          barBorderRadius: 5,
+          shadowBlur: 10,
+          shadowColor: '#111',
+          color: '#2FD04F'
+        }
+      },
+      // data: [param1],
+      data: [relativeValue],
+      z: 10
+    }, {
+      type: 'bar',
+      barWidth: '100%',
+      yAxisIndex: 1,
+      silent: true,
+      // barMaxWidth: '100%',
+      itemStyle: {
+        normal: {
+          barBorderRadius: 5,
+          color: '#42475B'
+        }
+      },
+      // data: [param2]
+      data: [100]
+    }]
+  }
+
+  return option
+}

--
Gitblit v1.9.3