#Show Resource page when click on doughnut chart segment
3 messages · Page 1 of 1 (latest)
Here is my code:
protected function getType(): string
{
return 'doughnut';
}
protected function getOptions(): array
{
return [
'scales' => [
'x' => [
'display' => false,
],
'y' => [
'display' => false,
],
],
'plugins' => [
'legend' => [
'onClick' => 'handleClick',
]
]
];
}
public function handleClick($segmentIndex): void
{
dd( 'i am clicked!!! ');
// $statuses = ['not_launched', 'in_progress', 'finished'];
// $status = $statuses[$segmentIndex];
// $url = ProjProgResource::getUrl('index', [
// 'status' => $status,
// ]);
// redirect($url)->send();
}