如何获得系列的ID?在API中只有名称和数据等.但是没有id.我怎么能从系列中获得身份?
我使用以下方法循环图表中的所有系列.
$(chart.series).each(function(i, serie){
// Want to get serie's id
});
Run Code Online (Sandbox Code Playgroud)
编辑:
我发现我可以使用以下方式获取id.我不确定这是正确的方法吗?
$(chart.series).each(function(i, serie){
console.log(serie.options.id);
});
Run Code Online (Sandbox Code Playgroud)
May*_*wal 14
如果您已经知道系列的ID,您可以获得该系列的参考
chart.get(ID)
如果要遍历所有系列并列出系列的所有ID,请执行以下操作:
$(chart.series).each(function(i, serie){console.log(serie.options.id)})
Run Code Online (Sandbox Code Playgroud)
飞行:http://jsfiddle.net/NaK9D/2/