Beispiel #1
0
 /**
  * Parses the data to make the pie-chart
  *
  * @return	void
  */
 private function parsePieChartData()
 {
     // get sources
     $sources = BackendAnalyticsModel::getTrafficSourcesGrouped($this->startTimestamp, $this->endTimestamp);
     // init vars
     $graphData = array();
     // loop metrics
     foreach ($sources as $i => $source) {
         // get label
         $label = BL::lbl(SpoonFilter::toCamelCase($source['label']), 'analytics');
         if ($label == '{$lblAnalytics' . SpoonFilter::toCamelCase($source['label']) . '}') {
             $label = $source['label'];
         }
         // build array
         $graphData[$i]['label'] = ucfirst($label);
         $graphData[$i]['value'] = (string) $source['value'];
         $graphData[$i]['percentage'] = (string) $source['percentage'];
     }
     // parse
     $this->tpl->assign('pieGraphData', $graphData);
 }