Exemplo n.º 1
0
 /**
  * Plot the data on screen
  */
 public function plot($debug = false)
 {
     $graph = null;
     $graph['element'] = $this->getElement();
     // if the graph is a Line, Bar or Area add the axis
     if ("Line" == $this->getType() || ("Area" == $this->getType() || "Bar" == $this->getType())) {
         $this->getYkeysIndexes();
         $this->convertData();
         $graph['xkey'] = $this->getXkey();
         $graph['ykeys'] = $this->getYkeys();
     }
     $graph['labels'] = $this->getLabels();
     $graph['data'] = $this->getData();
     $graph['parseTime'] = $this->getParseTime();
     foreach ($this->getOptions() as $option => $value) {
         $graph[$option] = $value;
     }
     $jsondata = json_encode($graph);
     if ($debug) {
         Zend_Debug::dump(Shineisp_Commons_Utilities::jsonBeautifier($jsondata));
     }
     return $this->createJs($jsondata);
 }