From fdab1ad61827935dcef4cac2a4a8c1ec50b25559 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期六, 01 十月 2022 06:46:16 +0800
Subject: [PATCH] 1.看板标题修改
---
src/utils/myEcharts.js | 464 +++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 377 insertions(+), 87 deletions(-)
diff --git a/src/utils/myEcharts.js b/src/utils/myEcharts.js
index 232c099..c60aa83 100644
--- a/src/utils/myEcharts.js
+++ b/src/utils/myEcharts.js
@@ -117,7 +117,7 @@
}
export function bar1(data1, data2) {
- const titleText = '杞﹂棿浜哄憳鍑哄嫟鐜�'
+ const titleText = '宸ュ巶浜哄憳鍑哄嫟鐜�'
const path = 'path://M214,1079l8-6h16l8,6-8,6H222Z'
// const data1 = ['80', '90', '70', '30', '50']
// const data2 = ['70', '60', '50', '40', '30']
@@ -145,8 +145,8 @@
textStyle: {
// color: '#fff',
color: '#00ffff',
- fontSize: '18',
- fontWeight: 'lighter'
+ fontSize: '20',
+ fontWeight: 'bolder'
},
subtextStyle: {
color: '#90979c',
@@ -177,7 +177,8 @@
},
xAxis: {
type: 'category',
- data: ['杞﹂棿涓�', '杞﹂棿浜�', '杞﹂棿涓�', '杞﹂棿鍥�', '杞﹂棿浜�'],
+ // data: ['杞﹂棿涓�', '杞﹂棿浜�', '杞﹂棿涓�', '杞﹂棿鍥�', '杞﹂棿浜�'],
+ data: ['娴欐睙鐨囧啝', '姘稿悍鐨囧啝', '鍖楄景鐢垫満', '鎭掓嘲鐨囧啝鍥灄', '杩堟嫇濉戜笟'],
axisLine: {
lineStyle: {
show: true,
@@ -193,7 +194,7 @@
fontFamily: 'Microsoft YaHei',
color: colorX, // x杞撮鑹�
fontWeight: 'normal',
- fontSize: '14',
+ fontSize: '12',
lineHeight: 22
}
}
@@ -370,7 +371,7 @@
return option
}
-export function line1(dataY) {
+export function line1(dataY, dataY2, dataY3, dataY4, dataY5) {
const option = {
backgroundColor: 'transparent',
grid: {
@@ -381,15 +382,16 @@
containLabel: true
},
title: {
- text: '閿�鍞姒傝',
+ // text: '閿�鍞姒傝',
+ text: '鍚勫伐鍘傝兘鑰�',
left: '50%',
top: '0%',
textAlign: 'center',
textStyle: {
// color: '#fff',
color: '#00ffff',
- fontSize: '18',
- fontWeight: 'lighter'
+ fontSize: '20',
+ fontWeight: 'bolder'
}
},
tooltip: {
@@ -410,8 +412,7 @@
show: false,
right: 20,
orient: 'vertical',
- // data: ['浠婃棩','鏄ㄦ棩']
- data: ['浠婃棩']
+ data: ['娴欐睙鐨囧啝', '姘稿悍鐨囧啝', '鍖楄景鐢垫満', '鎭掓嘲鐨囧啝鍥灄', '杩堟嫇濉戜笟']
},
xAxis: {
@@ -479,14 +480,14 @@
},
yAxis:
{
- name: '浜匡紙鍏冿級',
+ name: '',
nameTextStyle: {
color: colorY,
fontSize: 14,
lineHeight: 20
},
boundaryGap: false,
- splitNumber: 4,
+ splitNumber: 5,
type: 'value',
// offset: -30,
axisLabel: {
@@ -512,69 +513,167 @@
show: true
}
},
- series: [{
- name: '浠婃棩',
- type: 'line',
- smooth: true,
- showSymbol: false,
- symbol: 'circle',
- symbolSize: 6,
- // data: ['200', '400', '500', '300', '400', '500', '600', '800', '900', '1000', '1100', '1322'],
- data: dataY,
- areaStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- offset: 0,
- color: 'rgba(199, 237, 250,0.5)'
- }, {
- offset: 1,
- color: 'rgba(199, 237, 250,0.2)'
- }], false)
- }
- },
- itemStyle: {
- normal: {
+ series: [
+ {
+ name: '娴欐睙鐨囧啝',
+ type: 'line',
+ smooth: true,
+ showSymbol: false,
+ symbol: 'circle',
+ symbolSize: 6,
+ // data: ['200', '400', '500', '300', '400', '500', '600', '800', '900', '1000', '1100', '1322'],
+ data: dataY,
+ areaStyle: {
+ normal: {
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+ offset: 0,
+ color: 'rgba(0,215,236,0.5)'
+ }, {
+ offset: 1,
+ color: 'rgba(0,215,236,0.2)'
+ }], false)
+ }
+ },
+ itemStyle: {
+ normal: {
// color: '#f7b851'
- color: `rgb(73, 226, 196)`
+ // color: `rgb(73, 226, 196)`
+ color: `rgb(0,215,236)`
+ }
+ },
+ lineStyle: {
+ normal: {
+ width: 3
+ }
}
},
- lineStyle: {
- normal: {
- width: 3
+ {
+ name: '姘稿悍鐨囧啝',
+ type: 'line',
+ smooth: true,
+ showSymbol: false,
+ symbol: 'circle',
+ symbolSize: 6,
+ // data: ['1200', '1400', '808', '811', '626', '488', '1600', '1100', '500', '300', '1998', '822'],
+ data: dataY2,
+ areaStyle: {
+ normal: {
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+ offset: 0,
+ color: 'rgba(60,244,184,0.5)'
+ }, {
+ offset: 1,
+ color: 'rgba(60,244,184,0.2)'
+ }], false)
+ }
+ },
+ itemStyle: {
+ normal: {
+ color: `rgb(60,244,184)`
+ }
+ },
+ lineStyle: {
+ normal: {
+ width: 3
+ }
+ }
+ },
+ {
+ name: '鍖楄景鐢垫満',
+ type: 'line',
+ smooth: true,
+ showSymbol: false,
+ symbol: 'circle',
+ symbolSize: 6,
+ // data: ['1200', '1400', '808', '811', '626', '488', '1600', '1100', '500', '300', '1998', '822'],
+ data: dataY3,
+ areaStyle: {
+ normal: {
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+ offset: 0,
+ color: 'rgba(55,183,255,0.5)'
+ }, {
+ offset: 1,
+ color: 'rgba(55,183,255,0.2)'
+ }], false)
+ }
+ },
+ itemStyle: {
+ normal: {
+ // color: '#58c8da'
+ color: `rgb(55,183,255)`
+ }
+ },
+ lineStyle: {
+ normal: {
+ width: 3
+ }
+ }
+ },
+ {
+ name: '鎭掓嘲鐨囧啝鍥灄',
+ type: 'line',
+ smooth: true,
+ showSymbol: false,
+ symbol: 'circle',
+ symbolSize: 6,
+ // data: ['1200', '1400', '808', '811', '626', '488', '1600', '1100', '500', '300', '1998', '822'],
+ data: dataY4,
+ areaStyle: {
+ normal: {
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+ offset: 0,
+ color: 'rgba(26,202,200,0.5)'
+ }, {
+ offset: 1,
+ color: 'rgba(26,202,200,0.2)'
+ }], false)
+ }
+ },
+ itemStyle: {
+ normal: {
+ // color: '#58c8da'
+ color: `rgb(26,202,200)`
+ }
+ },
+ lineStyle: {
+ normal: {
+ width: 3
+ }
+ }
+ },
+ {
+ name: '杩堟嫇濉戜笟',
+ type: 'line',
+ smooth: true,
+ showSymbol: false,
+ symbol: 'circle',
+ symbolSize: 6,
+ // data: ['1200', '1400', '808', '811', '626', '488', '1600', '1100', '500', '300', '1998', '822'],
+ data: dataY5,
+ areaStyle: {
+ normal: {
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+ offset: 0,
+ color: 'rgba(243,94,94,0.5)'
+ }, {
+ offset: 1,
+ color: 'rgba(243,94,94,0.2)'
+ }], false)
+ }
+ },
+ itemStyle: {
+ normal: {
+ // color: '#58c8da'
+ color: `rgb(243,94,94)`
+ }
+ },
+ lineStyle: {
+ normal: {
+ width: 3
+ }
}
}
- }
- // {
- // name: '鏄ㄦ棩',
- // type: 'line',
- // smooth: true,
- // showSymbol: false,
- // symbol: 'circle',
- // symbolSize: 6,
- // data: ['1200', '1400', '808', '811', '626', '488', '1600', '1100', '500', '300', '1998', '822'],
- // areaStyle: {
- // normal: {
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
- // offset: 0,
- // color: 'rgba(216, 244, 247,1)'
- // }, {
- // offset: 1,
- // color: 'rgba(216, 244, 247,1)'
- // }], false)
- // }
- // },
- // itemStyle: {
- // normal: {
- // color: '#58c8da'
- // }
- // },
- // lineStyle: {
- // normal: {
- // width: 3
- // }
- // }
- // }
-
]
}
@@ -676,8 +775,8 @@
textAlign: 'center',
textStyle: {
color: '#00ffff',
- fontSize: '18',
- fontWeight: 'lighter'
+ fontSize: '20',
+ fontWeight: 'bolder'
}
},
legend: {
@@ -702,15 +801,15 @@
const option = {
backgroundColor: 'transparent',
title: {
- text: '瀹㈡埛鍒嗘瀽鍥�',
+ text: '骞冲彴閾炬帴瀹㈡埛',
left: '50%',
top: '5%',
textAlign: 'center',
textStyle: {
// color: '#fff',
color: '#00ffff',
- fontSize: '18',
- fontWeight: 'lighter'
+ fontSize: '20',
+ fontWeight: 'bolder'
}
},
xAxis: {
@@ -976,8 +1075,8 @@
textStyle: {
// color: '#fff',
color: '#00ffff',
- fontSize: '18',
- fontWeight: 'lighter'
+ fontSize: '20',
+ fontWeight: 'bolder'
}
},
grid: {
@@ -1099,24 +1198,29 @@
export function bar4() {
const data = [{
- name: '杞﹂棿涓�',
+ name: '娴欐睙鐨囧啝',
value: Math.floor(Math.random() * 10 + 90)
},
{
- name: '杞﹂棿浜�',
+ name: '姘稿悍鐨囧啝',
value: Math.floor(Math.random() * 10 + 90)
},
{
- name: '杞﹂棿涓�',
+ name: '鍖楄景鐢垫満',
value: Math.floor(Math.random() * 10 + 90)
},
{
- name: '杞﹂棿鍥�',
+ name: '鎭掓嘲鐨囧啝鍥灄',
value: Math.floor(Math.random() * 10 + 90)
- }, {
- name: '杞﹂棿浜�',
+ },
+ {
+ name: '杩堟嫇濉戜笟',
value: Math.floor(Math.random() * 10 + 90)
}
+ // {
+ // name: '杞﹂棿浜�',
+ // value: Math.floor(Math.random() * 10 + 90)
+ // }
]
const getArrByKey = (data, k) => {
const key = k || 'value'
@@ -1149,14 +1253,14 @@
containLabel: true
},
title: {
- text: '杞﹂棿杈炬垚鐜�',
+ text: '宸ュ巶杈炬垚鐜�',
x: '46%',
y: '5%',
textStyle: {
// color: '#fff',
color: '#00ffff',
- fontSize: '18',
- fontWeight: 'lighter'
+ fontSize: '20',
+ fontWeight: 'bolder'
},
subtextStyle: {
color: '#90979c',
@@ -1275,3 +1379,189 @@
return option
}
+
+export function barline1() {
+ return {
+ backgroundColor: 'transparent',
+ tooltip: {},
+ title: {
+ text: '璁㈠崟瀹屾垚鎬绘暟',
+ left: '50%',
+ top: '5%',
+ 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: 14,
+ margin: 20,
+ textStyle: {
+ color: colorX
+ }
+ },
+ axisLine: {
+ lineStyle: {
+ color: '#032c58'
+ }
+ },
+ splitLine: {
+ show: false,
+ lineStyle: {
+ color: '#032c58'
+ }
+ },
+ axisTick: {
+ show: false
+ },
+ data: ['1鏈�', '2鏈�', '3鏈�', '4鏈�', '5鏈�', '6鏈�', '7鏈�', '8鏈�']
+ }],
+ yAxis: [
+ {
+ max: 800,
+ boundaryGap: false,
+ splitNumber: 4,
+ type: 'value',
+ axisLabel: {
+ textStyle: {
+ fontSize: 14,
+ color: colorY
+ }
+ },
+ 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: {
+ 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: [393, 438, 485, 631, 689, 824, 987]
+ data: [600 + Math.floor(Math.random() * 100), 600 + Math.floor(Math.random() * 100), 600 + Math.floor(Math.random() * 100), 600 + Math.floor(Math.random() * 100), 600 + Math.floor(Math.random() * 100), 600 + Math.floor(Math.random() * 100), 600 + Math.floor(Math.random() * 100), 600 + Math.floor(Math.random() * 100)]
+ }
+ // {
+ // name: '鏈�鏂版敞鍐岄噺',
+ // type: 'bar',
+ // barWidth: 20,
+ // tooltip: {
+ // show: false
+ // },
+ // label: {
+ // show: true,
+ // position: 'top',
+ // textStyle: {
+ // color: '#fff',
+ // }
+ // },
+ // 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: [200, 382, 102, 267, 186, 315, 316]
+ // }
+ ]
+ }
+}
--
Gitblit v1.9.3