效果
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/2aa62ab0b1d91b1f1f6f6832fd9e8c20.png)
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/abc697fb6d34cb7f3270c805bfea05f6.png)
代码
let xdata = [
'11.17',
'11.18',
'11.19',
'11.20',
'11.21',
'11.22',
'11.23',
'11.24',
'11.25',
'11.26'
]
let data = [
'1',
'2',
'3',
'6',
'6',
'4',
'6',
'8',
'5',
'7'
]
return {
backgroundColor: '#140a69',
grid: {
left: '5%',
right: '10%',
top: '20%',
bottom: '15%',
containLabel: true
},
tooltip: {
trigger: 'axis',
backgroundColor: 'rgba(69, 14, 255,0.5)',
borderWidth: '0',
textStyle: {
color: '#6DFFFF'
},
axisPointer: {
type: 'cross',
label: {
backgroundColor: 'rgba(14, 95, 255, 0.6)'
}
}
},
xAxis: [
{
type: 'category',
boundaryGap: false,
axisLabel: {
color: 'rgba(255, 255, 255, 0.15)',
show: true
},
axisLine: {
show: false
},
splitLine: {
show: true,
lineStyle: {
color: 'rgba(255, 255, 255, 0.15)'
}
},
data: xdata
}
],
yAxis: [
{
show: false,
type: 'value',
axisLine: {
lineStyle: {
color: '#27b4c2'
}
},
splitLine: {
show: true,
lineStyle: {
color: '#11366e'
}
}
}
],
series: [
{
smooth: true,
type: 'line',
stack: '总量',
symbol: 'circle',
symbolSize: 8,
itemStyle: {
normal: {
color: '#140a69',
borderColor: '#16CEB9',
borderWidth: 1,
lineStyle: {
color: '#16CEB9',
width: 1
}
}
},
data
}
]
}