Show Resource page when click on doughnut chart segment
How can I Show Resource page when click on doughnut chart segment?
1 Reply
Here is my code:
I couldn't get any reaction when I clicked on the segment.Any help or suggestions !?
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();
}
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();
}