From 72a1eca4008aac44b89400ba7982436706309313 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Fri, 27 Jun 2025 14:44:23 +0530 Subject: [PATCH] Changed data label position of the production line count chart --- app/Filament/Widgets/CumulativeChart.php | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/Filament/Widgets/CumulativeChart.php b/app/Filament/Widgets/CumulativeChart.php index be5b203..92e17a3 100644 --- a/app/Filament/Widgets/CumulativeChart.php +++ b/app/Filament/Widgets/CumulativeChart.php @@ -14,7 +14,7 @@ class CumulativeChart extends ChartWidget protected $listeners = ['cumulativeChart']; - protected static ?string $maxHeight = '350px'; + protected static ?string $maxHeight = '400px'; protected int|string|array $columnSpan = 12; @@ -224,20 +224,20 @@ class CumulativeChart extends ChartWidget // 'plugins' => [ // 'datalabels' => false, // ], - 'plugins' => [ - 'datalabels' => [ - 'anchor' => 'start', - 'align' => 'start', - 'offset' => 4, - 'color' => '#000', - 'font' => [ - 'weight' => 'bold', - ], - 'formatter' => RawJs::make('function(value) { - return value; - }'), + 'plugins' => [ + 'datalabels' => [ + 'anchor' => 'start', // Positions the label relative to the top of the bar + 'align' => 'start', // Aligns the label above the bar + 'offset' => -15, // Adjust if needed (positive moves up, negative moves down) + 'color' => '#000', + 'font' => [ + 'weight' => 'bold', ], + 'formatter' => RawJs::make('function(value) { + return value; + }'), ], + ], 'scales' => [ 'y' => [ 'beginAtZero' => true, //Start Y-axis from 0