1,想实现的效果
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'
}
},
}
]
};
http://gallery.echartsjs.com/...
这个例子中把
series[0].label.normal.formatter
里的v.data
改成v.name
就行了或者 改成
formatter: '{b}'