You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to use your dashboard and followed your example Code, but I always get this error:
"message":"Call to a member function resolveWidgetValue() on null",
"exception":"Error","file":"/Volumes/Work/Code/platreform/backend/vendor/digital-creative/nova-dashboard/src/Http/Controllers/WidgetController.php",
"line": 20,
When I analyze the Code in the WidgetController on Line 20, it looks like it does not find the View
class LeadsDashboard extends Dashboard
{
/** * Get the displayable name of the dashboard. */publicfunctionlabel(): string
{
return'Leads';
}
/** * Get the cards for the dashboard. */publicfunctioncards(): array
{
return [
NovaDashboard::make()
->addView('Leads Example', function (View$view) {
return$view
->icon('window')
->addWidgets([
ExampleBarChartWidget::make(),
])
->addFilters([
DateRangeFilter::make()
->dividerLabel('<>') // control the divider label in between the inputs
->inputType('week') // supports any html input type
->placeholder('From', 'To') // control the placeholder of the inputs
->fromAttributes([ 'min' => 0 ]) // some inputs type like number accepts more attributes like min/max/step etc..
->toAttributes([ 'max' => 100 ])
]);
}),
];
}
}
class ExampleBarChartWidget extends BarChartWidget
{
publicfunctionconfigure(NovaRequest$request): void
{
/** * These set the title and the button on the top-right if there are multiple "tabs" on this view */$this->title('Example BarChart');
$this->buttonTitle('BarChart');
$this->backgroundColor(dark: '#1e293b', light: '#ffffff');
$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
}
publicfunctionvalue(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)),
]),
];
}
}
The text was updated successfully, but these errors were encountered:
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:
The text was updated successfully, but these errors were encountered: