Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我做了一个echart折线图。现在,我想给它添加渐变色,如下所示:
在这个链接中,它说它支持设置为渐变色。但是当我尝试按照给出的代码执行此操作时:
它给出了这个错误:
该怎么办?
提前致谢。
areaStyle: { color: new graphic.LinearGradient(0, 0, 0, 1, [ { offset: 0, color: 'rgb(255, 158, 68)' }, { offset: 1, color: 'rgb(255, 70, 131)' }]) }
Echart 有图形类,可以让你访问渐变属性。您可以根据需要对其进行微调,为数组中的颜色提供起点和终点。