Hi,

I'm using this open flash chart helper to generate graph based on the
values in the database

http://bakery.cakephp.org/articles/view/flashcharthelper-version-3

But i can't get the chart to show up with my current codes. But it did
showed up when i do "$flashChart->setData(array(1,2,4,8));" So it's
not a problem of missing or misplaced helper files. The problem is the
code. I want to display the graph with x-axis as months(distinct) and
y-axis as the the total cost for each month.

My codes,

controller:

$this->set('datamonths',$this->Finance->find('all', array('fields' =>
array('DISTINCT MONTH(Finance.created) AS created','SUM(Finance.cost)
AS cost'),'order' =>'created','group'=>'created')));

view:

echo $flashChart->begin();

$flashChart->setData($datamonths, '{n}.cost','{n}.created');

$flashChart->setLegend('x','Month');
$flashChart->setLegend('y','Expenditure', '{color:#AA0aFF;font-size:
20px;}');

$flashChart->axis('x',array('tick_height' => 5,'3d' => -20),array
('vertical' => true));

$flashChart->axis('y',array('range' => array(0,10000,1000)));

echo $flashChart->chart();
echo $flashChart->render();

Please help!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to