Skip to content Skip to sidebar Skip to footer

Highcharts Async Server Loading With Multiple Series

i'm trying to use a the lazy loading of Highcharts following its example http://www.highcharts.com/stock/demo/lazy-loading and their php code https://github.com/highslide-soft

Solution 1:

What echo $callback ."([\n" . join(",\n", $rows) ."\n]);"; returns? I advice to transform your array to json by json_encode() and then use in javascript.

EDIT:

You have no access to chart in you scirpt, morever You can use setData only on exsiting serie, not on series which not exist like chart.series[2]. You should to call addSeries

 val1 = [];
    val2 = [];
    val3 = [];
    val4 = [];
    val5 = [];
    $.each(data, function (key, value) {
        val1.push([value[0], value[1]]);
        val2.push([value[0], value[2]]);
        val3.push([value[0], value[3]]);
        val4.push([value[0], value[4]]);
        val5.push([value[0], value[5]]);
    });
chart.series[0].setData(val1);
    chart.addSeries({
        data: val2
    });

    chart.addSeries({
        data: val3
    });

    chart.addSeries({
        data: val4
    });

    chart.addSeries({
        data: val5
    });



    chart.hideLoading();

http://jsfiddle.net/4knAX/2/

Post a Comment for "Highcharts Async Server Loading With Multiple Series"