option = {
color: ['#B0D2F4', '#97D0A2'],
title: {
text: '车流量分时统计'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
legend: {
data: ['进场', '出场']
},
toolbox: {
feature: {
saveAsImage: {}
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: ['08:00','10:00','12:00','14:00','16:00','18:00','20:00','22:00','24:00']
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: '进场',
type: 'line',
stack: '总量',
smooth: true,
lineStyle: {
width: 0
},
showSymbol: false,
areaStyle: {
opacity: 0.8,
color: '#B0D2F4'
},
emphasis: {
focus: 'series'
},
data: [140, 232, 101, 264, 90, 340, 250,220,100]
},
{
name: '出场',
type: 'line',
stack: '总量',
smooth: true,
lineStyle: {
width: 0
},
showSymbol: false,
areaStyle: {
opacity: 0.8,
color: '#97D0A2'
},
emphasis: {
focus: 'series'
},
data: [120, 282, 111, 234, 220, 340, 310,220,80]
},
]
};
效果如下