score:0

change the data property to look like

  var newj = json.parse('<?php echo json_encode($allgrades); ?>');
then 

data: newj[i]

Related Query

More Query from same tag