From f798ddf028ff583492cfec9d04d2530de54f46eb Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期四, 11 四月 2024 14:28:10 +0800
Subject: [PATCH] 完成检验项目统计前端页面

---
 src/util/echarts.js |   82 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 80 insertions(+), 2 deletions(-)

diff --git a/src/util/echarts.js b/src/util/echarts.js
index a2b8cc8..0842962 100644
--- a/src/util/echarts.js
+++ b/src/util/echarts.js
@@ -33,7 +33,7 @@
         top: '5%',
         left: '7%',
         right: '3%',
-        bottom: '5%',
+        bottom: '7%',
         // containLabel: true
       },
       legend: {
@@ -56,6 +56,7 @@
         },
         axisLabel: {
             color: 'rgba(43,48,52, 0.4)',
+            margin: 20
         },
         axisTick: {
             show: false
@@ -140,7 +141,7 @@
           top: '5%',
           left: '7%',
           right: '2%',
-          bottom: '5%',
+          bottom: '7%',
           // containLabel: true
       },
       xAxis: [{
@@ -150,6 +151,7 @@
           },
           axisLabel: {
               color: 'rgba(43,48,52, 0.4)',
+              margin: 20
           },
           axisTick: {
               show: false
@@ -185,6 +187,82 @@
       series: series
     };
     chart.setOption(option);
+  },
+  drawPie:function(chart,params){
+    let option = {
+      color: params.color,
+      backgroundColor: '#fff',
+      tooltip: {
+          trigger: 'item',
+          formatter: '{a} <br/>{b} : {c} ({d}%)'
+      },
+      title: {
+          text: params.percentage,
+          textStyle: {
+              color: '#4379EE',
+              fontSize: 14,
+              align: 'center',
+              fontWeight: 'normal'
+          },
+          x: 'center',
+          y: 'center',
+      },
+      grid: {
+        top:20,
+        bottom: 20,
+        left: 0,
+        right: 0
+      },
+      legend: {
+        show: false,
+      },
+      series: [
+          // 涓昏灞曠ず灞傜殑
+          {
+              radius: ['55%', '90%'],
+              center: ['50%', '50%'],
+              type: 'pie',
+              label: {
+                  show:false
+              },
+              name: params.title,
+              data: params.data,
+          },
+          // 杈规鐨勮缃�
+          {
+              radius: ['55%', '65%'],
+              center: ['50%', '50%'],
+              type: 'pie',
+              label: {
+                  normal: {
+                      show: false
+                  },
+                  emphasis: {
+                      show: false
+                  }
+              },
+              labelLine: {
+                  normal: {
+                      show: false
+                  },
+                  emphasis: {
+                      show: false
+                  }
+              },
+              animation: false,
+              tooltip: {
+                  show: false
+              },
+              data: [{
+                  value: 1,
+                  itemStyle: {
+                      color: "rgba(250,250,250,0.3)",
+                  },
+              }],
+          }
+      ]
+    };
+    chart.setOption(option);
   }
 }
 

--
Gitblit v1.9.3