creating highchart with ajax json data

后端 未结 3 1380
小蘑菇
小蘑菇 2020-12-04 20:24

I\'m trying to create a simple chart in a page using mysql data retrieved using a mysql script

I don\'t understand how to integrate the ajax call with the data requi

3条回答
  •  感情败类
    2020-12-04 21:03

    In your ajax success function call your visitorData function with data[1].data (since that's how your json is formatted)

        $.ajax({
            url: '/visitdata',
            type: 'GET',
            async: true,
            dataType: "json",
            success: function (data) {
                visitorData(data[1].data);
    
            }
        });
    

    also, your visitorData function def is odd.

    vistorData = function(data) 
    

    or

    function vistorData(data)
    

提交回复
热议问题