series: [
{
name: '上市企业数',
type: 'line',
data: [10, 11, 13, 11, 12, 12, 9],
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#2a508e'
},
{
offset: 1,
color: '#08101e'
}
])
}
},
在series里面设置areaStyle,然后找到合适的颜色就行了