1
0
forked from poc/pds

Changed data label position of the production line count chart

This commit is contained in:
dhanabalan
2025-06-27 14:44:23 +05:30
parent 82b56c6cc9
commit 72a1eca400

View File

@@ -14,7 +14,7 @@ class CumulativeChart extends ChartWidget
protected $listeners = ['cumulativeChart']; protected $listeners = ['cumulativeChart'];
protected static ?string $maxHeight = '350px'; protected static ?string $maxHeight = '400px';
protected int|string|array $columnSpan = 12; protected int|string|array $columnSpan = 12;
@@ -224,20 +224,20 @@ class CumulativeChart extends ChartWidget
// 'plugins' => [ // 'plugins' => [
// 'datalabels' => false, // 'datalabels' => false,
// ], // ],
'plugins' => [ 'plugins' => [
'datalabels' => [ 'datalabels' => [
'anchor' => 'start', 'anchor' => 'start', // Positions the label relative to the top of the bar
'align' => 'start', 'align' => 'start', // Aligns the label above the bar
'offset' => 4, 'offset' => -15, // Adjust if needed (positive moves up, negative moves down)
'color' => '#000', 'color' => '#000',
'font' => [ 'font' => [
'weight' => 'bold', 'weight' => 'bold',
],
'formatter' => RawJs::make('function(value) {
return value;
}'),
], ],
'formatter' => RawJs::make('function(value) {
return value;
}'),
], ],
],
'scales' => [ 'scales' => [
'y' => [ 'y' => [
'beginAtZero' => true, //Start Y-axis from 0 'beginAtZero' => true, //Start Y-axis from 0