Open ndberg opened 4 months ago
same issue here:
Versions: laravel/framework: 11.27.2 laravel/nova: 4.35.3 digital-creative/nova-dashboard: 1.1.3 digital-creative/chartjs-widget: 1.0.2
Code:
<?php
namespace App\Nova\Widgets;
use DigitalCreative\ChartJsWidget\Charts\BarChartWidget;
use DigitalCreative\NovaDashboard\Filters;
use Illuminate\Support\Collection;
use Laravel\Nova\Http\Requests\NovaRequest;
class WidgetName extends BarChartWidget
{
public function configure(NovaRequest $request): void
{
/**
* These set the title and the button on the top-right if there are multiple "tabs" on this view
*/
$this->title(__('Number') . __('Name'));
$this->buttonTitle('BarChart');
$this->backgroundColor(dark: '#FFFFFF06', light: '#00000006');
$this->padding(top: 30, bottom: 5);
$this->tooltip([]); // https://www.chartjs.org/docs/latest/configuration/tooltip.html#tooltip
$this->scales([]); // https://www.chartjs.org/docs/latest/axes/#axes
$this->legend([]); // https://www.chartjs.org/docs/latest/configuration/legend.html#legend
$this->elements(); // https://www.chartjs.org/docs/latest/configuration/elements.html#elements
}
public function value(Filters $filters): array
{
return [
'labels' => Collection::range(0, 5)->map(fn () => fake()->word()),
'datasets' => Collection::range(0, 5)->map(fn () => [
'data' => Collection::range(0, 5)->map(fn () => fake()->numberBetween(0, 100)),
]),
];
}
}
I tried to use your dashboard and followed your example Code, but I always get this error:
When I analyze the Code in the WidgetController on Line 20, it looks like it does not find the View
Thanks for your Help!
Versions: laravel/framework: 10.48.12 laravel/nova: 4.34.2 digital-creative/nova-dashboard: 1.1.3 digital-creative/chartjs-widget: 1.0.2
My Code: