Hello,
I created a Drilldown in my dashboard. But, when I click in one month, the graph shows me the sentence;
{"panels":{"Page":["
\n
\n
\n
\n
\n
401<\/h1>\n
Unauthorized<\/h4>\n
This is restricted area, please contact admin for access granting.<\/p>\n <\/div>\n <\/div>\n <\/div>\n <\/div>\n<\/div>",null]},"scripts":[]}
This is my code:
class DrillDownDemo extends DrillDown
{
protected function levels()
{
return [
Level::create()
->title("Meses")
->widget(
KWidget::create()
->use(\koolreport\widgets\google\ColumnChart::class)
->dataSource(function($params, $scope){
return AutoMaker::table("pedidos ped")
->selectRaw("extract(month from ped.data_resposta) as mes")
->count("ped.identificacao")->alias("total")
->where("extract(year from ped.data_resposta)",date('Y') )
->where('ped.fk_cliente', 3455)
->groupBy("mes")->run();
})->columns([
"mes"=>["type"=>"string"],
"total"=>["type"=>"number"]
])
),
//Segundo Nivel
Level::create()
->title(function($params){
return "Mes ".$params["mes"];
})
->widget(
KWidget::create()
->use(\koolreport\widgets\google\ColumnChart::class)
->dataSource(function($params, $scope) {
return AutoMaker::table("pedidos ped")
->selectRaw("extract(day from ped.data_resposta) as dia")
->count("ped.identificacao")->alias("total")
->where('ped.fk_cliente', 3455)
->where("extract(year from ped.data_resposta)",date('Y'))
->where("extract(mont from ped.data_resposta)",$params["mes"])
->groupBy("dia")->run();
})
->columns([
"dia"=>[
"type"=>"string"
],
"total"=>[
"type"=>"number",
]
])
),
];
}
I don't use any permissions nether roles in my page.