柱状图色块之间是没有间隙。
堆叠柱状图色块之间设置白色间隙,主要设置item的边框颜色borderColor
以及宽度borderWidth
option = {
legend: {},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'value'
},
yAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
series: [
{
name: 'Direct',
type: 'bar',
stack: 'total',
label: {
show: true
},
data: [
{
value: 320,
itemStyle: {
borderColor: '#fff',
borderWidth: 2
}
},
302,
301,
334,
390,
330,
320
]
},
{
name: 'Mail Ad',
type: 'bar',
stack: 'total',
label: {
show: true
},
data: [
{
value: 120,
itemStyle: {
borderColor: '#fff',
borderWidth: 2
}
},
132,
101,
134,
90,
230,
210
]
},
{
name: 'Affiliate Ad',
type: 'bar',
stack: 'total',
label: {
show: true
},
data: [
{
value: 220,
itemStyle: {
borderColor: '#fff',
borderWidth: 2
}
},
182,
191,
234,
290,
330,
310
]
}
]
};