var option ={
tooltip: {},
xAxis: {
type:'value'
},
grid: {
left: "3%",
right: "1%",
bottom: "-1%",
width: "300px",
height: "300px",
containLabel: true
},
yAxis: {
type:'category',
data:this.yardList.map(function(item){
return item[1]
})
},
series: [
{
// name: "购买总人数",
type: "bar",
barWidth: "15px",
barGap:"10%",
// barCategoryGap是不同类目间的距离
barCategoryGap: "1%",
data:this.yardList.map(function(item){
return item[2]
}),
itemStyle: {
color: "#9ACFBD"
},
// 实现数字展示在柱状图
label: {
show: true,
position: 'inside',
color:'black'
},
}
]
}
echarts在柱状图上显示数值
最新推荐文章于 2024-09-18 11:33:05 发布