Hi.
I need replace the columns definition with my own dynamic definition.
LineChart::create(array(
"dataSource"=>$this->DataStore("result_all"),
"columns"=>array(
"D_DESC"=>array(
"type"=>"date"
),
"TOTAL_0"=>array(
"label"=>"EMERGENCIA",
"type"=>"number",
"annotation"=>function($row) {return $row["TOTAL_0"];}
))
));
to
LineChart::create(array(
"dataSource"=>$this->DataStore("result_all"),
"columns"=>$col_graph1
));
This is how I made my array.
foreach ($col_temp as $fila){
$col_graph1[$fila]=array(
"type"=>"number",
"label"=>label($fila),
"annotation"=>function($row) {return number_format($row['.$fila.']);});
}
And this is the result
Array ( [D_DESC] => Array ( [type] => date ) [TOTAL_0] => Array ( [type] => number [label] => Emergencia [annotation] => function($row) {return $row["TOTAL_0"];} ) )
but the function declared for the annotation does not work, write it literally
How should I define it for it to work?
Regards.