Blame view

web/WebMvc/wwwroot/echartsConfig/ProjectOverviewConfig.js 8.83 KB
赖素文 authored
1
2
//项目概述 妥善率
var eqTuoShanRateOpt = {
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
    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',
赖素文 authored
30
            min: 90, //最小百分比
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
            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]
        }
    ]
};
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

//项目概述 设备开机时间 、 设备可视化也使用到 要复制对象 方法:"".copyObj2(window.eqPowerOnTimeOpt)
var eqPowerOnTimeOpt = {
	tooltip: {
		trigger: 'axis',
		axisPointer: {
			type: 'shadow'
		}
	},
	grid: {
		left: '3%',
		right: '4%',
		bottom: '3%',
		containLabel: true
	},
	legend: {
		data: ['设备1', '设备2',]
	},
	xAxis: [
		{
			type: 'category',
			data: ['2024-04-2', '2024-04-2'],
			axisTick: {
				alignWithLabel: true
			}
		}
	],
	yAxis: [
		{
			show: true,
			type: 'value',
			max: function (value) {
				return value.max + 5
			},
			splitLine: {
				show: true,
			},
			axisLine: {
				show: true,
			},
			axisTick: {
				show: true,
			},

			splitArea: {
				show: false,
			},
		}
	],
	series: [
		{
			name: '设备1',
			type: 'line',
			data: [100, 200]
		},
		{
			name: '设备2',
			type: 'line',
			data: [500, 300]
		}
	]
};
赖素文 authored
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
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,
			},
王硕 authored
172
			axisLabel: {//**该项配置重点关注**
173
				interval: 0,
王硕 authored
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
				fontSize: 12,
				formatter: function (value) {
					var ret = "";//拼接加\n返回的类目项  
					var maxLength = 5;//每项显示文字个数  
					var valLength = value.length;//X轴类目项的文字个数  
					var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数  
					if (rowN > 1)//如果类目项的文字大于5,  
					{
						for (var i = 0; i < rowN; i++) {
							var temp = "";//每次截取的字符串  
							var start = i * maxLength;//开始截取的位置  
							var end = start + maxLength;//结束截取的位置  
							//这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧  
							temp = value.substring(start, end) + "\n";
							ret += temp; //凭借最终的字符串  
						}
						return ret;
					}
					else {
						return value;
					}
				}
196
197
198
199
200
201
202
203
			},
			data: ['设备1', '设备2', '设备3', '设备4', '设备5', '设备6'],
		},
	],
	yAxis: [
		{
			show: true,
			type: 'value',
204
205
206
			max: function (value) {
				return value.max + 5
			},
207
208
209
210
211
212
213
214
215
216
217
218
219
220
			splitLine: {
				show: true,
			},
			axisLine: {
				show: true,
			},
			axisTick: {
				show: true,
			},

			splitArea: {
				show: false,
			},
		},
221
222
223
224
225
226
227
228
229
230
		 {
			type: 'value',
			// name: "Temperature",
			min: 0,
			max: 100,
			interval: 20,
			axisLabel: {
				formatter: '{value}%',
			},
		}
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
	],

	dataZoom: [
		{
			//数据区域缩放的配置项 也就是拖拽滚动条的组件
			show: true,
			type: 'slider',

			height: 10, //拖拽组件的高度
			xAxisIndex: [
				//拖拽组件关联的横轴索引,这里设置为 [0],表示关联第一个横轴。
				0,
			],

			start: 0, //数据窗口范围的起始百分比,表示0%
王硕 authored
246
			end: 20, //数据窗口范围的结束百分比,表示30%
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263

			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: '总量',
赖素文 authored
264
			barWidth: '40',
265
266
267
268
269
270
			itemStyle: {
				normal: {
					color: '#EE6666',
					barBorderRadius: 0,
					label: {
						show: true,
271
						position: 'top',
272
273
274
275
276
277
278
279
280
281
282
283
284
						formatter: function (p) {
							return p.value > 0 ? p.value : ''
						},
					},
				},
			},
			data: [12, 23, 35, 65, 75],
		},
		{
			name: '占比%',
			type: 'line',
			symbolSize: 10,
			symbol: 'triangle',
285
			yAxisIndex: 1, 
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
			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],
		},
	],
};
312
313
314
//设备可视化=>健康参数 					{ value: 34, name: '累计运行' }, 空闲、故障、运行、离线
var eqHealthStatus = {
	color: ['green', 'orange', 'red', '#A9A9A9'],
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
		tooltip: {
			trigger: 'item'
		},
		series: [
			{
				name: '设备状态占比',
				type: 'pie',
				radius: ['40%', '80%'],
				avoidLabelOverlap: false,
				label: {
					show: true,
					position: 'center',
					formatter: '设备状态占比', // 固定显示为"设备状态占比"
					fontSize: 16, // 文字大小
					fontWeight: 'bold', // 文字粗细
王硕 authored
330
					color:"#000000" 
331
332
333
334
				},
				labelLine: {
					show: false
				},
335
				data: []
336
337
338
			}
		]
}
王硕 authored
339
340
341
342
343
344
345
346
347
348
349
350

