score:2

Accepted answer

I guess the problem is due to asyn nature of $.getJSON, when you call: $('#chart').highcharts({ right after that, the response from the server does not arrive yet. Try changing it to:

$.getJSON(url, function(data) {
            $.each(data, function(index, data) {
                zone_name.push(data.name);
                male_pop.push(parseInt(data.pop_male));
                female_pop.push(parseInt(data.pop_female));
            });

        //    $('#chart').highcharts({
        });

Related Articles