Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
Yes, it is possible. I guess you have known how to calculate the percentage of each sale to the total (using AggregatedColumn and CalculatedColumn combined) so let say you have had 3 columns: person, sale_amount and sale_percentage, in order to display both values in the chart, you need use the formatValue settings:
ColumnChart::create(array(
"columns"=>array(
"person",
"sale_amount"=>array(
...
"formatValue"=>function($value,$row)
{
return '$'.$row["sale_amount"].' - '.$row["sale_percent"].'%';
}
)
)
))
Hope that helps.
Perfect !
And last question : When I add an extra bar on the view file like this below, the value display well, but the percent display INF. Do you know why ?
$sum_row = array(
"Ccial"=>"Napsis",
"PO"=>$this->dataStore("PO_marge")->sum("PO")
);
$data = $this->dataStore("PO_marge")->data(); // <-- get data from store
array_push($data,$sum_row);
$this->dataStore("PO_marge")->data($data); //<--Push back data to store
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo