Matt DeKok
Matt DeKok

Reputation: 196

Find number of data points in each series in highcharts

Is there a way to determine the number of data points in each series of a Highcharts chart?

Upvotes: 4

Views: 5446

Answers (2)

KST
KST

Reputation: 174

Using jQuery and assuming you've defined the chart as a variable named chart ...

$.each(
    chart.series,
    function(){
        console.log(this.name + ": " + this.data.length + " data points.");
    }
);

Upvotes: 2

Ricardo Lohmann
Ricardo Lohmann

Reputation: 26320

Assuming that you want to get from the first serie.

console.log(chart.series[0].data.length);

Demo

Upvotes: 4

Related Questions