Added proper alignment for process order rejection chart
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 21s
Laravel Larastan / larastan (pull_request) Failing after 6m17s
Laravel Pint / pint (pull_request) Successful in 4m54s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 21s
Laravel Larastan / larastan (pull_request) Failing after 6m17s
Laravel Pint / pint (pull_request) Successful in 4m54s
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Filament\Widgets;
|
|||||||
use App\Models\CharacteristicValue;
|
use App\Models\CharacteristicValue;
|
||||||
use Filament\Widgets\ChartWidget;
|
use Filament\Widgets\ChartWidget;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Filament\Support\RawJs;
|
||||||
|
|
||||||
class ProcessOrderChart extends ChartWidget
|
class ProcessOrderChart extends ChartWidget
|
||||||
{
|
{
|
||||||
@@ -218,22 +219,55 @@ class ProcessOrderChart extends ChartWidget
|
|||||||
return 'bar';
|
return 'bar';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// protected function getOptions(): array
|
||||||
|
// {
|
||||||
|
// return [
|
||||||
|
// 'scales' => [
|
||||||
|
// 'x' => [
|
||||||
|
// 'stacked' => true,
|
||||||
|
// ],
|
||||||
|
// 'y' => [
|
||||||
|
// 'stacked' => true,
|
||||||
|
// 'beginAtZero' => true,
|
||||||
|
// ],
|
||||||
|
// ],
|
||||||
|
// 'plugins' => [
|
||||||
|
// 'legend' => [
|
||||||
|
// 'display' => true,
|
||||||
|
// 'position' => 'top',
|
||||||
|
// ],
|
||||||
|
// ],
|
||||||
|
// ];
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected function getOptions(): array
|
protected function getOptions(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'scales' => [
|
// 'plugins' => [
|
||||||
'x' => [
|
// 'datalabels' => false,
|
||||||
'stacked' => true,
|
// ],
|
||||||
],
|
'plugins' => [
|
||||||
'y' => [
|
'datalabels' => [
|
||||||
'stacked' => true,
|
'anchor' => 'start', // Positions the label relative to the top of the bar
|
||||||
'beginAtZero' => true,
|
'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;
|
||||||
|
}'),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'plugins' => [
|
'scales' => [
|
||||||
'legend' => [
|
'y' => [
|
||||||
'display' => true,
|
'beginAtZero' => true, //Start Y-axis from 0
|
||||||
'position' => 'top',
|
'ticks' => [
|
||||||
|
'stepSize' => 0.5,
|
||||||
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user