Hi, I am new to koolreport. My question, how can I populate a Bar Chart as the example image below. through MySQL?
My PHP Code so far:
protected function setup()
{
$this->src("players-db")
->query("SELECT PState, PRole, COUNT(*) as P_Role_Count FROM p_data GROUP BY PState ORDER BY PState asc ")
->pipe($this->dataStore("result"));
})
<?php
\koolreport\widgets\google\ColumnChart::create(array(
"title"=>"Players Data",
"dataSource"=>$this->dataStore("result"),
"columns"=>array(
"PState"=>array(
"label"=>"State",
"type"=>"string"
),
"P_Role_Count"=>array(
"label"=>"Roles",
"type"=>"number"
)
),
"options"=>array(
"isStacked"=>true
)
));
?>
My DB:
The Bar Chart generated not as expected
Any helps are appreciated. Thanks!