如何让柱状从0%开始生成
配置项如下
option = {
color: ['#367da2', '#dda42d'],
title: {
text: '产品管理人收益比较图',
left: 'center',
textStyle: {
fontSize: 14,
fontWeight: 'normal'
}
},
tooltip: {
show: true
},
legend: {
top: 30,
data: ['一个月', '一年'],
itemWidth: 15,
itemHeight: 15,
itemGap: 80
},
xAxis: [{
type: 'category',
axisLine: {
onZero: true
},
axisTick: {
show: false
},
splitLine: {
show: true
},
data: ["桌若伟", "熊壮", "冉凌浩", "王洋", "邱炜", "彭敢"]
}],
yAxis: [{
type: 'value',
interval:1,
min:-5,
max:15,
axisLabel: {
show: false
},
axisLine: {
show: false
},
axisTick: {
show: false
},
splitLine: {
show: false
}
},{
type: 'value',
interval:80,
min:-400,
max:1200,
axisLabel: {
show: false
},
axisLine: {
show: false
},
axisTick: {
show: false
},
splitLine: {
lineStyle: {
type: 'dashed'
}
}
}],
series: [
{
name: '一个月',
type: 'bar',
itemStyle: {
normal: {
borderRadius: 5,
label: {
formatter: function (obj) {
return obj.value + "%";
},
position: 'top',
show: true,
}
}
},
data: [0.83, 1.35, -1.94, 0.28, 0.06, 4.21]
}, {
name: '一年',
type: 'bar',
yAxisIndex:1,
itemStyle: {
normal: {
borderRadius: 5,
label: {
formatter: function (obj) {
return obj.value + "%";
},
position: 'top',
show: true,
}
}
},
data: [528, 382, 756, 263, 29.7, 34]
},
]
};