柱状图下,当data中的值是0时,页面上会显示一段空白宽度,有没有属性或方法可以让value=0时的柱状宽度变成0
配置项如下
option = {
title: {
text: 'Awesome Chart'
},
xAxis: [
{
type: 'category',
axisTick: {show: false},
data: ['2012', '2013', '2014', '2015', '2016']
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: 'Forest',
type: 'bar',
barGap: 0,
barMinHeight:3,
data: [320, 0, 301, 334, 390]
},
{
name: 'Steppe',
type: 'bar',
data: [0, 182, 191, 234, 290],
},
{
name: 'Desert',
type: 'bar',
barMinHeight:3,
data: [150, 232, 201, 154, 190]
},
{
name: 'Wetland',
type: 'bar',
data: [98, 77, 101, 99, 40]
}
]
};