@php use Filament\Support\View\ComponentAttributeBag as FilamentComponentAttributeBag; use Filament\Widgets\View\Components\ChartWidgetComponent; use Illuminate\Contracts\Support\Htmlable; $color = $this->getColor(); $heading = $this->getHeading(); $description = $this->getDescription(); $filters = $this->getFilters(); $isCollapsible = $this->isCollapsible(); $type = $this->getType(); $maxHeight = $this->getMaxHeight(); $hasMaxHeight = filled($maxHeight) && $maxHeight !== '100%'; $isEmpty = $this->isEmpty(); // The chart paints onto a bare ``, which exposes no accessible name, so build a text // alternative from the widget's heading and description (WCAG 1.1.1) for `role="img"` + `aria-label`. $chartAccessibleLabel = trim(implode('. ', array_filter([ $heading instanceof Htmlable ? strip_tags($heading->toHtml()) : $heading, $description instanceof Htmlable ? strip_tags($description->toHtml()) : $description, ], fn ($value): bool => filled($value)))); @endphp @if ($filters || method_exists($this, 'getFiltersSchema')) @if ($filters) @foreach ($filters as $value => $label) @endforeach @endif @if (method_exists($this, 'getFiltersSchema')) {{ $this->getFiltersTriggerAction() }}
{{ $this->getFiltersSchema() }} @if (method_exists($this, 'hasDeferredFilters') && $this->hasDeferredFilters())
{{ $this->getFiltersApplyAction() }} {{ $this->getFiltersResetAction() }}
@endif
@endif
@endif
getPollingInterval()) wire:poll.{{ $pollingInterval }}="updateChartData" @endif @if ($isEmpty) style="display: none" @endif >
color(ChartWidgetComponent::class, $color) ->class([ 'fi-wi-chart-frame', 'fi-wi-chart-canvas-ctn', 'fi-wi-chart-frame-no-aspect-ratio' => $hasMaxHeight, ]) }} > ! $hasMaxHeight, ('max-height: ' . e($maxHeight)) => $hasMaxHeight, ]) >
@if ($isEmpty) @if ($emptyState = $this->getEmptyState()) {{ $emptyState }} @else
$hasMaxHeight, ]) @style([ ('min-height: ' . e($maxHeight)) => $hasMaxHeight, ]) > @if ($emptyStateActions = $this->getEmptyStateActions()) @endif
@endif @endif