Esempio n. 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::Image_Graph_Dataset_Trivial();
     $i = 0;
     while ($i < $count) {
         $this->addPoint($ixc = $includeZero ? $i : $i + 1, rand($minimum, $maximum));
         $i++;
     }
 }
Esempio n. 2
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 __construct($count, $minimum, $maximum, $includeZero = false)
 {
     parent::__construct();
     $i = 0;
     while ($i < $count) {
         $this->addPoint($ixc = $includeZero ? $i : $i + 1, rand($minimum, $maximum));
         $i++;
     }
 }
 /**
  * Add a point to the dataset
  *
  * @param int $y  The Y value to add, can be omited
  * @param var $ID The ID of the point
  *
  * @return void
  */
 function addPoint($y, $ID = false)
 {
     parent::addPoint($this->count(), $y, $ID);
 }