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], }, ], };