@php // ----------------------- // Backpack ChartJS Widget // ----------------------- // Uses: // - Backpack\CRUD\app\Http\Controllers\ChartController // - https://github.com/ConsoleTVs/Charts // - https://github.com/chartjs/Chart.js $controller = new $widget['controller']; $chart = $controller->chart; $path = $controller->getLibraryFilePath(); // defaults $widget['wrapper']['class'] = $widget['wrapper']['class'] ?? $widget['wrapperClass'] ?? 'col-sm-6 col-md-4'; @endphp @includeWhen(!empty($widget['wrapper']), 'backpack::widgets.inc.wrapper_start')
@if (isset($widget['content']['header']))
{!! $widget['content']['header'] !!}
@endif
{!! $widget['content']['body'] ?? '' !!}
{!! $chart->container() !!}
@includeWhen(!empty($widget['wrapper']), 'backpack::widgets.inc.wrapper_end') @push('after_scripts') @if (is_array($path)) @foreach ($path as $string) @endforeach @elseif (is_string($path)) @endif {!! $chart->script() !!} @endpush