From 82b56c6cc9bca3aa911852afc5fc6e50eb0acb80 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Fri, 27 Jun 2025 14:31:20 +0530 Subject: [PATCH] adjusted positon of the label in hourly production chart --- app/Filament/Widgets/ItemOverview.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/Filament/Widgets/ItemOverview.php b/app/Filament/Widgets/ItemOverview.php index 21c10f394..9d22fa272 100644 --- a/app/Filament/Widgets/ItemOverview.php +++ b/app/Filament/Widgets/ItemOverview.php @@ -168,16 +168,18 @@ class ItemOverview extends ChartWidget protected function getOptions(): array { return [ - 'plugins' => [ - 'datalabels' => [ - 'anchor' => 'start', - 'color' => '#000', - 'font' => [ - 'weight' => 'bold', - ], - 'formatter' => 'function(value) { return Number(value); }', + 'plugins' => [ + 'datalabels' => [ + 'anchor' => 'end', // Change to 'end' to align to the right edge of the bar + 'align' => 'right', // Align text to the right (optional, for label text alignment) + 'offset' => 3, // Move label to the right by ~11px (≈3mm) + 'color' => '#000', + 'font' => [ + 'weight' => 'bold', ], + 'formatter' => 'function(value) { return Number(value); }', ], + ], 'scales' => [ 'y' => [ 'beginAtZero' => true,