ECharts怎么让yAxis里面的信息显示在图上面,请各位帮忙解决一下?

1,想实现的效果

clipboard.png
2,代码如下:
app.title = '世界人口总量 - 条形图';

option = {

title: {

},
tooltip: {
    trigger: 'axis',
    axisPointer: {
        type: 'shadow'
    }
},
legend: {
},
grid: {
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true
},
xAxis: {
    type: 'value',
    boundaryGap: [0, 0.01]
},
yAxis: {
    name:'IP',
    type: 'category',
    data: ['192.168.0.16','192.168.20.37','192.168.0.184','10.10.1.6','192.168.0.53','192.168.0.7'],
},
series: [
    {
        type: 'bar',
        barMaxWidth:30,
        data: [1, 2, 9, 4, 3, 6],
           label: {
                            normal: {
                                show: true,
                                position: 'insideRight'
                            }
                        },
        
    }
]

};

阅读 5.6k
2 个回答

把series中的label换成itemStyle即可

itemStyle: { normal: { label: { show: true, position: 'insideRight' } } },
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题