From 8afc9acc4a126e2b3f72251ea4be07173387f0eb Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 13 九月 2023 17:47:23 +0800
Subject: [PATCH] 1.车间综合15%
---
src/utils/myEcharts.js | 245 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 245 insertions(+), 0 deletions(-)
diff --git a/src/utils/myEcharts.js b/src/utils/myEcharts.js
index a74f8ef..f02c36b 100644
--- a/src/utils/myEcharts.js
+++ b/src/utils/myEcharts.js
@@ -2696,3 +2696,248 @@
}
return option
}
+
+export function all01(xData2) {
+ // var xData2 = ['123', '21', '32', '23', '1233']
+ var data1 = [250, 100, 130, 200, 300]
+ var data2 = [400, 200, 300, 300, 300]
+ var barWidth = 30
+ const option = {
+ backgroundColor: 'transparent',
+ // tooltip: {
+ // trigger: 'item'
+ // },
+ grid: {
+ left: '2%',
+ top: '20%',
+ right: '2%',
+ bottom: '5%',
+ containLabel: true
+ },
+ title: {
+ text: '鍚勮溅闂村綋鏈堣鍗曟暟/鍏ュ簱鏁伴噺',
+ left: '50%',
+ top: '0%',
+ textAlign: 'center',
+ textStyle: {
+ color: 'rgba(0,255,255,0.8)',
+ fontSize: '20',
+ fontWeight: 'bolder'
+ }
+ },
+ xAxis: {
+ data: xData2,
+ 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
+ }
+ },
+ yAxis: {
+ boundaryGap: false,
+ // splitNumber: 4,
+ type: 'value',
+ // max: 100,
+ axisLabel: {
+ textStyle: {
+ fontSize: 16,
+ color: colorX
+ }
+ },
+ nameTextStyle: {
+ color: '#fff',
+ fontSize: 14,
+ lineHeight: 40
+ },
+ splitLine: {
+ show: true,
+ lineStyle: {
+ color: '#032c58'
+ }
+ },
+ axisLine: {
+ show: true,
+ lineStyle: {
+ color: '#032c58'
+ }
+ },
+ axisTick: {
+ show: false
+ }
+ },
+ series: [
+ { // 涓婂崐鎴煴瀛�
+ name: '2019',
+ type: 'bar',
+ barWidth: barWidth,
+ barGap: '-100%',
+ z: 0,
+ itemStyle: {
+ color: '#163F7A',
+ opacity: 0.7
+ },
+ data: data2
+ },
+ { // 涓嬪崐鎴煴瀛�
+ name: '2020',
+ type: 'bar',
+ barWidth: barWidth,
+ barGap: '-100%',
+ itemStyle: { // lenged鏂囨湰
+ opacity: 0.7,
+ color: function(params) {
+ return new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+ offset: 0,
+ color: '#12B9DB' // 0% 澶勭殑棰滆壊
+ }, {
+ offset: 1,
+ color: '#6F8EF2' // 100% 澶勭殑棰滆壊
+ }], false)
+ }
+ },
+ data: data1
+ },
+ { // 鏇夸唬鏌辩姸鍥� 榛樿涓嶆樉绀洪鑹诧紝鏄渶涓嬫柟鏌卞浘锛堥偖浠惰惀閿�锛夌殑value鍊� - 20
+ type: 'bar',
+ barWidth: barWidth,
+ barGap: '-100%',
+ stack: '骞垮憡',
+ itemStyle: {
+ color: 'transparent'
+ },
+ label: {
+ normal: {
+ show: true,
+ position: 'left',
+ fontSize: 16,
+ color: colorX,
+ zIndex: 10
+ }
+ },
+ data: data1
+ },
+ { // 涓婂崐鎴煴瀛愰《閮ㄥ渾鐗�
+ 'name': '',
+ 'type': 'pictorialBar',
+ 'symbolSize': [barWidth, 15],
+ 'symbolOffset': [0, -10],
+ 'z': 12,
+ 'symbolPosition': 'end',
+ itemStyle: {
+ color: '#163F7A',
+ opacity: 1
+ },
+ label: {
+ show: true,
+ position: 'top',
+ fontSize: 16,
+ color: '#fff'
+ },
+ 'data': data2
+ },
+ { // 涓嬪崐鎴煴瀛愰《閮ㄥ渾鐗�
+ 'name': '',
+ 'type': 'pictorialBar',
+ 'symbolSize': [barWidth, 15],
+ 'symbolOffset': [0, -10],
+ 'z': 12,
+ itemStyle: {
+ opacity: 1,
+ color: function(params) {
+ return new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+ offset: 0,
+ color: '#12B9DB' // 0% 澶勭殑棰滆壊
+ }, {
+ offset: 1,
+ color: '#6F8EF2' // 100% 澶勭殑棰滆壊
+ }], false)
+ }
+ },
+ // label: {
+ // show: true,
+ // position: 'top',
+ // fontSize: 16,
+ // color: '#fff'
+ // // formatter:(item)=>{
+ // // console.log(item)
+ // // return 'ssss'
+ // // }
+ // },
+ 'symbolPosition': 'end',
+ 'data': data1
+ },
+ { // 涓嬪崐鎴煴瀛愬簳閮ㄥ渾鐗�
+ 'name': '',
+ 'type': 'pictorialBar',
+ 'symbolSize': [barWidth, 15],
+ 'symbolOffset': [0, 5],
+ 'z': 12,
+ itemStyle: {
+ opacity: 1,
+ color: function(params) {
+ return new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+ offset: 0,
+ color: '#12B9DB' // 0% 澶勭殑棰滆壊
+ }, {
+ offset: 1,
+ color: '#6F8EF2' // 100% 澶勭殑棰滆壊
+ }], false)
+ }
+ },
+ 'data': [1, 1, 1, 1, 1]
+ },
+ {
+ name: '绗竴鍦�',
+ type: 'pictorialBar',
+ symbolSize: [47, 16],
+ symbolOffset: [0, 11],
+ z: 11,
+ itemStyle: {
+ normal: {
+ color: 'transparent',
+ borderColor: '#00ffff',
+ borderWidth: 2
+ }
+ },
+ data: [1, 1, 1, 1, 1]
+ },
+ {
+ name: '绗簩鍦�',
+ type: 'pictorialBar',
+ symbolSize: [62, 22],
+ symbolOffset: [0, 17],
+ z: 10,
+ itemStyle: {
+ normal: {
+ color: 'transparent',
+ borderColor: '#00ffff',
+ borderWidth: 2
+ }
+ },
+ data: [1, 1, 1, 1, 1]
+ }
+ ]
+ }
+
+ return option
+}
--
Gitblit v1.9.3