I have a chart that when I process it in the view by itself renders just fine. Here is the code:
ColumnChart::create(array(
"dataSource"=>$byEvent,
"title"=>"All Events",
"columns"=>array(
"title",
"amount"=>array("label"=>"Amount Collected", "type"=>"number", "prefix"=>"$",
"annotation"=>function($row) {
return "$".number_format($row['amount']);
}),
)
));
Now when I place this same chart inside a drilldown I get an error: Call to a member function countData() on null at libraries/koolreport/packages/chartjs/Chart.php:178
Here is the code as a drilldown:
DrillDown::create(array(
"name"=>"eventDrillDown",
"title"=>"Event Transaction Report",
"levels"=>array(
array(
"Title"=>"All Events",
"content"=>function($params, $scope) {
ColumnChart::create(array(
"dataSource"=>$byEvent,
"title"=>"All Events",
"columns"=>array(
"title",
"amount"=>array("label"=>"Amount Collected", "type"=>"number", "prefix"=>"$",
"annotation"=>function($row) {
return "$".number_format($row['amount']);
}),
)
));
}
))
))
Any ideas of what I am doing wrong here?