score:2

Accepted answer

From your code it appears that your months are in thead and not tbody. So you should be really using $('thead th') selector. I would also recommend using the :parent selector to filter out empty ths

$('thead th:parent', table).each( function(i) {
    var month=$(this).text();
    options.xAxis.categories.push(month);
});

Also, your series data needs to be changed if you want the x-axis to be months, you should now have only 3 series, instead of the earlier 6. And each series will now have 6 points (one for each month) instead of previous 3 points/series. So your table parsing would need to change to something like this.

options.series = [];
$('tbody tr', table).each(function (i) {
    var tr = this;
    var serie = {};
    serie.name = $('th', tr).text();
    serie.data = [];
    $('td', tr).each(function (j) {
        serie.data.push(parseFloat(this.innerHTML));
    });
    options.series.push(serie);
});

Demo @ jsFiddle


Related Query