I have been messing around with different visualization plugins which allows you to represent data in the form of charts.. and following my previous post, It seems that it is a bit outdated, and out of desperation I looked for other plugins which may offer similar options.
Now, I have realised that googleCharts might have just what I need, and as it turns out, there is a cake googlechart plugin which should be able to do what I need. However, I am having a little bit of trouble understanding how I will implement it.
From what I have seen here and in the plugin doc, it accepts data in the form of an array of results, from which is then iterated, and displaying the fields which match, specified in the columns key. (If I'm not correct, please do explain.)
Otherwise, I am looking for a way I can generate a pie chart using values returned from 3 queries as follows:
$users_donor = $this->User->find('count' , array(
'conditions' => array('User.role' => 'donor')
));
$users_staff = $this->User->find('count' , array(
'conditions' => array('User.role' => 'staff')
));
$users_admin = $this->User->find('count' , array(
'conditions' => array('User.role' => 'admin')
));
Basically I want to show a visual representation of all the current registered users, grouped by their role.. Is there a way I can pass in the latter 3 count values (i.e users_donor
,users_staff
,users_admin
)