来自不同渠道的用户,经过浏览商品-注册-购买,各步骤所留下的用户数,直观反映各步骤失去的用户数
配置项如下
option = {
legend: {
bottom: '0',
itemWidth: 12,
itemHeight: 12,
itemGap: 40,
icon: 'rect',
data: ['Google', 'Facebook', 'QR']
},
xAxis: {
type: 'value',
show: false,
axisLabel: {
show: false
},
splitLine: {
show: false
},
axisTick: {
show: false
}
},
yAxis: {
type: 'category',
inverse: true,
show: false
},
series: [
{
type: 'bar',
name: 'Google',
stack: '总量',
barWidth: 45,
label: {
show: true
},
data: [500, 400, 300, 200, 100]
},
{
type: 'bar',
name: 'Facebook',
stack: '总量',
barWidth: 45,
label: {
show: true
},
data: [50, 40, 30, 20, 10]
},
{
type: 'bar',
name: 'QR',
stack: '总量',
barWidth: 45,
label: {
show: true,
formatter(params) {
return -params.value
}
},
data: [-500, -400, -300, -200, -100]
}
]
};