json_encode和highcharts

我正在尝试使用jQuery在PHP和MySQL中创建图形,特别是使用Highcharts库,我已经设法使用来自MySQL数据库的数据制作图表,但这些数据显示了一些数据,如果它们在数据库中而不是其他数据,例如,一个产生10个结果的查询5是好的,但其他五个没有,我在网上做了一些研究,我理解这是由于问题,当我通过json_encode在MySQL中传递我的查询结果时,我希望你们中的一些人可以告诉我,因为我有这个错误,或者如果我误用了JSON,非常感谢你。 代码:index.php

   Incidencias      var chart; $(document).ready(function() { var options = { chart: { renderTo: 'pieClientes', defaultSeriesType: 'pie', marginRight: 10, marginBottom: 25 }, title: { text: 'top 10. Clientes con m\u00e1s incidencias', x: -10 }, subtitle: { text: '', x: -20 }, tooltip: { formatter: function() { return ''+ this.point.name +': '+ this.y +' incidencias'; } }, legend: { layout: 'vertical', align: 'right', verticalAlign: 'top', x: -10, y: 100, borderWidth: 0 }, series: [{ type: 'pie', name: 'Browser share', data: [] }] } $.getJSON("datosCliente.php", function(json) { options.series[0].data = json; chart = new Highcharts.Chart(options); }); });    

Dashboard incidencias SCI

datosCliente.php

  

例如,当我想在图表中显示数据库的10行时,它会显示此表单的结果:

  1st. row-> show me "slice" 2nd. row-> the registerok, 3th. row-> show me "slice" 4. row-> the registerok, 5. row-> the registerok, 6.row-> show me "slice" 7.row->the registerok, 8.row-> show me "slice" 9.row->the registerok, 10.row-> show me "slice" 

问题是在图形(饼图)中显示正确的数据但不显示其他数据,就好像某些记录或管道跳过了5个registrros的限制,而不是我不知道我错在哪里。 🙁

谢谢你的帮助:)

首先,我会尝试给数组元素一个值,而不是使用索引。 为您的数组键命名。 同样删除编码中的所有大写字母。 我在ipad上无法编码,但如果您有疑问,请告诉我。