一.会有空位的情况
当某些数值为0时,会空着,显得不好看.
代码示例:
option = {
tooltip: {
trigger: 'axis'
},
legend: {
data: ['A', 'B', 'C', 'D', 'E']
},
xAxis: [
{
type: 'category',
position: 'bottom',
data: ['2012', '2013', '2014', '2015', '2016']
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: 'A',
type: 'bar',
data: [1, 3, 4, 5, 6],
barWidth: 30
},
{
name: 'B',
type: 'bar',
data: [3, 5, 6, 0, 1],
barWidth: 30
},
{
name: 'C',
type: 'bar',
data: [5, 3, 6, 0, 0],
barWidth: 30
},
{
name: 'D',
type: 'bar',
data: [4, 7, 4, 8, 3],
barWidth: 30
},
{
name: 'E',
type: 'bar&#