let yLabel = ["服务1", "服务2", "服务3", "服务4"]; let option = { color: ["#3aa1ff", "#4ecb73"], grid: { left: "5%", right: "5%", bottom: "15%", top: "5%", containLabel: true, }, legend: { bottom: 0, data: ["运行成功次数", "运行失败次数"], }, tooltip: { trigger: "axis", axisPointer: { type: "none", }, }, xAxis: { show: true, type: "value", axisLabel: { show: true, margin: 15, textStyle: { }, }, axisTick: { show: false, }, axisLine: { show: false, }, splitLine: { show: true, lineStyle: { type: "dashed", }, }, }, yAxis: [ { type: "category", axisLabel: { show: true, margin: 15, }, axisLine: { show: true, }, data: yLabel, }, ], series: [ { name: "运行成功次数", type: "bar", zlevel: 1, barWidth: 13, data: [6, 5, 6, 5], }, { name: "运行失败次数", type: "bar", zlevel: 1, barWidth: 13, data: [0, 1, 1, 0], }, ], };