Hi, i am creating a drilldown based on array data source instead of sql data source because i previously get all the values so that drilldown is fast,which is exactly similar to this example:
This is my code:
\koolreport\drilldown\DrillDown::create(array(
"name"=>"saleDrillDown",
"title"=>"Sale Report",
"levels"=>array(
array(
"title"=>"All Years",
"content"=>function($params,$scope)
{
\koolreport\chartjs\ColumnChart::create(array(
"dataSource"=>$year_sale,
"columns"=>array(
"year",
"First Time User"=>array(
"label"=>"New",
"type"=>"number",
"config"=>array(
"type"=>"bar",//Line chart is draw
)
),
"Repeat User"=>array(
"label"=>"Extended",
"type"=>"number",
"config"=>array(
"type"=>"bar",//Line chart is draw
)
),
),
"options"=>array(
"tooltips"=>array(
"mode"=>"index",
"intersect"=>true,
),
"responsive"=>true,
"maintainAspectRatio"=>false,
),
"clientEvents"=>array(
"itemSelect"=>"function(params){
saleDrillDown.next({year:params.selectedRow[0]});
}",
)
));
}
),
array(
"title"=>function($params,$scope)
{
return "abcd";
},
"content"=>function($params,$scope)
{
\koolreport\chartjs\ColumnChart::create(array(
"title"=>"month",
"dataSource"=>$time_sale,
"height"=>350,
"columns"=>array(
"month",
"First Time User"=>array(
"label"=>"New",
"type"=>"number",
"config"=>array(
"type"=>"bar",//Line chart is draw
)
),
"Repeat User"=>array(
"label"=>"Extended",
"type"=>"number",
"config"=>array(
"type"=>"bar",//Line chart is draw
)
),
),
"stacked"=>true,
"responsive"=>true,
"maintainAspectRatio"=>false,
"options"=>array(
"tooltips"=>array(
"mode"=>"index",
"intersect"=>true,
),
"responsive"=>true,
"maintainAspectRatio"=>false,
)
));
}
)
),
));
however i get this error :
what should i do?