Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Highcharts Series Data after Load

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.

like image 707
Seán McCabe Avatar asked Sep 17 '13 02:09

Seán McCabe


People also ask

How can I tell if Highcharts are loaded?

To determine that chart is fully loaded you can use load event, because load event is invoked when all elements are drown (API reference https://api.highcharts.com/highcharts/chart.events.load). However when you are using series animation this runs in a timeout, then load event is invoked before animation will finish.

What is plotOptions in Highcharts?

The plotOptions is a wrapper object for config objects for each series type. The config objects for each series can also be overridden for each series item as given in the series array. Configuration options for the series are given in three levels. Options for all series in a chart are given in the plotOptions.

Can Highcharts be used in server?

The application can be used either as a CLI (Command Line Interface), as an HTTP server, or as a node. js module.

What is legend in Highcharts?

The legend is a box containing a symbol and name for each series item or point item in the chart. Each series (or points in case of pie charts) is represented by a symbol and its name in the legend. It is possible to override the symbol creator function and create custom legend symbols.


1 Answers

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.

like image 57
Strikers Avatar answered Oct 31 '22 03:10

Strikers