打印options两个系列的areaStyle都成了后面rgb(255, 0, 135, 1)的样式,为什么,我写一个formatter () 方法倒是成功了
这个例子是从官网例子中复制下来的
用这种方法试试
option = {
xAxis: {
type: "category",
data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
},
yAxis: {},
series: [{
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: "line",
areaStyle:{
opacity: 0.8,
color: {
type: 'linear',
x: 0,
y: 0,
x1: 0,
y1: 1,
colorStops: [
{
offset: 0,
color:'rgb(255, 0, 135, 0.1)'
},
{
offset: 1,
color:'rgb(255, 0, 135, 1)'
},
]
}
}
}]
}
参考文档:配置项手册