Chartjs-Feeding PHP MySQL Call into Charts.js

0👍

I’d be returning the values as a string, rather than an array:

$data = '';
foreach ($myQuery as $result) {
    $data .= $result->dreamTeamPoints.',';
}

Then assigning it to a value on the successful ajax post:

     success:function(output){
         //jQuery('#y_data1').html( output );
         var out = output;
     }

and lastly putting the ‘out’ variable inside the assignment:

var y_data1 = [ out ];

You may be able to simplify it more – Go the Eagles.

Leave a comment