From e1e998c6cecd43a1006bfeb1bec447cf048cca57 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 17 十二月 2024 17:08:10 +0800
Subject: [PATCH] 统计增加工时统计

---
 src/util/echarts.js |   69 ++++++++++++++++++++++++++++++++++
 1 files changed, 69 insertions(+), 0 deletions(-)

diff --git a/src/util/echarts.js b/src/util/echarts.js
index 156ead4..8ccd62b 100644
--- a/src/util/echarts.js
+++ b/src/util/echarts.js
@@ -334,6 +334,75 @@
       ]
     };
     chart.setOption(option,true);
+  },
+  drawPie0:function(chart,params){
+    const colorList = ['#F09595', '#A4EEDA','#F6C18B', '#86C1F4','#91A0FC','#59CB74', '#FBD444', '#7F6AAD', '#585247']
+    let option = {
+      title: {
+      text: '鎬诲伐鏃�',
+      textStyle: {
+          fontSize: 18,
+          color: '#000',
+          lineHeight: 20
+      },
+      textAlign: 'center',
+      left: '18.8%',
+      top: '45%'
+    },
+    tooltip: {
+        trigger: 'item',
+    },
+    legend: {
+      type: 'scroll',
+      orient: 'vertical',
+      right: '10%',
+      top: 'center',
+      itemGap: 30,
+      selectedMode: false,
+      icon: 'rect',
+      data: params.data.map((d) => d.name),
+      textStyle: {
+          color: '#3D3D3D',
+          fontSize:'12px',
+          rich: {
+            name: {
+              width: 60,
+            },
+            hours: {
+              width: 60,
+            },
+            penl: {
+            width: 60,
+          }
+        }
+      },
+      formatter(name) {
+        const item = params.data.find((d) => d.name === name);
+        return `{name|${item.name}}{hours|${item.value}灏忔椂}{penl|${item.penl}%}`
+      }
+    },
+    color: colorList,
+    series: [
+      {
+        name: '宸ユ椂',
+        type: 'pie',
+        radius: [60, 90],
+        center: ['20%', '50%'],
+        label: {
+            show: false
+        },
+        labelLine: {
+            show: false
+        },
+        itemStyle: {
+            borderWidth: 1,
+            borderColor: '#fff'
+        },
+        data: params.data,
+      }
+    ]
+    }
+    chart.setOption(option,true);
   }
 }
 

--
Gitblit v1.9.3