KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Chartjs click event #1324

Closed Mike Carroll opened this topic on on Feb 27, 2020 - 4 comments

Mike Carroll commented on Feb 27, 2020

Hello,

I have a \koolreport\chartjs\ColumnChart working, however I want to create a custom click event on a selected bar value which will open a new window. How do I go about adding in a itemselect or click function for a particular column. I don't want to use the SubReport or DrillDown functions.

Thanks.

Mike Carroll commented on Feb 27, 2020

In playing with the examples it appears that adding the options for "clientEvents" is only working for Google Charts. It was my understanding this was also suppose to work for ChartJS but it isn't working for me. Is this correct?

Mike Carroll commented on Feb 27, 2020

Quick update. Upon further playing, adding in just a clientEvents by itself didn't work, however adding in the subsequent "options" part made it work under Chrome and Firefox. However, under Safari it still does not work.

"clientEvents"=>array(
                            "itemSelect"=>"function(params){
                                console.log(params);
                                console.log(js_array);
                                alert(params.selectedRow[0]);
                                alert(params.selectedLabel);
                                alert(params.selectedColumnIndex);
                                alert(js_array[params.selectedColumnIndex-1]);
                            }"),
                "options"=>array(
        			"legend"=>array("position"=>"top",
        					"width" => "100%",
        					"maxLines"=> "50"
        						)
    ),
KoolReport commented on Feb 28, 2020

Thank you for letting us know the issue. So in summary, the event of chartjs does not work on Safari, am I correct. I will escalate to dev.team to further investigate on the issue.

Mike Carroll commented on Mar 9, 2020

Sorry for the delay, correct it does not work in Safari.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None