From c047a193dad2591ee9d40d1ed3e97180d7be23c4 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期四, 14 九月 2023 10:11:21 +0800
Subject: [PATCH] 1.综合看板

---
 src/utils/myEcharts.js |  307 ++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 264 insertions(+), 43 deletions(-)

diff --git a/src/utils/myEcharts.js b/src/utils/myEcharts.js
index f02c36b..75591ee 100644
--- a/src/utils/myEcharts.js
+++ b/src/utils/myEcharts.js
@@ -2054,15 +2054,28 @@
   return option
 }
 
-export function cjzl03(xData, legendData, yData) { // 宸︿晶
+export function cjzl03(xData, legendData, yData, show) { // 宸︿晶
   return {
     backgroundColor: 'transparent',
-    tooltip: {},
+    // tooltip: {},
+    title: {
+      show: show,
+      text: '鍚勮溅闂村綋鏈堜笉鑹秼鍔�',
+      left: '50%',
+      top: '3%',
+      textAlign: 'center',
+      textStyle: {
+        // color: '#fff',
+        color: '#00ffff',
+        fontSize: '20',
+        fontWeight: 'bolder'
+      }
+    },
     grid: {
       left: '2%',
       right: '2%',
       bottom: '20%',
-      top: '10%',
+      top: '15%',
       containLabel: true
     },
     legend: {
@@ -2110,7 +2123,7 @@
         type: 'value',
         axisLabel: {
           textStyle: {
-            fontSize: 16,
+            fontSize: 18,
             color: colorX
           }
         },
@@ -2152,13 +2165,14 @@
           },
           borderColor: '#00ffff'
         },
-        // label: {
-        //   show: true,
-        //   position: 'top',
-        //   textStyle: {
-        //     color: '#fff'
-        //   }
-        // },
+        label: {
+          show: true,
+          position: 'top',
+          textStyle: {
+            fontSize: 16,
+            color: '#fff'
+          }
+        },
         itemStyle: {
           normal: {
             color: '#00ffff'
@@ -2199,13 +2213,14 @@
           },
           borderColor: '#ff3000'
         },
-        // label: {
-        //   show: true,
-        //   position: 'top',
-        //   textStyle: {
-        //     color: '#fff'
-        //   }
-        // },
+        label: {
+          show: true,
+          position: 'top',
+          textStyle: {
+            fontSize: 16,
+            color: '#fff'
+          }
+        },
         itemStyle: {
           normal: {
             color: '#ff3000'
@@ -2246,13 +2261,14 @@
           },
           borderColor: '#ffe000'
         },
-        // label: {
-        //   show: true,
-        //   position: 'top',
-        //   textStyle: {
-        //     color: '#fff'
-        //   }
-        // },
+        label: {
+          show: true,
+          position: 'top',
+          textStyle: {
+            fontSize: 16,
+            color: '#fff'
+          }
+        },
         itemStyle: {
           normal: {
             color: '#ffe000'
@@ -2293,13 +2309,14 @@
           },
           borderColor: '#ffa800'
         },
-        // label: {
-        //   show: true,
-        //   position: 'top',
-        //   textStyle: {
-        //     color: '#fff'
-        //   }
-        // },
+        label: {
+          show: true,
+          position: 'top',
+          textStyle: {
+            fontSize: 16,
+            color: '#fff'
+          }
+        },
         itemStyle: {
           normal: {
             color: '#ffa800'
@@ -2340,13 +2357,14 @@
           },
           borderColor: '#ff5b00'
         },
-        // label: {
-        //   show: true,
-        //   position: 'top',
-        //   textStyle: {
-        //     color: '#fff'
-        //   }
-        // },
+        label: {
+          show: true,
+          position: 'top',
+          textStyle: {
+            fontSize: 16,
+            color: '#fff'
+          }
+        },
         itemStyle: {
           normal: {
             color: '#ff5b00'
@@ -2697,10 +2715,10 @@
   return option
 }
 
-export function all01(xData2) {
+export function all01(xData2, yData) {
   // var xData2 = ['123', '21', '32', '23', '1233']
-  var data1 = [250, 100, 130, 200, 300]
-  var data2 = [400, 200, 300, 300, 300]
+  var data1 = yData.map(i => i.quantity)
+  var data2 = yData.map(i => i.plan_qty)
   var barWidth = 30
   const option = {
     backgroundColor: 'transparent',
@@ -2766,7 +2784,7 @@
       },
       nameTextStyle: {
         color: '#fff',
-        fontSize: 14,
+        fontSize: 16,
         lineHeight: 40
       },
       splitLine: {
@@ -2941,3 +2959,206 @@
 
   return option
 }
+
+export function all02(data) {
+  return {
+    backgroundColor: 'transparent',
+    // tooltip: {},
+    title: {
+      text: '姣忔湀璁㈠崟鏁伴噺/鍑哄簱鏁伴噺',
+      left: '50%',
+      top: '0%',
+      textAlign: 'center',
+      textStyle: {
+        // color: '#fff',
+        color: '#00ffff',
+        fontSize: '20',
+        fontWeight: 'bolder'
+      }
+    },
+    grid: {
+      left: '4%',
+      right: '4%',
+      bottom: '4%',
+      top: '15%',
+      containLabel: true
+    },
+    // legend: {
+    //   show: false,
+    //   itemGap: 50,
+    //   data: ['娉ㄥ唽鎬婚噺', '鏈�鏂版敞鍐岄噺'],
+    //   textStyle: {
+    //     color: '#f9f9f9',
+    //     borderColor: '#fff'
+    //   }
+    // },
+    xAxis: [{
+      type: 'category',
+      boundaryGap: true,
+      axisLabel: {
+        interval: 0,
+        formatter: '{value}',
+        fontSize: 16,
+        margin: 20,
+        textStyle: {
+          color: colorX
+        }
+      },
+      axisLine: {
+        lineStyle: {
+          color: '#032c58'
+        }
+      },
+      splitLine: {
+        show: false,
+        lineStyle: {
+          color: '#032c58'
+        }
+      },
+      axisTick: {
+        show: false
+      },
+      data: data.map(i => i.Month)
+    }],
+    yAxis: [
+      {
+        // max: 800,
+        boundaryGap: false,
+        splitNumber: 4,
+        type: 'value',
+        axisLabel: {
+          textStyle: {
+            fontSize: 16,
+            color: colorX
+          }
+        },
+        // name: '鍗�',
+        // nameTextStyle: {
+        //   color: colorY,
+        //   fontSize: 14,
+        //   lineHeight: 20
+        // },
+        splitLine: {
+          show: true,
+          lineStyle: {
+            color: '#032c58'
+          }
+        },
+        axisLine: {
+          show: true,
+          lineStyle: {
+            color: '#032c58'
+          }
+        },
+        axisTick: {
+          show: true
+        }
+      }
+    ],
+    series: [
+      {
+        name: '娉ㄥ唽鎬婚噺',
+        type: 'line',
+        // smooth: true, //鏄惁骞虫粦鏇茬嚎鏄剧ず
+        // 			symbol:'circle',  // 榛樿鏄┖蹇冨渾锛堜腑闂存槸鐧借壊鐨勶級锛屾敼鎴愬疄蹇冨渾
+        showAllSymbol: true,
+        symbol: 'emptyCircle',
+        symbolSize: 6,
+        lineStyle: {
+          normal: {
+            color: '#28ffb3' // 绾挎潯棰滆壊
+          },
+          borderColor: '#f0f'
+        },
+        label: {
+          show: true,
+          position: 'top',
+          textStyle: {
+            fontSize: 16,
+            color: '#fff'
+          }
+        },
+        itemStyle: {
+          normal: {
+            color: '#28ffb3'
+
+          }
+        },
+        tooltip: {
+          show: false
+        },
+        areaStyle: { // 鍖哄煙濉厖鏍峰紡
+          normal: {
+            // 绾挎�ф笎鍙橈紝鍓�4涓弬鏁板垎鍒槸x0,y0,x2,y2(鑼冨洿0~1);鐩稿綋浜庡浘褰㈠寘鍥寸洅涓殑鐧惧垎姣斻�傚鏋滄渶鍚庝竴涓弬鏁版槸鈥榯rue鈥欙紝鍒欒鍥涗釜鍊兼槸缁濆鍍忕礌浣嶇疆銆�
+            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+              offset: 0,
+              color: 'rgba(0,154,120,1)'
+            },
+            {
+              offset: 1,
+              color: 'rgba(0,0,0, 0)'
+            }
+            ], false),
+            shadowColor: 'rgba(53,142,215, 0.9)', // 闃村奖棰滆壊
+            shadowBlur: 20 // shadowBlur璁惧浘褰㈤槾褰辩殑妯$硦澶у皬銆傞厤鍚坰hadowColor,shadowOffsetX/Y, 璁剧疆鍥惧舰鐨勯槾褰辨晥鏋溿��
+          }
+        },
+        data: data.map(i => i.quantity)
+      },
+      {
+        name: '鏈�鏂版敞鍐岄噺',
+        type: 'line',
+        barWidth: 20,
+        tooltip: {
+          show: false
+        },
+        label: {
+          show: true,
+          position: 'top',
+          textStyle: {
+            fontSize: 16,
+            color: '#fff'
+          }
+        },
+        areaStyle: { // 鍖哄煙濉厖鏍峰紡
+          normal: {
+            // 绾挎�ф笎鍙橈紝鍓�4涓弬鏁板垎鍒槸x0,y0,x2,y2(鑼冨洿0~1);鐩稿綋浜庡浘褰㈠寘鍥寸洅涓殑鐧惧垎姣斻�傚鏋滄渶鍚庝竴涓弬鏁版槸鈥榯rue鈥欙紝鍒欒鍥涗釜鍊兼槸缁濆鍍忕礌浣嶇疆銆�
+            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+              offset: 0,
+              color: 'rgba(0,154,120,1)'
+            },
+            {
+              offset: 1,
+              color: 'rgba(0,0,0, 0)'
+            }
+            ], false),
+            shadowColor: 'rgba(53,142,215, 0.9)', // 闃村奖棰滆壊
+            shadowBlur: 20 // shadowBlur璁惧浘褰㈤槾褰辩殑妯$硦澶у皬銆傞厤鍚坰hadowColor,shadowOffsetX/Y, 璁剧疆鍥惧舰鐨勯槾褰辨晥鏋溿��
+          }
+        },
+        // itemStyle: {
+        //   normal: {
+        //     // barBorderRadius: 5,
+        //     // color: new echarts.graphic.LinearGradient(
+        //     //     0, 0, 0, 1,
+        //     //     [{
+        //     //             offset: 0,
+        //     //             color: '#14c8d4'
+        //     //         },
+        //     //         {
+        //     //             offset: 1,
+        //     //             color: '#43eec6'
+        //     //         }
+        //     //     ]
+        //     // )
+        //     color: function(params) {
+        //       var colorList = ['#0ec1ff', '#10cdff', '#12daff', '#15ebff', '#17f8ff', '#1cfffb', '#1dfff1']
+        //       return colorList[params.dataIndex]
+        //     }
+        //   }
+        // },
+        data: data.map(i => i.ouquantity)
+      }
+    ]
+  }
+}

--
Gitblit v1.9.3