类目左对齐 数据右对齐,上图
代码仅供参考
option = {
grid: {
top: '10px',
left: '120px',
bottom:'30px',
},
xAxis: {
show: false
},
yAxis: {
type: 'category',
inverse: true, // 倒叙
axisLabel: {
margin:100,
align: 'left',
formatter: (val) => {
return `${val}`;
}
},
axisLine: {
show: false // 轴线
},
axisTick: {
show: false // 刻度线
},
data:['栏目1','栏目2','栏目3','栏目4','栏目5','栏目6','栏目7','栏目8','栏目9','栏目10',]
},
series: [
{
type: 'bar',
showBackground: true,
barWidth: 10,
barMaxWidth: 20,
barMinWidth: 5,
label:{
show:true,
position:'left',
offset:[680,0],
color: '#000'
// distance: -22
},
itemStyle: {
color: 'rgba(71, 177, 255, 1)',
barBorderRadius: [0, 5, 5, 0]
},
data: [100, 200, 300, 400, 500,100, 200, 300, 400, 500]
}
]
};