How to get series's id in Highcharts / Highstock

一曲冷凌霜 提交于 2019-12-03 14:36:56

If you know the id of series already you can get a reference to the series by chart.get(ID)

If you want to loop through all the series and list all the IDs of series, do this:

 $(chart.series).each(function(i, serie){console.log(serie.options.id)})

FIddle : http://jsfiddle.net/NaK9D/2/

Tuan

From the documentation:

Another way to reference the series programmatically is by id. Add an id in the series configuration options, and get the series object by chart.get(id).

Looks like you can do:

$(chart.series).each(function(i, serie){
  this.get(id);
});
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!