Get Highcharts Series Data after Load

丶灬走出姿态 提交于 2019-12-22 03:54:23

问题


I am trying to get the series data from a Highcharts chart once it has been called and loaded to the page.

So far I've only been successful in getting a bunch of strings that isn't what I am after obviously. Wonder if someone can help me with this one.

jQuery Code:

success: function (chartData) {
    if(chart != undefined) {
        $('#meterloader').hide();
        $.each(chart.series[0], function(value) {
            alert(value);
        });
    } else {
        $('#meterloader').hide();
        $('#meterbox').html("<div><p class='textcentre bold red'>There was an error loading the chart.</p></div>");
    }
}

Thanks in advance.


回答1:


you need plotted data from the chart, then try

chart.series[0].data

if you need all the options from series then try

chart.series

this will return the entire series structure of the chart.

I hope this is useful for you.



来源:https://stackoverflow.com/questions/18840397/get-highcharts-series-data-after-load

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!