data=[{'mappedAreaName': '广东省', 'total': 82.0, 'ims': 3288.0}, {'mappedAreaName': '北京市', 'total': 64.0, 'ims': 3103.0}, {'mappedAreaName': '江苏省', 'total': 32.0, 'ims': 1491.0}, {'mappedAreaName': '河南省', 'total': 22.0, 'ims': 968.0}, {'mappedAreaName': '陕西省', 'total': 20.0, 'ims': 901.0}, {'mappedAreaName': '广西壮族自治区', 'total': 20.0, 'ims': 692.0}, {'mappedAreaName': '上海市', 'total': 19.0, 'ims': 1244.0}, {'mappedAreaName': '天津市', 'total': 18.0, 'ims': 458.0}, {'mappedAreaName': '四川省', 'total': 18.0, 'ims': 1169.0}, {'mappedAreaName': '河北省', 'total': 17.0, 'ims': 1023.0}]
option = {
dataset:{
source:data,
},
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'value',
show:0
}
],
yAxis: [
{
type: 'category',
axisLine:{
show:0,
},
boundaryGap:0,
axisTick:{
show:0
},
axisLabel:{
interval:0,
}
}
],
series: [
{
name: '点击',
type: 'bar',
barWidth:10,
label: {
show: 0
},
emphasis: {
focus: 'series'
},
encode:{
x:'tatol',
y:['mappedAreaName']
},
},
{
name: '展现',
type: 'bar',
barWidth:10,
label: {
show: 0,
position: 'left'
},
emphasis: {
focus: 'series'
},
encode:{
x:'ims',
y:['mappedAreaName']
},
}
]
};