动态设置setOption,其中series部分报错,Uncaught Error: series.type should be specified.
在线等解决,目前通过循环后台的数据动态生成series,setOption时报错。
//blackMap是后台传回来的Map<String, List<String>>
option = {
color: ['#48cda6', '#11abff', '#968ade', '#33316b', '#AA2C98', '#d15b47', '#58829e'],
legend: {
data: blackSiteNames
},
xAxis: {
data: blackTimes
},
series: function () {
var series = [];
for (var key in blackMap) {
var item = {
name: key,
line: true,
smooth: true,
data: blackMap[key]
}
series.push(item);
}
return series;
}()
}
}

你这个问题完全是伸手党,不自己排查问题。
这个不是Issue啊,
你的series的type属性没有设置。 提示的问题也告诉了,series的type要指定。
var item = {
type: 'line' || 'bar' .............
...
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
你这个问题完全是伸手党,不自己排查问题。
这个不是Issue啊,
你的series的type属性没有设置。 提示的问题也告诉了,series的type要指定。
var item = {
type: 'line' || 'bar' .............
...
}