Chartjs-Symfony Ux using chartJs : How can i feed the x's axes data?

0๐Ÿ‘

I managed to make it, here what the syntaxe look like:

  while($i <= $N)
      {
        $data =
           [
            'label'=> 'Scatter Dataset',
            'data' => 
               [['x'=>$point1[$i],'y'=>$point1[$i]],  
               ['x'=>$point2[$i],'y'=>$point2[$i]]],
               'backgroundColor' => 'rgb(255, 99, 132)',
               'showLine'=> true,
             ];
          $datas[$i] = $data;
        $i++;
    }
    $chart->setData([
      'datasets' => $datas
     ]);

Leave a comment