我的图表是空白的,我认为他没有从我的ajax调用中加载任何数据

时间:2015-03-24 09:44:53

标签: highcharts

我的图表是空白的,我不知道如何修复它。我希望你能帮助我!

 var handleDatalicentiesPA = function(j) {

    var point = j.modules;

    for (index = 0; index < point.length; ++index) {

          var pointChart = new Array(point[index].module_id,parseInt(point[index].license_used));
          $('#grafiek-kevin').highcharts().series[1].addPoint(pointChart, true);
    }
};

highchart

var runKevinChart = function () {

   $('#grafiek-kevin').highcharts({
        chart: {
            type: 'column'
        },
        title: {
            text: 'Licenties per Account'
        },
        xAxis: {
            categories:[

            ]
        },
        yAxis: {
            title: {
                text: ''
            }
        },
        series: [{
        name: '',
        data: []
    }, {
        name: '',
        data: []
    }]
   });

ajax call

$.ajax({
        url : 'dashboard/grafiek_kevin',
        datatype    : "json",
        success: function(data) {
            var j = JSON.parse(data);
            handleDatalicentiesPA(j);
        }     
    });  
};

return {
    *main function to initiate template pages*
    init: function () {
        runEasyPieChart();
        runKevinChart();

    }
};

0 个答案:

没有答案