score:2

the reason it's not working is because, you are getting the response data as a json string not json object.

so, to make it work with chartjs, you need to parse it first, using json.parse() method ...

$(document).ready(function() {
   $.ajax({
      url: "prod_agg.php",
      method: "get",
      success: function(data) {
         console.log(data);

         var data = json.parse(data);   //parse json string

         var date = [];
         var output = [];
         ...

Related Query

More Query from same tag