1
0
forked from poc/pds

adjusted positon of the label in hourly production chart

This commit is contained in:
dhanabalan
2025-06-27 14:31:20 +05:30
parent 04ed10d9e1
commit 82b56c6cc9

View File

@@ -168,16 +168,18 @@ class ItemOverview extends ChartWidget
protected function getOptions(): array protected function getOptions(): array
{ {
return [ return [
'plugins' => [ 'plugins' => [
'datalabels' => [ 'datalabels' => [
'anchor' => 'start', 'anchor' => 'end', // Change to 'end' to align to the right edge of the bar
'color' => '#000', 'align' => 'right', // Align text to the right (optional, for label text alignment)
'font' => [ 'offset' => 3, // Move label to the right by ~11px (≈3mm)
'weight' => 'bold', 'color' => '#000',
], 'font' => [
'formatter' => 'function(value) { return Number(value); }', 'weight' => 'bold',
], ],
'formatter' => 'function(value) { return Number(value); }',
], ],
],
'scales' => [ 'scales' => [
'y' => [ 'y' => [
'beginAtZero' => true, 'beginAtZero' => true,