需求:折线图变成曲线,且下方带有阴影渐变效果
![](https://img.haomeiwen.com/i18344853/7f3e9a1b3440d977.png)
步骤:在series中修改smooth参数添加areaStyle样式,如下:
![](https://img.haomeiwen.com/i18344853/fd04b5f5e497dd67.png)
代码:
smooth: true,
areaStyle: {
normal: {
color: {
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0,
color: "#dc3881" // 0% 处的颜色
}, {
offset: 0.7,
color: "rgba(220,56,129,0)" // 100% 处的颜色
}],
globalCoord: false // 缺省为 false
}
}
},
网友评论