Remove Grid from Pie/Doughnut(chart-widget)

It took me a few hours to discover and configure the Pie chart. Because it comes by default with a grid of other sample graphs. I want to contribute, so that other people don't waste the same time I lost. Add the following code to your chart class. protected static ?array $options = [ 'scales' => [ 'y' => [ 'grid' => [ 'display' => false, ], 'ticks' => [ 'display' => false, ] ], 'x' => [ 'grid' => [ 'display' => false, ], 'ticks' => [ 'display' => false, ] ], ], ];
2 Replies
Lietze
Lietzeβ€’4mo ago
lifesaver!
Mercules πŸš€βš‘
I spent a few hours trying to figure this out. Perfect. Thank you.