public function categoryAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $model = new Admin_Model_DbTable_Category(); $data = $model->getParentCategory(); $jsonArray = array(); $cat = array(); $tot = array(); foreach ($data as $dat) { array_push($cat, $dat['name']); array_push($tot, array("cat", intval($dat['poi_count']), $dat['category_id'])); } $jsonArray['category'] = $cat; $jsonArray['title'] = 'Total Budaya Per Kategori Utama'; $jsonArray['total'] = $tot; $jsonArray['xLabel'] = 'Kategory'; $jsonArray['yLabel'] = 'Jumlah'; echo json_encode($jsonArray); }