Susanne92
Susanne92

Reputation: 217

How to select array from Highchart.series?

http://jsfiddle.net/ErzQs/

How can I get the output from series0 ? I need the datapoints ... but my solution does not work properly.

data = chart.series[0].data;

Upvotes: 0

Views: 47

Answers (1)

emerson.marini
emerson.marini

Reputation: 9348

You can retrieve the data this way:

$('#button').click(function () {
    var chart = $('#container').highcharts();
    data = chart.series[0].data;
    $(chart.series[0].data).each(function (index, element) {            
        alert(this.y);
    });
});

Working demo: http://jsfiddle.net/ErzQs/1/

Upvotes: 2

Related Questions