Last updated 6 months ago
This is the official documentation of the forestadmin/laravel-forestadmin v2+ and forestadmin/symfony-forestadmin PHP agents.
forestadmin/laravel-forestadmin
forestadmin/symfony-forestadmin
Distribution Charts display a pie and should return a plain object.
use ForestAdmin\AgentPHP\DatasourceCustomizer\Context\AgentCustomizationContext; use ForestAdmin\AgentPHP\DatasourceCustomizer\Decorators\Chart\ResultBuilder; $forestAgent->addChart( 'booksByAuthorCountry', fn(AgentCustomizationContext $context, ResultBuilder $resultBuilder) => $resultBuilder->distribution( [ 'validated' => 100, 'rejected' => 100, 'to_validate' => 100, ] ) );