option = {
grid: {
left: '20',
right: '20',
bottom: '0%',
top: '4%',
containLabel: true
},
tooltip: {
trigger: 'axis'
},
xAxis: [{
type: 'category',
data: ['18岁以下', '18~30岁', '30~40岁', '40~50岁', '50~60岁', '60岁以上'],
axisLine: {
lineStyle: {
color: '#D9D9D9'
}
},
axisLabel: {
textStyle: {
color: '#000'
}
}
}],
yAxis: [{
type: 'value',
splitLine: {
show: true,
lineStyle: {
type: 'dashed'
}
},
axisLine: {
lineStyle: {
color: '#fff'
}
},
axisLabel: {
textStyle: {
color: '#000'
}
}
}],
series: [{
data: [0, 932, 901, 934, 1290, 1330, 1320],
type: 'line',
itemStyle: {
color: '#3AA0FF'
},
markLine: {
symbol:'none',
itemStyle: {
normal: {
borderWidth: 1,
lineStyle: {
type: 'solid',
color: '#333 ',
width: 2,
},
label: {
formatter: '',
textStyle: {
fontSize: 16,
fontWeight: "bolder",
},
}
},
},
data: [
//配置线端起始点
[
{
coord: [2, 0]
},
{
coord: [2, 932]
}
]
]
},
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: '#3AA0FF' // 0% 处的颜色
}, {
offset: 1, color: '#fff' // 100% 处的颜色
}],
global: false // 缺省为 false
}
}
}]
};
效果图

网友评论