SpiceChart: dynamic width + horizontal scroll for many Rohstoffe
Deploy / deploy (push) Successful in 17s
Deploy / deploy (push) Successful in 17s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
8f7af41513
commit
a85afbc93a
2 files changed
+7
No files matched your search
@@ -19,6 +19,8 @@ class SpiceChart extends ApexChartWidget
|
||||
$data = [];
|
||||
$labels = [];
|
||||
|
||||
$count = $spices->count();
|
||||
|
||||
foreach ($spices as $spice) {
|
||||
if ($spice->unit === 'grams') {
|
||||
$data[] = round($spice->quantity / 1000, 2);
|
||||
@@ -39,6 +41,7 @@ class SpiceChart extends ApexChartWidget
|
||||
'chart' => [
|
||||
'type' => 'bar',
|
||||
'height' => 300,
|
||||
'width' => max(600, $count * 120),
|
||||
],
|
||||
'series' => [
|
||||
[
|
||||
|
||||
@@ -46,6 +46,10 @@ class UserPanelProvider extends PanelProvider
|
||||
NavigationGroup::make('Ressourcen'),
|
||||
NavigationGroup::make('CRM'),
|
||||
])
|
||||
->renderHook(
|
||||
PanelsRenderHook::HEAD_END,
|
||||
fn () => new HtmlString('<style>.filament-apex-charts-chart-container:has(#spiceChart){overflow-x:auto;}</style>')
|
||||
)
|
||||
->renderHook(
|
||||
PanelsRenderHook::SIDEBAR_FOOTER,
|
||||
fn () => new HtmlString(
|
||||
|
||||
Reference in new issue
Block a user