From 79512a8d78a073742240082a3c4df815ea1ff5d0 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期四, 05 一月 2023 16:49:33 +0800
Subject: [PATCH] 1.提交
---
src/utils/myEcharts.js | 75 +++++++++++++++++++++----------------
1 files changed, 42 insertions(+), 33 deletions(-)
diff --git a/src/utils/myEcharts.js b/src/utils/myEcharts.js
index 79ef19f..2517c77 100644
--- a/src/utils/myEcharts.js
+++ b/src/utils/myEcharts.js
@@ -418,7 +418,7 @@
// data: ['00:00','2:00','4:00','6:00','8:00','10:00','12:00','14:00','16:00','18:00','20:00',"22:00"],
// data: ['1鏈�', '2鏈�', '3鏈�', '4鏈�', '5鏈�', '6鏈�', '7鏈�', '8鏈�', '9鏈�', '10鏈�', '11鏈�', '12鏈�'],
- data: ['1鏈�', '2鏈�', '3鏈�', '4鏈�', '5鏈�', '6鏈�', '7鏈�', '8鏈�'],
+ data: ['1鏈�', '2鏈�', '3鏈�', '4鏈�', '5鏈�', '6鏈�', '7鏈�', '8鏈�', '9鏈�', '10鏈�', '11鏈�', '12鏈�'],
// type: 'category',
// boundaryGap: true,
// axisLabel: {
@@ -977,7 +977,7 @@
]
const color = ['26,171,234', '73,226,196', '255,221,97']
// const xList = ['1鏈�', '2鏈�', '3鏈�', '4鏈�', '5鏈�', '6鏈�', '7鏈�', '8鏈�', '9鏈�', '10鏈�', '11鏈�', '12鏈�']
- const xList = ['1鏈�', '2鏈�', '3鏈�', '4鏈�', '5鏈�', '6鏈�', '7鏈�', '8鏈�']
+ const xList = ['1鏈�', '2鏈�', '3鏈�', '4鏈�', '5鏈�', '6鏈�', '7鏈�', '8鏈�', '9鏈�', '10鏈�', '11鏈�', '12鏈�']
const seriesData = []
list.forEach((r, i) => {
@@ -1438,7 +1438,7 @@
axisTick: {
show: false
},
- data: ['1鏈�', '2鏈�', '3鏈�', '4鏈�', '5鏈�', '6鏈�', '7鏈�', '8鏈�']
+ data: ['1鏈�', '2鏈�', '3鏈�', '4鏈�', '5鏈�', '6鏈�', '7鏈�', '8鏈�', '9鏈�', '10鏈�', '11鏈�', '12鏈�']
}],
yAxis: [
{
@@ -1523,7 +1523,7 @@
}
},
// 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)]
+ 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), 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: '鏈�鏂版敞鍐岄噺',
@@ -1570,7 +1570,7 @@
export function zhkb01() {
// const zhkb01name = ['璁″垝瀹屾垚杩涘害(鑷骇)', '璁″垝瀹屾垚杩涘害(澶栬喘)'] // 鍚嶇О
const zhkb01name = ['', ''] // 鍚嶇О
- const zhkb01Value = [88, 95] // 鍊�
+ const zhkb01Value = [Math.ceil(Math.random() * 10 + 90), Math.ceil(Math.random() * 10 + 90)] // 鍊�
const zhkb01Max = []
const max = Math.ceil(Math.max(...zhkb01Value.map(r => r)) * 1.1)
@@ -1816,7 +1816,7 @@
}
-export function zhkb03() {
+export function zhkb03(title) {
const labelData = []
const labelData1 = []
for (let i = 0; i < 80; ++i) {
@@ -1980,7 +1980,7 @@
backgroundColor: 'transparent',
title: [
{
- text: '铻烘瘝鎶曞叆浜у嚭鐜�',
+ text: title,
x: '46%',
y: '38%',
textAlign: 'center',
@@ -2235,6 +2235,8 @@
export function zhkb04() {
const myColor = ['#d0a00e', '#34da62', '#00e9db', '#00c0e9', '#0096f3']
+ // const data = [330, 404, 780, 509, 150]
+ const data = [Math.ceil(Math.random() * 100 + 500), Math.ceil(Math.random() * 100 + 600), Math.ceil(Math.random() * 100 + 700), Math.ceil(Math.random() * 400 + 500), Math.ceil(Math.random() * 100 + 200)]
const option = {
backgroundColor: 'transparent',
grid: {
@@ -2285,7 +2287,8 @@
fontSize: 16
}
},
- data: ['12566', '12566', '12566', '12566', '12566']
+
+ data: data
},
{
show: false,
@@ -2308,7 +2311,7 @@
name: '鏉�',
type: 'bar',
yAxisIndex: 0,
- data: [33, 44, 78, 59, 15],
+ data: data.map(r => r / 10),
label: {
normal: {
show: false,
@@ -2383,7 +2386,8 @@
}
},
z: 2
- }]
+ }
+ ]
}
return option
@@ -2394,7 +2398,8 @@
// var XName = ['鍛ㄤ竴', '鍛ㄤ簩', '鍛ㄤ笁', '鍛ㄥ洓', '鍛ㄤ簲', '鍛ㄥ叚', '鍛ㄦ棩']
var XName = ['01鏈�', '02鏈�', '03鏈�', '04鏈�', '05鏈�', '06鏈�', '07鏈�', '08鏈�', '09鏈�', '10鏈�', '11鏈�', '12鏈�']
var data1 = [
- [123, 121, 123, 321, 222, 111, 234, 121, 123, 321, 222, 321]
+ // [123, 121, 123, 321, 222, 111, 234, 121, 123, 321, 222, 321]
+ [Math.ceil(Math.random() * 100 + 100), Math.ceil(Math.random() * 100 + 200), Math.ceil(Math.random() * 100 + 200), Math.ceil(Math.random() * 100 + 200), Math.ceil(Math.random() * 100 + 300), Math.ceil(Math.random() * 100 + 100), Math.ceil(Math.random() * 100 + 200), Math.ceil(Math.random() * 100 + 200), Math.ceil(Math.random() * 100 + 300), Math.ceil(Math.random() * 100 + 100), Math.ceil(Math.random() * 100 + 200), Math.ceil(Math.random() * 100 + 300)]
// [123, 154, 234, 321, 120, 390, 634],
// [63, 194, 234, 321, 278, 110, 534],
// [53, 254, 234, 321, 118, 240, 434],
@@ -2564,26 +2569,26 @@
return option
}
-export function zhkb06() {
+export function zhkb06(title) {
const option = {
backgroundColor: 'transparent',
title: [
{
- text: '妫�楠屽強鏃剁巼',
+ text: title,
x: 'center',
top: '55%',
textStyle: {
color: '#FFFFFF',
- fontSize: 12,
+ fontSize: 14,
fontWeight: 100
}
},
{
- text: '75%',
+ text: '95%',
x: 'center',
top: '38%',
textStyle: {
- fontSize: 12,
+ fontSize: 14,
color: '#FFFFFF',
fontFamily: 'DINAlternate-Bold, DINAlternate',
foontWeight: 100
@@ -2722,11 +2727,11 @@
return option
}
-export function zhkb07() {
+export function zhkb07(title, value) {
const dataArr = [
{
- value: 61,
- name: '鎴戞槸鏍囬'
+ value: value,
+ name: title
}
]
const color = new echarts.graphic.LinearGradient(0, 0, 1, 0, [
@@ -2740,17 +2745,17 @@
}
])
const colorSet = [
- [0.61, color],
+ [value / 100, color],
[1, '#15337C']
]
const rich = {
white: {
- fontSize: 12,
+ fontSize: 14,
color: '#fff',
fontWeight: '500'
},
bule: {
- fontSize: 12,
+ fontSize: 14,
fontFamily: 'DINBold',
color: '#fff',
fontWeight: 100
@@ -2761,7 +2766,7 @@
// lineHeight:80,
borderWidth: 1,
borderColor: '#0092F2',
- fontSize: 12,
+ fontSize: 14,
color: '#fff',
backgroundColor: '#1B215B',
borderRadius: 20,
@@ -2789,7 +2794,7 @@
detail: {
formatter: function(value) {
var num = Math.round(value)
- return '{bule|' + num + '}{white|鍒唥'
+ return '{bule|' + num + '}{white|%}'
},
rich: rich,
offsetCenter: ['0%', '0%']
@@ -2799,7 +2804,7 @@
show: true,
color: '#fff',
offsetCenter: ['0', '75%'],
- fontSize: 12
+ fontSize: 14
},
axisLine: {
show: true,
@@ -2856,7 +2861,7 @@
value: Math.floor(Math.random() * 10 + 90)
},
{
- name: '閾搁�犺溅闂�',
+ name: '闀�閿岃溅闂�',
value: Math.floor(Math.random() * 10 + 90)
}
]
@@ -3189,7 +3194,8 @@
}
export function zhkb09() {
- const dataY = [60, 70, 80, 90, 60, 70, 80, 90, 80, 90, 60, 70, 80, 90]
+ // const dataY = [60, 70, 80, 90, 60, 70, 80, 90, 80, 90, 60, 70, 80, 90]
+ const dataY = [(80 + Math.random() * 10), (90 - Math.random() * 30), (60 + Math.random() * 30), (70 + Math.random() * 20), (80 + Math.random() * 10), (90 - Math.random() * 30), (80 - Math.random() * 30), (90 - Math.random() * 30), (60 + Math.random() * 30), (70 + Math.random() * 20), (80 - Math.random() * 10), (90 - Math.random() * 30)]
const option = {
backgroundColor: 'transparent',
@@ -3346,8 +3352,10 @@
const _legendColor = '#8FD8FF'
const _fontSize = 16
const _fontColor = '#8FD8FF'
- const data1 = [70, 90, 100, 70, 90, 100]
- const data2 = [80, 60, 80, 50, 90, 60]
+ // const data1 = [70, 90, 100, 70, 90, 100]
+ // const data2 = [80, 60, 80, 50, 90, 60]
+ const data1 = [70 + Math.random() * 20, 90 - Math.random() * 20, 100 - Math.random() * 20, 70 + Math.random() * 20, 90 - Math.random() * 20, 80 - Math.random() * 20]
+ const data2 = [80 + Math.random() * 20, 60 + Math.random() * 20, 80 - Math.random() * 20, 50 + Math.random() * 20, 90 - Math.random() * 20, 60 + Math.random() * 20]
const option = {
backgroundColor: 'transparent',
legend: {
@@ -3368,7 +3376,8 @@
containLabel: true
},
yAxis: {
- max: Math.ceil(Math.max(...data1) * 1.2),
+ // max: Math.ceil(Math.max(...data1) * 1.2),
+ max: 100,
type: 'value',
position: 'left',
axisLine: {
@@ -3417,7 +3426,7 @@
// width: 3
}
},
- data: ['涓�鐝�', '浜岀彮', '涓夌彮', '鍥涚彮', '浜旂彮', '鍏彮']
+ data: ['閽㈡潗鏀瑰埗', '鍐峰ⅸ', '鐑ⅸ', '鐑鐞�', '杈惧厠缃�', '闀�閿�']
},
series: [
{
@@ -3628,7 +3637,7 @@
name: '璁惧鍒╃敤鐜�',
type: 'bar',
barGap: '70%',
- data: [30, 75, 77, 39, 85],
+ data: [Math.ceil(30 + Math.random() * 20), Math.ceil(75 - Math.random() * 20), Math.ceil(77 - Math.random() * 20), Math.ceil(39 + Math.random() * 20), Math.ceil(85 - Math.random() * 20)],
barWidth: 12,
itemStyle: {
normal: {
@@ -3672,7 +3681,7 @@
{
name: '璁惧寮�鏈虹巼',
type: 'bar',
- data: [90, 45, 27, 20, 85],
+ data: [Math.ceil(90 - Math.random() * 20), 45 + Math.ceil(Math.random() * 20), Math.ceil(27 + Math.random() * 20), Math.ceil(20 + Math.random() * 60), Math.ceil(85 - Math.random() * 20)],
barWidth: 12,
itemStyle: {
normal: {
--
Gitblit v1.9.3