From b8ee668eaace5d422ebb27a200c3b178b82e2a6d Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 23 八月 2022 22:55:03 +0800
Subject: [PATCH] 1.提交

---
 src/utils/myEcharts.js |  125 +++++++++++++++++++++++++++++++++++------
 1 files changed, 106 insertions(+), 19 deletions(-)

diff --git a/src/utils/myEcharts.js b/src/utils/myEcharts.js
index b38af77..d13b9ba 100644
--- a/src/utils/myEcharts.js
+++ b/src/utils/myEcharts.js
@@ -350,21 +350,32 @@
 }
 
 // 缁煎悎鐪嬫澘鍥�
-export function bar02() {
-  const data = [70, 60, 50, 40, 30]
+export function bar02(dataArr, titlenameArr) {
+  // console.log(val)
+  // const data = [70, 60, 50, 40, 30]
+  // const titlename = ['澶栬鍒掍激', '琛ㄩ潰娌规薄', '灏哄', '棰滆壊', '澶у皬']
+  // const data = val.map(i => i.cont)
+  // const titlename = val.map(i => i.name)
+  const data = dataArr
 
-  const titlename = ['澶栬鍒掍激', '琛ㄩ潰娌规薄', '灏哄', '棰滆壊', '澶у皬']
+  const titlename = titlenameArr
+
   const valdata = [683, 500, 400, 300, 200]
-  const myColor = ['#FF0000', '#FF5511', '#FF8800', '#FFBB00', '#FFFF00']
+  // const myColor = ['#FF0000', '#FF5511', '#FF8800', '#FFBB00', '#FFFF00']
+  // const myColor = ['#0000FF']
+  // const myColor = ['#7af5f5', '#00FFFF', '#00FFFF', '#00FFFF', '#00FFFF']
+  const myColor = ['rgba(122,245,245,1)', 'rgba(122,245,245,0.95)', 'rgba(122,245,245,0.9)', 'rgba(122,245,245,0.85)', 'rgba(122,245,245,0.8)']
   const option = {
     backgroundColor: 'transparent',
     title: {
-      text: 'Top5涓嶈壇',
-      x: 'center',
+      show: false,
+      text: '涓�鍛ㄥ唴Top5涓嶈壇锛�',
+      x: '2%',
       y: '4%',
       textStyle: {
-        color: '#fff',
-        fontSize: '22'
+        color: '#d8d7d9',
+        fontSize: '18'
+        // fontWeight: 'lighter'
       },
       subtextStyle: {
         color: '#90979c',
@@ -373,8 +384,8 @@
       }
     },
     grid: {
-      left: '2%',
-      right: '2%',
+      left: '10%',
+      right: '5%',
       bottom: '0%',
       top: '10%',
       containLabel: true
@@ -397,16 +408,18 @@
           show: false
         },
         axisLabel: {
+          // color: '#d8d7d9',
           color: '#fff',
           fontSize: 14,
-          formatter: function(value, index) {
-            return [
-              '{lg|' + (index + 1) + '銆�   }' + '{title|' + value + '} '
-            ].join('\n')
-          },
+          // formatter: function(value, index) {
+          //   return [
+          //     '{lg|' + (index + 1) + '銆�   }' + '{title|' + value + '} '
+          //   ].join('\n')
+          // },
           rich: {
             lg: {
               // backgroundColor: '#339911',
+              // color: '#d8d7d9',
               color: '#fff',
               borderRadius: 15,
               // padding: 5,
@@ -473,7 +486,7 @@
   return option
 }
 
-// 浠撳簱绠$悊鐪嬫澘鍥�
+// 浠撳簱绠$悊鐪嬫澘鍥�   锛堝純鐢級
 export function bar03(titleText) {
   const path = 'path://M214,1079l8-6h16l8,6-8,6H222Z'
   const zzx1 = ['800', '900', '700', '300', '500', '800', '700']
@@ -497,11 +510,13 @@
     },
     title: {
       text: titleText,
-      x: '70%',
+      x: '66%',
       y: '2%',
       textStyle: {
-        color: '#fff',
-        fontSize: '22'
+        // color: '#fff',
+        color: '#00ffff',
+        fontSize: '18',
+        fontWeight: 'lighter'
       },
       subtextStyle: {
         color: '#90979c',
@@ -684,3 +699,75 @@
 
   return option
 }
+
+// 閲囪喘璁㈠崟鍥�
+export function pie01() {
+  const option = {
+    backgroundColor: 'transparent',
+    title: {
+      text: '60.21%',
+      x: 'center',
+      y: 'center',
+      textStyle: {
+        fontWeight: 'normal',
+        color: '#fff',
+        fontSize: 18
+      }
+    },
+    color: ['rgba(176, 212, 251, 1)'],
+    legend: {
+      show: false,
+      itemGap: 12,
+      data: ['01', '02']
+    },
+
+    series: [
+      {
+        name: 'Line 1',
+        type: 'pie',
+        clockWise: true,
+        radius: ['50%', '66%'],
+        itemStyle: {
+          normal: {
+            label: {
+              show: false
+            },
+            labelLine: {
+              show: false
+            }
+          }
+        },
+        hoverAnimation: false,
+        data: [
+          {
+            value: 80,
+            name: '01',
+            itemStyle: {
+              normal: {
+                color: { // 瀹屾垚鐨勫渾鐜殑棰滆壊
+                  colorStops: [{
+                    offset: 0,
+                    color: '#24d3ff' // 0% 澶勭殑棰滆壊
+                  }, {
+                    offset: 1,
+                    color: '#5580fe' // 100% 澶勭殑棰滆壊
+                  }]
+                },
+                label: {
+                  show: false
+                },
+                labelLine: {
+                  show: false
+                }
+              }
+            }
+          },
+          {
+            name: '02',
+            value: 20
+          }
+        ]
+      }]
+  }
+  return option
+}

--
Gitblit v1.9.3