通过Y轴的max和min可调整Y柱的大小,这样可调整柱的高低
option = {
title : {text: '利用外资情况',
x:'center',
y:'top', textStyle:{fontFamily:'Microsoft Yahei'},
},
tooltip : {
trigger: 'axis'
},
legend: {
x: 'right',
y: '35',
textStyle:{fontFamily:'Microsoft Yahei'},
data:['上年同期','本期']
},
calculable : true,
xAxis : [
{
type : 'category',
axisLabel: {
textStyle:{fontFamily:'Microsoft Yahei'}
},
data : ['批发零售贸易业','交通、邮电、运输业','金融业','房地产业','社会服务业']
}
],
yAxis : [
{
type : 'value',
position: 'left',
min:0,//最小
max:9,//最大
splitNumber: 2,
axisLabel : {
formatter: '{value} 千万',
textStyle:{fontFamily:'Microsoft Yahei'}
}
}
],
series : [
{
name:'上年同期',
type:'bar',
itemStyle: {
normal: {
label : {
show: true, position: 'top',
textStyle: {
color: 'black',
textStyle:{fontFamily:'Microsoft Yahei'}
}
}
}
},
data:[1.5,0.8,7,2,2],
barGap:'100%',
},
{
name:'本期',
type:'bar',
itemStyle: {
normal: {
label : {
show: true, position: 'top',
textStyle: {
color: 'black',
textStyle:{fontFamily:'Microsoft Yahei'}
}
}
}
},
data:[2,1,8,3,3],
barGap:'100%',
}
]
};