series: [
{
name:arr_name[0],
type:'line',
stack: '总量',
data:arr_sum_long_new[0]
},
{
name:arr_name[1],
type:'line',
stack: '总量',
data:arr_sum_long_new[1]
},
{
name:arr_name[2],
type:'line',
stack: '总量',
data:arr_sum_long_new[2]
},
{
name:arr_name[3],
type:'line',
stack: '总量',
data:arr_sum_long_new[3]
}
]
怎样在series中循环动态显示该代码片?我这样在series中添加for循环有问题
显示for循环语句错误: Uncaught SyntaxError: Unexpected token var
series:
[
for(var i = 0;i<json.data.length;i++){
{
name:arr_name[i],
type:'line',
stack: '总量',
// data:[120, 132, 101, 134, 90, 230, 210]
data:arr_sum_long_new[i]
}
}
]