option = { backgroundColor: "#fff", tooltip: { trigger: "axis", axisPointer: { type: "shadow" } }, legend: { top: "2%", left: "right", }, grid: { left: "3%", right: "4%", bottom: "2%", top: "20%", containLabel: true }, xAxis: { type: "category", data: ["1", "1", "3"], axisLine: { lineStyle: { color: "#333", width: 1 } }, axisTick: { show: false } }, yAxis: { name: "单位", type: "value", boundaryGap: [0, 0.01], axisLine: { lineStyle: { color: "#333", width: 1 } }, splitLine: { show: true, lineStyle: { type: "dashed", //y轴分割线类型 color: "rgba(0, 0, 0, 0.30)" } }, axisTick: { show: false } }, series: [ { name: "指标", type: "bar", data: [60, 60, 60, 60, 60, 60], barWidth: 20, stack:"总量", itemStyle: { normal: { label: { show: false }, borderWidth: 5, color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, color: "rgba(33,195,248,1)" }, { offset: 1, color: "rgba(33,195,248,0.3)" } ]) } }}, { name: "指标1", type: "bar", data: [10, 10, 10, 10, 10, 10], barWidth: 20, stack:"总量", itemStyle: { normal: { label: { show: false }, borderWidth: 5, color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, color: "rgba(45,190,146,1)" }, { offset: 1, color: "rgba(45,190,146,0.3)" } ]) } }}, { name: "指标2", type: "bar", data: [20, 20, 20, 20, 20, 20], barWidth: 20, stack:"总量1", itemStyle: { normal: { label: { show: false }, borderWidth: 5, color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, color: "rgba(244,160,81,1)" }, { offset: 1, color: "rgba(244,160,81,0.3)" } ]) } } } ] };