request = $request; } public function renderWidgetContent(): string { $view = $this->backendViewFactory->create($this->request); $view->assignMultiple([ 'button' => $this->buttonProvider, 'options' => $this->options, 'configuration' => $this->configuration, ]); return $view->render('Widget/ChartWidget'); } public function getEventData(): array { return [ 'graphConfig' => [ 'type' => 'doughnut', 'options' => [ 'maintainAspectRatio' => false, 'plugins' => [ 'legend' => [ 'display' => true, 'position' => 'bottom', ], ], 'cutoutPercentage' => 60, ], 'data' => $this->dataProvider->getChartData(), ], ]; } public function getCssFiles(): array { return []; } public function getJavaScriptModuleInstructions(): array { return [ JavaScriptModuleInstruction::create('@typo3/dashboard/contrib/chartjs.js'), JavaScriptModuleInstruction::create('@typo3/dashboard/chart-initializer.js'), ]; } public function getOptions(): array { return $this->options; } }