I made a echart line graph https://stackblitz.com/edit/angular-aqghec?file=src%2Fapp%2Fapp.component.ts.
Now, I want to add gradient color to it, as shown below:
In this link https://echarts.apache.org/en/option.html#series-line.areaStyle.color, it said it supports the setting as gradient color. But when I tried to do this as code given:
It gave this error:
该怎么办?
提前致谢。
areaStyle: {
color: new graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: 'rgb(255, 158, 68)'
},
{
offset: 1,
color: 'rgb(255, 70, 131)'
}])
}
Echart有图形类,可以让你访问渐变属性。您可以根据需要对其进行微调,为数组中的颜色提供起点和终点。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)