createChart(Chart::TYPE_DOUGHNUT); $chart->setData([ 'labels' => ['January', 'February', 'March', 'April', 'May', 'June', 'July'], 'datasets' => [ [ 'label' => 'My First dataset', 'backgroundColor' => 'rgb(255, 99, 132)', 'borderColor' => 'rgb(255, 99, 132)', 'data' => [0, 10, 5, 2, 20, 30, 45], ], ], ]); $chart->setOptions([ 'scales' => [ 'y' => [ 'suggestedMin' => 0, 'suggestedMax' => 100, ], ], ]); return $this->render('dashboard/index.html.twig', [ 'chart' => $chart, ]); } }