Hi. I have a problem rendering a graph and a table with data from a query.
The query returns rows that I need in columns for KoolReport render, so I put that rows in an array to get de columns. This is the result array:
$dataSrc = array(
array("category"=>"LargeBus","black"=>100,"blue"=>50),
array("category"=>"Truck","black"=>50,"blue"=>60,"brown"=>30),
array("category"=>"unknown","unknown"=>8000),
array("category"=>"Van","black"=>25,"blue"=>20),
array("category"=>"Vehicle","black"=>110,"blue"=>95,"brown"=>70),
);
The problem is that I haven't all the columns for all the categories and I don't know how to create the params for the chart to get something like I have the categories that not appearing with value 0.
I've create the "columns" array I need to create de chart, with all the columns: "black", "blue", "brown", "unknown", but in "\vendor\koolreport\core\src\widgets\google\Chart.php" I get two errors in line 157: "Undefined index" and "array_merge(): Expected parameter 1 to be an array, null". The code of this line is: $columns[$cKey] = array_merge($meta["columns"][$cKey], $cValue);
I think it could be cause $meta["columns"][$cKey] is empty because the row of $dataSrc hasn't that key and the merge not put $cValue into $columns[$cKey].
I don't know how to resolve or how I have to do this to render $dataSrc.
Thank you.