Drawing line chart in chart.js with json response

前端 未结 2 1437
说谎
说谎 2021-02-01 11:38


        
2条回答
  •  庸人自扰
    2021-02-01 12:02

    Your JSON results should be same structure as chardata, and then you make this

        var charData = 
        {
            labels = [\\months]
            datasets: data.datasets
        }
    

    in case that your response (in my case data.datasets) has sam structure like is hardcoded in those examples.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题