let data = [50, 60, 70, 20, 30]; let className = ['西安市', '汉中市', '榆林市', '延安市', '宝鸡市']; let colorList = ['#39B3FF']; let defaultData = [100, 100, 100, 100, 100]; option = { grid: { left: '5%', right: '5%', bottom: '5%', top: '10%', containLabel: true }, tooltip: { trigger: 'axis', axisPointer: { type: 'none' }, formatter: function (params) { return params[0].name + '<br/>' + "<span style='display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:rgba(36,207,233,0.9)'></span>" + params[0].seriesName + ' : ' + params[0].value + '%' } }, backgroundColor: 'rgb(20,28,52)', xAxis: { show: false, type: 'value' }, yAxis: [{ type: 'category', inverse: true, axisLabel: { show: true, textStyle: { color: '#fff' }, }, splitLine: { show: false }, axisTick: { show: false }, axisLine: { show: false }, data: className }], series: [{ name: '同比增长比例', type: 'bar', zlevel: 1, itemStyle: { normal: { barBorderRadius: 0, color: { type: 'linear', colorStops: [{ offset: 0, color: "rgba(255, 255, 255, 0)", }, { offset: 1, color: "rgba(0, 255, 233, 1)", }, ], }, }, }, barWidth: 20, emphasis: { disabled: true, focus: 'none' }, data: data }, { name: '背景', type: 'bar', barWidth: 20, barGap: '-100%', data: defaultData, emphasis: { disabled: true, focus: 'none' }, itemStyle: { normal: { color: 'rgba(45, 243, 226, 0.10)', barBorderRadius: 0, } }, }, ] };