1
0
forked from poc/pds

Added chart js plugin package and sets static label

This commit is contained in:
dhanabalan
2025-06-27 12:46:29 +05:30
parent fea6573a7a
commit 0fc1852ea2
14 changed files with 6141 additions and 695 deletions

View File

@@ -7,6 +7,7 @@ use App\Models\Line;
use App\Models\Plant;
use DB;
use Filament\Widgets\ChartWidget;
use Illuminate\Support\Js;
class InvoiceChart extends ChartWidget
{
@@ -356,12 +357,43 @@ class InvoiceChart extends ChartWidget
return 'invoice-chart';
}
// protected function getOptions(): array
// {
// return [
// 'scales' => [
// 'y' => [
// 'beginAtZero' => true, //Start Y-axis from 0
// 'ticks' => [
// 'stepSize' => 1,
// ],
// ],
// ],
// ];
// }
protected function getOptions(): array
{
return [
// 'plugins' => [
// 'datalabels' => [
// // 'anchor' => 'start',
// // 'align' => 'start',
// // 'offset' => 1,
// 'anchor' => 'start',
// 'align' => 'start',
// 'offset' => 8,
// 'color' => '#000',
// 'font' => [
// 'weight' => 'bold',
// ],
// 'formatter' => Js::from("function(value) { return Number(value); }"),
// ],
// ],
'plugins' => [
'datalabels' => false, // Disable datalabels plugin properly
],
'scales' => [
'y' => [
'beginAtZero' => true, //Start Y-axis from 0
'beginAtZero' => true,
'ticks' => [
'stepSize' => 1,
],