echarts使用
创建一个象形柱图 - 类热力图
option = {
tooltip: {
trigger: ‘axis’,
axisPointer: {
type: ‘none’
},
formatter: function (params) {
return params[0].name + ‘: ’ + params[0].value;
}
},
xAxis: {
data: [‘驯鹿’, ‘火箭’, ‘飞机’, ‘高铁’, ‘轮船’, ‘汽车’, ‘跑步’, ‘步行’, ],
axisTick: {show: false},
axisLine: {show: false},
axisLabel: {
color: ‘#20b2aa’
}
},
yAxis: {
splitLine: {show: false},
axisTick: {show: false},
axisLine: {show: false},
axisLabel: {show: false}
},
color: [’#1E90FF’],
series: [{
name: ‘hilllll’,
type: ‘pictorialBar’,
barCategoryGap: ‘-130%’,
symbol: ‘path://M0,10 L10,10 C5.5,10 5.5,5 5,0 C4.5,5 4.5,10 0,10 z’,
itemStyle: {
opacity: 0.5
},
emphasis: {
itemStyle: {
opacity: 1
}
},
data: [123, 60, 25, 18, 12, 9, 2, 1],
}, {
name: ‘glyph’,
type: ‘pictorialBar’,
barGap: ‘-100%’,
symbolPosition: ‘end’,
symbolOffset: [0, ‘-120%’],
data: [{
value: 123,
symbolSize: false,
label: {
show: true,
position: ‘top’
}
}, {
value: 60,
symbolSize: false,
label: {
show: true,
position: ‘top’
}
}, {
value: 25,
symbolSize: false,
label: {
show: true,
position: ‘top’
}
}, {
value: 18,
symbolSize: false,
label: {
show: true,
position: ‘top’
}
}, {
value: 12,
symbolSize: false,
label: {
show: true,
position: ‘top’
}
}, {
value: 9,
symbolSize: false,
label: { //在单个头部显示参数
show: true,
position: ‘top’
}
}, {
value: 2,
symbolSize: false,
label: {
show: true,
position: ‘top’
}
}, {
value: 1,
symbolSize: false,
label: {
show: true,
position: ‘top’
}
}]
}]
};