Ejemplo n.º 1
0
 /**
  * Format data from the main report
  * @return void
  */
 public function formatData()
 {
     foreach ($this->ga->report['totalsForAllResults'] as $key => $value) {
         $this->results[$key]['name'] = strtoupper($this->ga->getName($key));
         $this->results[$key]['value'] = intval($value);
     }
 }
Ejemplo n.º 2
0
 /**
  * Set a serie for the current loaded report
  * @return void
  */
 public function addSerie()
 {
     $serie = $row = array();
     foreach ($this->ga->report["rows"] as $key => $value) {
         // Convert date in javascript format
         $date = strtotime($value[0]) * 1000;
         if (empty($serie)) {
             // Create entries for each requested metrics
             $serie['begin'] = $date;
             $serie['name'] = strtoupper($this->ga->getName($this->getProperty('metrics', null)));
             $serie['data'] = array();
         }
         $row[] = $date;
         $row[] = intval($value[1]);
         array_push($serie['data'], $row);
         $row = array();
     }
     $this->series[] = $serie;
 }