I think so... I changed something but still have some problems with it. Below is my code if you could give me a little help with it i would be thankfull.
<?php
//Main.view.php
use \koolreport\drilldown\CustomDrillDown;
CustomDrillDown::create(array(
"name"=>"locationSale",
"subReports"=>array("providers","realizations"),
))
?>
//Main.php
class Main extends \koolreport\KoolReport
{
use \koolreport\core\SubReport;
public function settings()
{
return array(
"subReports"=>array(
"providers"=>CountrySale::class,
"realizations"=>StateSale::class
)
);
}
public function setup()
{
}
}
CountrySale.view.php
<?php
use \koolreport\widgets\google\BarChart;
$drilldown = $this->params["@drilldown"];
BarChart::create(array(
"dataSource"=>$this->dataStore("providers"),
"clientEvents"=>array(
"itemSelect"=>"function(params){
$drilldown.next({state:params.selectedRow[0]});
}"
),
"width"=>"100%",
"columns"=>array(
"NAME"=>array(
"label"=>"name"
),
"productsLack"=>array(
"type"=>"number",
"label"=>"Brak Towaru",
"suffix"=>"%",
)
),
"colorScheme"=>array(
"#de5307",
),
"options"=>array(
"chartArea"=>array(
"height"=>"90%",
"backgroundColor"=>"#fdfdfd"
),
"backgroundColor"=>"#fdfdfd"
),
))
?>
When page loads. I've got first barchart. also in console i've got error:
Uncaught ReferenceError: CustomDrillDown is not defined
When i click on some bar there's:
ncaught TypeError: Cannot read property 'next' of undefined
[...]
I don't know how to manage that. I thought i was going all same that is in the example but i have to miss something. Could you please give me little tip?