option = { legend: { formatter: (name)=>{ let arr = '{a|'+name+'}'+'{b|'+name+'西方小道}' return arr }, textStyle:{ rich:{ a:{ fontSize:16, color:'red', padding: [0, 0, 0, 20] }, b:{ fontSize:14, color:'blue', padding: [0, 0, 0, 20] } } }, data:[ '预计', '理论', ], }, xAxis: { show:true, type: 'value', max:200 }, yAxis: [ { type: 'category', axisTick: 'none', axisLine: 'none', data: [] }, { show: false, type: 'category', axisTick: 'none', data: [], axisLine: 'none', }, ], series: [ { name:'理论', type: 'bar', barWidth:'50', yAxisIndex: 0, itemStyle: { color: '#ddd', }, z:2, data: [180] }, { name:'预计', barGap: '-100%', // Make series be overlap barWidth:'60', yAxisIndex: 1, z:1, itemStyle: { color: '#444', }, type: 'bar', data: [200] }, ]};