1、Y軸如何顯示百分比。
option = {
color: ['#3398DB'],
tooltip : {
trigger: 'item',
formatter: "{a} <br/>{b}:({c} %)"
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis : [
{
type : 'category',
data : ['24歲以下', '24歲到30歲', '31到35歲', '36歲到40歲', '41歲及以上'],
axisTick: {
alignWithLabel: true
}
}
],
yAxis : [
{
type : 'value',
min : 0,
max : 100,
axisLabel:{
formatter: '{value} %'
}
}
],
series : [
{
name:'用戶數',
type:'bar',
barWidth: '60%',
data:[10,10,10,10,60],
itemStyle:{
normal:{
lable:{
show:true,
formatter:'{a}%'
}
}
}
}
]
};