ProjectOverviewConfig.js
3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
var eqTuoShanRateOpt = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
legend: {
data: ['设备1', '设备2', '设备3', '设备4']
},
xAxis: [
{
type: 'category',
data: ['2024-04-2', '2024-04-05', '2024-04-06', '2024-04-07', '2024-04-08', '2024-04-09', '2024-04-10'],
axisTick: {
alignWithLabel: true
}
}
],
yAxis: [
{
type: 'value',
min: 0, //最小百分比
max: 100, //最大百分比
axisLabel: {
interval: 'auto',
formatter: '{value}%' //y轴数值,带百分号
}
}
],
series: [
{
name: '设备1',
type: 'line',
data: [10, 30, 20, 40, 60, 40, 70]
},
{
name: '设备2',
type: 'line',
data: [14, 34, 24, 44, 64, 44, 74]
},
{
name: '设备3',
type: 'line',
data: [20, 40, 30, 50, 70, 50, 80]
},
{
name: '设备4',
type: 'line',
data: [40, 78, 56, 88, 99, 11, 44]
}
]
};
var eqAlarmsNumber = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
textStyle: {
// color: "#fff"
},
},
},
grid: {
left: '3%',
right: '4%',
textStyle: {
// color: "#fff"
},
},
legend: {
textStyle: {
color: '#000000',
},
data: ['故障次数', '占比%'],
},
calculable: true,
xAxis: [
{
type: 'category', // 坐标轴类型的配置项。
axisLine: {
// 坐标轴线的配置项。
},
splitLine: {
// 分隔线的配置项。
show: false,
},
axisTick: {
// 坐标轴刻度的配置项。
show: false,
},
splitArea: {
// 分割区域的配置项。
show: false,
},
axisLabel: {
fontSize: 12,
interval: 0,
},
data: ['设备1', '设备2', '设备3', '设备4', '设备5', '设备6'],
},
],
yAxis: [
{
show: true,
type: 'value',
splitLine: {
show: true,
},
axisLine: {
show: true,
},
axisTick: {
show: true,
},
splitArea: {
show: false,
},
},
],
dataZoom: [
{
//数据区域缩放的配置项 也就是拖拽滚动条的组件
show: true,
type: 'slider',
height: 10, //拖拽组件的高度
xAxisIndex: [
//拖拽组件关联的横轴索引,这里设置为 [0],表示关联第一个横轴。
0,
],
start: 0, //数据窗口范围的起始百分比,表示0%
end: 80, //数据窗口范围的结束百分比,表示30%
handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
handleStyle: {
//手柄两端的颜色
color: '#d3dee5',
},
textStyle: {
// 拖拽缩放组件文本样式的配置项。
color: '#000000', //颜色
},
},
],
series: [
{
name: '故障次数',
type: 'bar',
stack: '总量',
barWidth: '23',
itemStyle: {
normal: {
color: '#EE6666',
barBorderRadius: 0,
label: {
show: true,
position: 'inside',
formatter: function (p) {
return p.value > 0 ? p.value : ''
},
},
},
},
data: [12, 23, 35, 65, 75],
},
{
name: '占比%',
type: 'line',
symbolSize: 10,
symbol: 'triangle',
itemStyle: {
normal: {
// "color": "rgba(252,230,48,1)",
borderColor: '#5470C6',
borderWidth: 3,
color: '#5470C6',
barBorderRadius: 0,
label: {
show: false,
position: 'top',
formatter: function (p) {
return p.value > 0 ? p.value : ''
},
},
},
},
lineStyle: {
color: '#5470C6',
width: 6,
type: 'dashed',
},
data: [36, 93, 62, 10, 19],
},
],
};