//健康表现=>OEE
var eqOeeParameters = {
	// tooltip 鼠标移上去时提示框 组件
	tooltip: {
		show: true, //显示/隐藏
		trigger: 'axis',
		// 鼠标放上去显示百分比 不要百分比就去掉
		formatter: function (params) {
			var relVal = params[0].name //x轴对应的名字
			for (var i = 0, l = params.length; i < l; i++) {
				//legend对应的名字
351
				relVal += '<br/>' + params[i].marker + params[i].seriesName + ': ' + params[i].value+"%"
王硕 authored
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
			}
			return relVal
		},
	},
	grid: {
		left: '3%', 
		right: '4%',
		bottom: '6%',
		containLabel: true
	},
	xAxis: [
		{
			type: 'category',
			data: [],
			axisTick: {
				alignWithLabel: true
			}
		}
	],
	yAxis: [
		{
			show: true,
			type: 'value',
			max: function (value) {
376
				return Math.floor(value.max + 5);
王硕 authored
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
			},

			splitLine: {
				show: true,
				lineStyle: {
					color: 'black'  // 设置分割线颜色为黑色
				}
			},
			axisLine: {
				show: true,
				lineStyle: {
					color: 'black'  // 设置坐标轴线颜色为黑色
				}
			},
			axisTick: {
				show: true,
				lineStyle: {
					color: 'black'  // 设置刻度线颜色为黑色
				}
			},
			axisLabel: {
				formatter: '{value}%'  // 设置刻度值显示单位为百分比
			},

			splitArea: {
				show: false
			}
		}
	],
	series: [
		{
			name: 'OEE',
			type: 'bar',
410
			barWidth: '20%',
王硕 authored
411
412
413
414
415
416
417
418
419
			data: [],
			itemStyle: {
				normal: {
					color: 'blue',
					barBorderRadius: 0,
					label: {
						show: true,
						position: 'inside',
						formatter: function (p) {
420
							return p.value > 0 ? p.value+"%" : ''
王硕 authored
421
422
423
424
425
426
427
428
429
430
431
432
						},
					},
				},
			},

		}
	]
}

//健康表现=>MTTR MTBF
var eqMttrMtbf = {
	tooltip: {
433
434
435
436
		trigger: 'axis',
		axisPointer: {
			type: 'shadow'
		}
王硕 authored
437
438
439
440
	},
	grid: {
		left: '3%',
		right: '4%',
441
		bottom: '3%',
王硕 authored
442
443
		containLabel: true
	},
444
445
	legend: {
		data: ['MTTR', 'MTBF','目标值']
王硕 authored
446
	},
447
448
449
450
451
452
453
	xAxis: [
		{
			type: 'category',
			data: [],
			axisTick: {
				alignWithLabel: true
			}
王硕 authored
454
		}
455
456
457
458
459
460
461
462
463
464
	],
	yAxis: [
		{
			type: 'value',
			axisLabel: {
				interval: 'auto',
				formatter: '{value}' //y轴数值,带百分号
			}
		}
	],
王硕 authored
465
466
	series: [
		{
467
			name: '设备1',
王硕 authored
468
			type: 'line',
469
			data: [10, 30, 20, 40, 60, 40, 70]
王硕 authored
470
471
		},
		{
472
			name: '设备2',
王硕 authored
473
			type: 'line',
474
			data: [14, 34, 24, 44, 64, 44, 74]
王硕 authored
475
476
		}
	]
477
};
王硕 authored
478
479
480