Get Highcharts Series Data after Load

2019-04-20 02:27发布

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条回答
劳资没心,怎么记你
2楼-- · 2019-04-20 02:55

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.

查看更多
登录 后发表回答