Chartjs-How to load an array of external data in QuickChart?

1👍

That looks like a JSON String representaion of an array so for example

$jj = json_encode([50, 60, 70, 180]);

$qc->setConfig("{
    type: 'bar',
    data: {
      labels: ['Q1', 'Q2', 'Q3', 'Q4'],
      datasets: [{
        label: 'Users',
        data: $jj
      }]
    }
  }";

Leave a comment