Added chart js plugin package and sets static label
This commit is contained in:
@@ -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,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user