echarts折线图阴影设置

需求:折线图变成曲线,且下方带有阴影渐变效果

 
image.png

步骤:在series中修改smooth参数添加areaStyle样式,如下:

 
image.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 } } },

猜你喜欢

转载自www.cnblogs.com/tzwbk/p/12795922.html