-1
我JSON数据如何创建堆栈条形图与使用setData对象在Javascript
{
"data":[
{ "month" : "January",
"name" : "John",
"count" : 10
},
{
"month" : "January",
"name" : "Jane",
"count" : 15
}
]
},
{
"data":[
{ "month" : "February",
"name" : "Mark",
"count" : 20
},
{ "month" : "February",
"name" : "Max",
"count" : 30
}
]
}
例如这里:https://www.highcharts.com/demo/bar-stacked
如何参考使用setData对象堆叠条形图?
我尝试console.log(setdata[0]['data'][0]['month']);
返回 “一月”,它的作品找到,但
for(i=0 ; i<result.length ; i++){
console.log(setdata[i]['data'][i]['month']);
}
这是错误。
你缺少一个 “” 值后 “名”,你需要一个逗号。 –
你的'JSON'无效。在这里验证'JSON' https://jsonlint.com/ – Shiladitya
这里是什么'setdata'? – choasia