Пример #1
0
 /**
  * RandomDataset [Constructor]
  *
  * @param int    $count       The number of points to create
  * @param double $minimum     The minimum value the random set can be
  * @param double $maximum     The maximum value the random set can be
  * @param bool   $includeZero Whether 0 should be included or not as an X
  *   value, may be omitted, default: false</false>
  */
 function Image_Graph_Dataset_Random($count, $minimum, $maximum, $includeZero = false)
 {
     parent::__construct();
     $i = 0;
     while ($i < $count) {
         $this->addPoint($ixc = $includeZero ? $i : $i + 1, rand($minimum, $maximum));
         $i++;
     }
 }
 /**
  * Image_Graph_SequentialDataset [Constructor]
  *
  * @param array $dataArray Array with data
  */
 function Image_Graph_Dataset_Sequential($dataArray = false)
 {
     parent::__construct();
     if (is_array($dataArray)) {
         reset($dataArray);
         foreach ($dataArray as $value) {
             $this->addPoint($value);
         }
     }
 }
Пример #3
0
 /**
  * Image_Graph_SequentialDataset [Constructor]
  */
 function __construct($dataArray = false)
 {
     parent::__construct();
     if (is_array($dataArray)) {
         reset($dataArray);
         foreach ($dataArray as $value) {
             $this->addPoint($value);
         }
     }
 }