Added chart js plugin package and sets static label
This commit is contained in:
@@ -8,7 +8,7 @@ use App\Models\GuardPatrolEntry;
|
||||
use Carbon\Carbon;
|
||||
use DB;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Js;
|
||||
|
||||
class GuardPatrolHourlyChart extends ChartWidget
|
||||
{
|
||||
@@ -19,493 +19,6 @@ class GuardPatrolHourlyChart extends ChartWidget
|
||||
protected int|string|array $columnSpan = 12;
|
||||
|
||||
|
||||
// protected function getData(): array
|
||||
// {
|
||||
// $selectedPlant = session('selected_plant');
|
||||
// $selectedDate = session('selected_date');
|
||||
// $selectedGuardName = session('selected_name');
|
||||
// $selectedTime = session('selected_time');
|
||||
// $validSessions = session('valid_sessions', []);
|
||||
|
||||
// // if (empty($selectedTime) || !isset($validSessions[$selectedTime]) || !$validSessions[$selectedTime]) {
|
||||
// // return [];
|
||||
// // }
|
||||
|
||||
// if (!$selectedPlant || !$selectedDate || !$selectedGuardName || empty($selectedTime)) {
|
||||
// return [];
|
||||
// }
|
||||
|
||||
// if (empty($selectedTime) || !isset($validSessions[$selectedTime]) || !$validSessions[$selectedTime])
|
||||
// {
|
||||
// return $this->getInvalidSessionChartData();
|
||||
// }
|
||||
|
||||
|
||||
// $query = GuardPatrolEntry::where('plant_id', $selectedPlant)
|
||||
// ->where('guard_name_id', $selectedGuardName)
|
||||
// ->whereDate('patrol_time', $selectedDate);
|
||||
|
||||
|
||||
// if (!empty($selectedTime)) {
|
||||
// [$startTime, $endTime] = explode(' - ', $selectedTime);
|
||||
// $startDateTime = Carbon::parse($selectedDate . ' ' . $startTime);
|
||||
// $endDateTime = Carbon::parse($selectedDate . ' ' . $endTime);
|
||||
// $query->whereBetween('guard_patrol_entries.patrol_time', [$startDateTime, $endDateTime]);
|
||||
// }
|
||||
|
||||
// // $patrols = $query->orderBy('guard_patrol_entries.patrol_time')->get();
|
||||
// $patrols = $query->orderBy('patrol_time')->get();
|
||||
|
||||
// if ($patrols->count() < 2) {
|
||||
// return [];
|
||||
// }
|
||||
|
||||
// // Get all CheckPointTime records for the plant
|
||||
// $cushioningData = CheckPointTime::where('plant_id', $selectedPlant)
|
||||
// ->orderBy('sequence_number')
|
||||
// ->get(['sequence_number', 'min_cushioning', 'max_cushioning', 'check_point1_id', 'check_point2_id'])
|
||||
// ->keyBy('sequence_number');
|
||||
|
||||
// // Get all unique checkpoint IDs from CheckPointTime
|
||||
// $checkPointIds = collect($cushioningData)
|
||||
// ->flatMap(function ($item) {
|
||||
// return [$item->check_point1_id, $item->check_point2_id];
|
||||
// })
|
||||
// ->unique();
|
||||
|
||||
|
||||
// $checkPointNames = CheckPointName::whereIn('id', $checkPointIds)
|
||||
// ->pluck('name', 'id');
|
||||
|
||||
// $sequenceToName = [];
|
||||
// //$sequenceNumbers = [];
|
||||
// foreach ($cushioningData as $sequenceNumber => $data)
|
||||
// {
|
||||
// $lastNameId = $data->check_point2_id;
|
||||
// $name = $checkPointNames[$lastNameId] ?? null;
|
||||
// if ($name)
|
||||
// {
|
||||
// $sequenceToName[$sequenceNumber] = $name;
|
||||
// //$sequenceNumbers[] = $sequenceNumber;
|
||||
// }
|
||||
// }
|
||||
|
||||
// $numSequences = count($sequenceToName);
|
||||
|
||||
// // Prepare chart data
|
||||
// $intervals = [];
|
||||
// $labels = [];
|
||||
// $colors = [];
|
||||
|
||||
// for ($i = 0; $i < $patrols->count() - 1; $i++)
|
||||
// {
|
||||
// $current = Carbon::parse($patrols[$i]->patrol_time);
|
||||
// $next = Carbon::parse($patrols[$i+1]->patrol_time);
|
||||
// $interval = $next->diffInMinutes($current, true);
|
||||
// $intervals[] = $interval;
|
||||
|
||||
// // if ($next < $current)
|
||||
// // {
|
||||
// // $colors[] = '#ff4c4c'; // Red for out-of-order
|
||||
// // // $intervals[] = $interval;
|
||||
// // $intervals[] = 0;
|
||||
// // $labels[] = "Seq " . ($i + 1);
|
||||
// // continue;
|
||||
// // }
|
||||
|
||||
// $sequenceNumber = ($i % $numSequences) + 1;
|
||||
// $labels[] = "Seq " . ($i + 1);
|
||||
|
||||
// $cushioning = $cushioningData[$sequenceNumber] ?? null;
|
||||
// if (!$cushioning) {
|
||||
// $colors[] = '#cccccc';
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// $min = $cushioning->min_cushioning;
|
||||
// $max = $cushioning->max_cushioning;
|
||||
|
||||
// if ($interval < $min) {
|
||||
// $colors[] = '#ffd700';
|
||||
// } elseif ($interval <= $max) {
|
||||
// $colors[] = '#4caf50';
|
||||
// } else {
|
||||
// $colors[] = '#ff4c4c';
|
||||
// }
|
||||
// }
|
||||
|
||||
// return [
|
||||
// 'labels' => $labels,
|
||||
// 'datasets' => [
|
||||
// [
|
||||
// 'label' => 'Interval (minutes)',
|
||||
// 'data' => $intervals,
|
||||
// 'backgroundColor' => $colors,
|
||||
// 'borderColor' => '#333',
|
||||
// 'borderWidth' => 1,
|
||||
// ],
|
||||
// ],
|
||||
// ];
|
||||
// }
|
||||
|
||||
// protected function getData(): array
|
||||
// {
|
||||
// $selectedPlant = session('selected_plant');
|
||||
// $selectedDate = session('selected_date');
|
||||
// $selectedGuardName = session('selected_name');
|
||||
// $selectedTime = session('selected_time');
|
||||
|
||||
|
||||
// if (!$selectedPlant || !$selectedDate || !$selectedGuardName || empty($selectedTime)) {
|
||||
// return [];
|
||||
// }
|
||||
|
||||
// $query = GuardPatrolEntry::where('plant_id', $selectedPlant)
|
||||
// ->where('guard_name_id', $selectedGuardName)
|
||||
// ->whereDate('patrol_time', $selectedDate);
|
||||
|
||||
// if (!empty($selectedTime)) {
|
||||
// [$startTime, $endTime] = explode(' - ', $selectedTime);
|
||||
// $startDateTime = Carbon::parse($selectedDate . ' ' . $startTime);
|
||||
// $endDateTime = Carbon::parse($selectedDate . ' ' . $endTime);
|
||||
// $query->whereBetween('guard_patrol_entries.patrol_time', [$startDateTime, $endDateTime]);
|
||||
// }
|
||||
|
||||
// $patrols = $query->orderBy('patrol_time')->get();
|
||||
|
||||
// if ($patrols->count() < 2) {
|
||||
// return [];
|
||||
// }
|
||||
|
||||
// // Get all CheckPointTime records for the plant
|
||||
// $checkPointTimes = CheckPointTime::where('plant_id', $selectedPlant)
|
||||
// ->orderBy('sequence_number')
|
||||
// ->get(['sequence_number', 'min_cushioning', 'max_cushioning', 'check_point1_id', 'check_point2_id']);
|
||||
|
||||
// // Build the expected sequence
|
||||
// $expectedSequence = [];
|
||||
// foreach ($checkPointTimes as $row) {
|
||||
// $expectedSequence[] = $row->check_point1_id;
|
||||
// }
|
||||
// if ($checkPointTimes->isNotEmpty()) {
|
||||
// $expectedSequence[] = $checkPointTimes->last()->check_point2_id;
|
||||
// }
|
||||
|
||||
// $intervals = [];
|
||||
// $labels = [];
|
||||
// $colors = [];
|
||||
|
||||
// $cushioningData = $checkPointTimes->keyBy('sequence_number');
|
||||
|
||||
// for ($i = 0; $i < $patrols->count() - 1; $i++) {
|
||||
// $current = Carbon::parse($patrols[$i]->patrol_time);
|
||||
// $next = Carbon::parse($patrols[$i+1]->patrol_time);
|
||||
// $interval = $next->diffInMinutes($current, true);
|
||||
// $intervals[] = $interval;
|
||||
|
||||
// $labels[] = "Seq " . ($i + 1);
|
||||
|
||||
// if ($i < count($expectedSequence)) {
|
||||
// $expectedCheckpoint = $expectedSequence[$i];
|
||||
// $actualCheckpoint = $patrols[$i]->check_point_name_id;
|
||||
// if ($expectedCheckpoint != $actualCheckpoint) {
|
||||
// $colors[] = '#ff4c4c';
|
||||
// continue;
|
||||
// }
|
||||
// } else {
|
||||
// $colors[] = '#ff4c4c';
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// $sequenceNumber = ($i % $checkPointTimes->count()) + 1;
|
||||
// $cushioning = $cushioningData[$sequenceNumber] ?? null;
|
||||
// if (!$cushioning) {
|
||||
// $colors[] = '#cccccc';
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// $min = $cushioning->min_cushioning;
|
||||
// $max = $cushioning->max_cushioning;
|
||||
|
||||
// if ($interval < $min) {
|
||||
// $colors[] = '#ffd700'; // Yellow for too fast
|
||||
// } elseif ($interval <= $max) {
|
||||
// $colors[] = '#4caf50'; // Green for good
|
||||
// } else {
|
||||
// $colors[] = '#ff4c4c'; // Red for too slow
|
||||
// }
|
||||
// }
|
||||
|
||||
// return [
|
||||
// 'labels' => $labels,
|
||||
// 'datasets' => [
|
||||
// [
|
||||
// 'label' => 'Interval (minutes)',
|
||||
// 'data' => $intervals,
|
||||
// 'backgroundColor' => $colors,
|
||||
// 'borderColor' => '#333',
|
||||
// 'borderWidth' => 1,
|
||||
// ],
|
||||
// ],
|
||||
// ];
|
||||
// }
|
||||
|
||||
// protected function getData(): array
|
||||
// {
|
||||
// $selectedPlant = session('selected_plant'); // Or get from request/argument
|
||||
// $selectedDate = session('selected_date'); // Or get from request/argument
|
||||
// $selectedGuardName = session('selected_name'); // Or get from request/argument
|
||||
// $selectedTime = session('selected_time'); // Or get from request/argument
|
||||
|
||||
// // Optional: If you want to avoid sessions entirely, pass these as arguments to the function.
|
||||
// // For now, we'll keep them as session for minimal change.
|
||||
|
||||
// if (!$selectedPlant || !$selectedDate || !$selectedGuardName || empty($selectedTime)) {
|
||||
// return [];
|
||||
// }
|
||||
|
||||
// $query = GuardPatrolEntry::where('plant_id', $selectedPlant)
|
||||
// ->where('guard_name_id', $selectedGuardName)
|
||||
// ->whereDate('patrol_time', $selectedDate);
|
||||
|
||||
// if (!empty($selectedTime)) {
|
||||
// [$startTime, $endTime] = explode(' - ', $selectedTime);
|
||||
// $startDateTime = Carbon::parse($selectedDate . ' ' . $startTime);
|
||||
// $endDateTime = Carbon::parse($selectedDate . ' ' . $endTime);
|
||||
// $query->whereBetween('guard_patrol_entries.patrol_time', [$startDateTime, $endDateTime]);
|
||||
// }
|
||||
|
||||
// $patrols = $query->orderBy('patrol_time')->get();
|
||||
|
||||
// if ($patrols->count() < 2) {
|
||||
// return [];
|
||||
// }
|
||||
|
||||
// // Get all CheckPointTime records for the plant
|
||||
// $checkPointTimes = CheckPointTime::where('plant_id', $selectedPlant)
|
||||
// ->orderBy('sequence_number')
|
||||
// ->get(['sequence_number', 'min_cushioning', 'max_cushioning', 'check_point1_id', 'check_point2_id']);
|
||||
|
||||
// // Build the expected sequence
|
||||
// $expectedSequence = [];
|
||||
// foreach ($checkPointTimes as $row) {
|
||||
// $expectedSequence[] = $row->check_point1_id;
|
||||
// }
|
||||
// if ($checkPointTimes->isNotEmpty()) {
|
||||
// $expectedSequence[] = $checkPointTimes->last()->check_point2_id;
|
||||
// }
|
||||
|
||||
// // Prepare chart data
|
||||
// $intervals = [];
|
||||
// $labels = [];
|
||||
// $colors = [];
|
||||
|
||||
// // Key cushioning data by sequence_number
|
||||
// $cushioningData = $checkPointTimes->keyBy('sequence_number');
|
||||
|
||||
// // Track if any sequence matches
|
||||
// $anySequenceMatches = false;
|
||||
|
||||
// // For each interval (between patrols)
|
||||
// for ($i = 0; $i < $patrols->count() - 1; $i++) {
|
||||
// // Check if the current checkpoint matches the expected sequence
|
||||
// if ($i < count($expectedSequence)) {
|
||||
// $expectedCheckpoint = $expectedSequence[$i];
|
||||
// $actualCheckpoint = $patrols[$i]->check_point_name_id;
|
||||
// if ($expectedCheckpoint == $actualCheckpoint) {
|
||||
// $anySequenceMatches = true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// // If no sequence matches at all, show only "X"
|
||||
// if (!$anySequenceMatches) {
|
||||
// return [
|
||||
// 'labels' => ['X'],
|
||||
// 'datasets' => [
|
||||
// [
|
||||
// 'label' => 'Interval (minutes)',
|
||||
// 'data' => [0],
|
||||
// 'backgroundColor' => ['#ff4c4c'],
|
||||
// 'borderColor' => '#333',
|
||||
// 'borderWidth' => 1,
|
||||
// ],
|
||||
// ],
|
||||
// ];
|
||||
// }
|
||||
|
||||
// // Otherwise, show the intervals as before
|
||||
// for ($i = 0; $i < $patrols->count() - 1; $i++) {
|
||||
// $current = Carbon::parse($patrols[$i]->patrol_time);
|
||||
// $next = Carbon::parse($patrols[$i+1]->patrol_time);
|
||||
// $interval = $next->diffInMinutes($current, true);
|
||||
// $intervals[] = $interval;
|
||||
|
||||
// $labels[] = "Seq " . ($i + 1);
|
||||
|
||||
// // Check if the current checkpoint matches the expected sequence
|
||||
// if ($i < count($expectedSequence)) {
|
||||
// $expectedCheckpoint = $expectedSequence[$i];
|
||||
// $actualCheckpoint = $patrols[$i]->check_point_name_id;
|
||||
// if ($expectedCheckpoint != $actualCheckpoint) {
|
||||
// $colors[] = '#ff4c4c';
|
||||
// continue;
|
||||
// }
|
||||
// } else {
|
||||
// $colors[] = '#ff4c4c';
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// // If sequence is correct, apply cushioning logic
|
||||
// $sequenceNumber = ($i % $checkPointTimes->count()) + 1;
|
||||
// $cushioning = $cushioningData[$sequenceNumber] ?? null;
|
||||
// if (!$cushioning) {
|
||||
// $colors[] = '#cccccc';
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// $min = $cushioning->min_cushioning;
|
||||
// $max = $cushioning->max_cushioning;
|
||||
|
||||
// if ($interval < $min) {
|
||||
// $colors[] = '#ffd700';
|
||||
// } elseif ($interval <= $max) {
|
||||
// $colors[] = '#4caf50';
|
||||
// } else {
|
||||
// $colors[] = '#ff4c4c';
|
||||
// }
|
||||
// }
|
||||
|
||||
// return [
|
||||
// 'labels' => $labels,
|
||||
// 'datasets' => [
|
||||
// [
|
||||
// 'label' => 'Interval (minutes)',
|
||||
// 'data' => $intervals,
|
||||
// 'backgroundColor' => $colors,
|
||||
// 'borderColor' => '#333',
|
||||
// 'borderWidth' => 1,
|
||||
// ],
|
||||
// ],
|
||||
// ];
|
||||
// }
|
||||
|
||||
// protected function getData(): array
|
||||
// {
|
||||
// $selectedPlant = session('selected_plant');
|
||||
// $selectedDate = session('selected_date');
|
||||
// $selectedGuardName = session('selected_name');
|
||||
// $selectedTime = session('selected_time');
|
||||
|
||||
// if (!$selectedPlant || !$selectedDate || !$selectedGuardName || empty($selectedTime)) {
|
||||
// return [];
|
||||
// }
|
||||
|
||||
// $query = GuardPatrolEntry::where('plant_id', $selectedPlant)
|
||||
// ->where('guard_name_id', $selectedGuardName)
|
||||
// ->whereDate('patrol_time', $selectedDate);
|
||||
|
||||
// if (!empty($selectedTime)) {
|
||||
// [$startTime, $endTime] = explode(' - ', $selectedTime);
|
||||
// $startDateTime = Carbon::parse($selectedDate . ' ' . $startTime);
|
||||
// $endDateTime = Carbon::parse($selectedDate . ' ' . $endTime);
|
||||
// $query->whereBetween('guard_patrol_entries.patrol_time', [$startDateTime, $endDateTime]);
|
||||
// }
|
||||
|
||||
// $patrols = $query->orderBy('patrol_time')->get();
|
||||
|
||||
// if ($patrols->count() < 2) {
|
||||
// return [];
|
||||
// }
|
||||
|
||||
// // Get all CheckPointTime records for the plant
|
||||
// $checkPointTimes = CheckPointTime::where('plant_id', $selectedPlant)
|
||||
// ->orderBy('sequence_number')
|
||||
// ->get(['sequence_number', 'min_cushioning', 'max_cushioning', 'check_point1_id', 'check_point2_id']);
|
||||
|
||||
// // Build the expected sequence
|
||||
// $expectedSequence = [];
|
||||
// foreach ($checkPointTimes as $row) {
|
||||
// $expectedSequence[] = $row->check_point1_id;
|
||||
// }
|
||||
// if ($checkPointTimes->isNotEmpty()) {
|
||||
// $expectedSequence[] = $checkPointTimes->last()->check_point2_id;
|
||||
// }
|
||||
|
||||
// // Prepare chart data
|
||||
// $intervals = [];
|
||||
// $labels = [];
|
||||
// $colors = [];
|
||||
// $cushioningData = $checkPointTimes->keyBy('sequence_number');
|
||||
|
||||
// // Track the current position in the expected sequence
|
||||
// $currentSeqIndex = 0;
|
||||
// $anySequenceMatches = false;
|
||||
|
||||
// for ($i = 0; $i < $patrols->count() - 1; $i++) {
|
||||
// $current = Carbon::parse($patrols[$i]->patrol_time);
|
||||
// $next = Carbon::parse($patrols[$i+1]->patrol_time);
|
||||
// $interval = $next->diffInMinutes($current, true);
|
||||
// $intervals[] = $interval;
|
||||
|
||||
// $labels[] = "Seq " . ($i + 1);
|
||||
|
||||
// // Check if current patrol's checkpoint matches the next expected
|
||||
// if ($currentSeqIndex < count($expectedSequence) && $patrols[$i]->check_point_name_id == $expectedSequence[$currentSeqIndex]) {
|
||||
// $currentSeqIndex++;
|
||||
// $anySequenceMatches = true;
|
||||
// // Apply cushioning logic for valid sequence
|
||||
// $sequenceNumber = ($currentSeqIndex - 1) % $checkPointTimes->count() + 1;
|
||||
// $cushioning = $cushioningData[$sequenceNumber] ?? null;
|
||||
// if (!$cushioning) {
|
||||
// $colors[] = '#cccccc';
|
||||
// continue;
|
||||
// }
|
||||
// $min = $cushioning->min_cushioning;
|
||||
// $max = $cushioning->max_cushioning;
|
||||
// if ($interval < $min) {
|
||||
// $colors[] = '#ffd700';
|
||||
// } elseif ($interval <= $max) {
|
||||
// $colors[] = '#4caf50';
|
||||
// } else {
|
||||
// $colors[] = '#ff4c4c';
|
||||
// }
|
||||
// } else {
|
||||
// // Out of order: mark as red
|
||||
// $colors[] = '#ff4c4c';
|
||||
// }
|
||||
// }
|
||||
|
||||
// // If no sequence matches at all, show only "X"
|
||||
// if (!$anySequenceMatches) {
|
||||
// return [
|
||||
// 'labels' => ['X'],
|
||||
// 'datasets' => [
|
||||
// [
|
||||
// 'label' => 'Interval (minutes)',
|
||||
// 'data' => [0],
|
||||
// 'backgroundColor' => ['#ff4c4c'],
|
||||
// 'borderColor' => '#333',
|
||||
// 'borderWidth' => 1,
|
||||
// ],
|
||||
// ],
|
||||
// ];
|
||||
// }
|
||||
|
||||
// return [
|
||||
// 'labels' => $labels,
|
||||
// 'datasets' => [
|
||||
// [
|
||||
// 'label' => 'Interval (minutes)',
|
||||
// 'data' => $intervals,
|
||||
// 'backgroundColor' => $colors,
|
||||
// 'borderColor' => '#333',
|
||||
// 'borderWidth' => 1,
|
||||
// ],
|
||||
// ],
|
||||
// ];
|
||||
// }
|
||||
|
||||
protected function getData(): array
|
||||
{
|
||||
$selectedPlant = session('selected_plant');
|
||||
@@ -567,7 +80,9 @@ class GuardPatrolHourlyChart extends ChartWidget
|
||||
for ($i = 0; $i < $patrols->count() - 1; $i++) {
|
||||
$current = Carbon::parse($patrols[$i]->patrol_time);
|
||||
$next = Carbon::parse($patrols[$i+1]->patrol_time);
|
||||
$interval = $next->diffInMinutes($current, true);
|
||||
// $interval = $next->diffInMinutes($current, true);
|
||||
$diffInSeconds = $next->floatDiffInRealSeconds($current, true); // get float seconds
|
||||
$interval = round($diffInSeconds / 60, 2);
|
||||
$intervals[] = $interval;
|
||||
|
||||
$labels[] = "Seq " . ($i + 1);
|
||||
@@ -630,6 +145,7 @@ class GuardPatrolHourlyChart extends ChartWidget
|
||||
protected function getOptions(): array
|
||||
{
|
||||
return [
|
||||
|
||||
'scales' => [
|
||||
'y' => [
|
||||
'beginAtZero' => true, //Start Y-axis from 0
|
||||
@@ -638,25 +154,46 @@ class GuardPatrolHourlyChart extends ChartWidget
|
||||
],
|
||||
],
|
||||
],
|
||||
'plugins' => [
|
||||
'datalabels' => [
|
||||
'anchor' => 'start',
|
||||
'align' => 'end',
|
||||
'color' => '#000',
|
||||
'font' => [
|
||||
'weight' => 'bold',
|
||||
],
|
||||
//'formatter' => Js::raw('function(value) { return Number(value).toFixed(2) + " min"; }'),
|
||||
//'formatter' => 'function(value) { return Number(value).toFixed(2) + " min"; }',
|
||||
'formatter' => Js::from("function(value) { return Number(value).toFixed(2) + ' min'; }"),
|
||||
//'formatter' => Js::from(new \Illuminate\Support\Stringable('function(value) { return Number(value).toFixed(2) + " min"; }')),
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
// protected function getOptions(): array
|
||||
// {
|
||||
// return [
|
||||
// 'plugins' => [
|
||||
// 'datalabels' => [
|
||||
// 'anchor' => 'end',
|
||||
// 'align' => 'top',
|
||||
// 'color' => '#000',
|
||||
// 'font' => [
|
||||
// 'weight' => 'bold',
|
||||
// ],
|
||||
// 'formatter' => \Illuminate\Support\Js::from("function(value) { return value + ' min'; }"),
|
||||
// ],
|
||||
// ],
|
||||
// ];
|
||||
// }
|
||||
// protected function getOptions(): array
|
||||
// {
|
||||
// return json_decode(json_encode([
|
||||
// 'plugins' => [
|
||||
// 'datalabels' => [
|
||||
// 'anchor' => 'end',
|
||||
// 'align' => 'start',
|
||||
// 'offset' => 4,
|
||||
// 'color' => '#000',
|
||||
// 'font' => [
|
||||
// 'weight' => 'bold',
|
||||
// ],
|
||||
// 'formatter' => null, // temporarily set null
|
||||
// ],
|
||||
// ],
|
||||
// 'scales' => [
|
||||
// 'y' => [
|
||||
// 'beginAtZero' => true,
|
||||
// ],
|
||||
// ],
|
||||
// ]), true);
|
||||
// }
|
||||
|
||||
|
||||
protected function getType(): string
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user