chart = new Chart(); // MANDATORY. Set the labels for the dataset points $this->chart->labels([ 'Today', ]); // RECOMMENDED. Set URL that the ChartJS library should call, to get its data using AJAX. $this->chart->load(backpack_url('charts/weekly-users')); // OPTIONAL // $this->chart->minimalist(false); // $this->chart->displayLegend(true); } /** * Respond to AJAX calls with all the chart data points. * * @return json */ public function data() { $users_created_today = \App\Models\User::whereDate('created_at', today())->count(); $this->chart->dataset('Users Created', 'bar', [ $users_created_today, ]) ->color('rgba(205, 32, 31, 1)') ->backgroundColor('rgba(205, 32, 31, 0.4)'); } }