Donut Chart

You're browsing the documentation for an old version of MoonShine. Consider upgrading your project to MoonShine 2.x.

Provides the ability to create a donut chart for metric

namespace MoonShine\Resources;
 
use MoonShine\Metrics\DonutChartMetric;
 
class PostResource extends Resource
{
//...
 
public function metrics(): array
{
return [
DonutChartMetric::make('Subscribers')
->values(['CutCode' => 10000, 'Apple' => 9999]),
];
}
 
//...
}