how to use JSON Data in chart.js?

前端 未结 2 1981
南方客
南方客 2021-02-06 19:40

hi i have been trying to use data from MYSQL database and use them to create graphical chart with chart.js. i encoded data into JSON data( through a php file name data1.php), no

2条回答
  •  孤城傲影
    2021-02-06 19:54

    I am not quite sure if you mean this:

    var chartjsData = [];
    for (var i = 0; i < json.length; i++) {
        chartjsData.push(json[i].present_worth);  
    }
    

    http://jsfiddle.net/rnX2Z/1/

    Otherwise comment ;)

提交回复
热议问题