jjzjj

offences

全部标签

php - Chartjs 数据通过 json 请求不填充

我正在使用PHP和SQL生成一个数组,该数组计算具有相同值的数据以及其中有多少值输出json_encode到:{"05":4,"09":4,"19":4}Chart.js文件:(精简)//Chartvarctx=document.getElementById("monthAbuseChart");varmyLineChart=newChart(ctx,{type:'line',data:{labels:["1","2","3"],datasets:[{label:"Offences",//data:[0,7,5]Thisworksdata:offences//Thisdoesn't}]