配置项如下
option = {
textStyle: { color: '#666', fontSize: 13 },
toolbox: {
show: true,
feature: { saveAsImage: { backgroundColor: 'rgba(0,0,0,0)' }, restore: {} },
iconStyle: { borderColor: '#666' },
},
tooltip: {},
grid: { containLabel: true },
xAxis: {
nameTextStyle: { color: '#666', padding: [0, 0, -10, 0], fontSize: 13 },
axisLabel: { interval: 0, textStyle: { fontSize: 13 } },
axisTick: { lineStyle: { color: '#c8c8c8', width: 1 }, show: true },
splitLine: { show: false },
axisLine: { lineStyle: { color: '#c8c8c8', width: 1 }, show: true },
type: 'category',
data: ['2015年', '2016年', '2017年', '2018年', '2019年'],
splitArea: { show: true, areaStyle: { color: ['rgba(200,200,200,0.3)', 'rgba(200,200,200,0.2)'] } },
},
yAxis: {
nameTextStyle: { color: '#666', padding: [0, 0, -10, 0], fontSize: 13 },
axisLabel: { interval: 0, textStyle: { fontSize: 13 } },
axisTick: { lineStyle: { color: '#c8c8c8', width: 1 }, show: true },
splitLine: { show: false },
axisLine: { lineStyle: { color: '#c8c8c8', width: 1 }, show: true },
type: 'category',
data: [
'广州市',
'广州市',
'广州市',
'广州市',
'广州市',
'广州市',
'广州市',
'广州市',
'广州市',
'广州市',
'广州市',
],
},
visualMap: [
{
min: 100,
max: 400,
calculable: false,
orient: 'horizontal',
left: 'center',
top: 20,
color: ['#C7021D', '#79E73C'],
text: ['高 ', '低'],
textStyle: { color: '#666', fontSize: 13 },
},
],
series: [
{
type: 'heatmap',
data: [
[0, 0, 100],
[0, 1, 100],
[0, 2, 100],
[0, 3, 100],
[0, 4, 100],
[0, 5, 100],
[0, 6, 200],
[0, 7, 100],
[0, 8, 400],
[0, 9, 100],
[0, 10, 100],
[1, 0, 120],
[1, 1, 120],
[1, 2, 125],
[1, 3, 120],
[1, 4, 120],
[1, 5, 120],
[1, 6, 120],
[1, 7, 120],
[1, 8, 120],
[1, 9, 130],
[1, 10, 120],
[2, 0, 120],
[2, 1, 140],
[2, 2, 140],
[2, 3, 140],
[2, 4, 140],
[2, 5, 140],
[2, 6, 140],
[2, 7, 140],
[2, 8, 140],
[2, 9, 140],
[2, 10, 140],
[3, 0, 200],
[3, 1, 200],
[3, 2, 200],
[3, 3, 200],
[3, 4, 200],
[3, 5, 200],
[3, 6, 200],
[3, 7, 200],
[3, 8, 200],
[3, 9, 200],
[3, 10, 200],
[4, 0, 300],
[4, 1, 300],
[4, 2, 300],
[4, 3, 300],
[4, 4, 300],
[4, 5, 300],
[4, 6, 300],
[4, 7, 300],
[4, 8, 300],
[4, 9, 300],
[4, 10, 300],
],
label: { normal: { show: true, color: '#fff' } },
itemStyle: {
normal: { borderColor: 'rgba(255, 255, 255, 0.5)' },
emphasis: { shadowBlur: 0, shadowColor: 'rgba(255, 255, 255, 0.5)' },
},
},
],
};