title('任务运行'); $this->height(300); $this->chartHeight(220); } /** * 处理请求 * * @param Request $request * * @return mixed|void */ public function handle(Request $request) { // 图表数据 $this->withChart([ 28, 40, 36, 52, 38, 60, 55 ], [ 1, 2, 3, 4, 5, 6, 7 ]); } /** * 设置图表数据. * * @param array $data * * @return $this */ public function withChart(array $series, array $categories) { $this->chart([ 'chart' => [ 'type' => 'area', 'toolbar' => [ 'show' => false, ], ], 'series' => $series, 'dataLabels' => [ 'enabled' => true ], 'xaxis' => [ 'type' => 'number', 'categories' => $categories, 'labels' => [ 'show' => true, ], 'axisBorder' => [ 'show' => true, ], ], 'tooltip' => [ 'x' => [ 'show' => true ] ], ]); } }