* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 * @version CVS: $Id$ * @link http://pear.php.net/package/Image_Graph */ /** * Include file Image/Graph/Dataset/Trivial.php */ require_once 'Image/Graph/Dataset/Trivial.php'; /** * Random data set, points are generated by random. * * This dataset is mostly (if not solely) used for demo-purposes. * * @category Images * @package Image_Graph * @subpackage Dataset * @author Jesper Veggerby * @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 * @version Release: @package_version@ * @link http://pear.php.net/package/Image_Graph */ class Image_Graph_Dataset_Random extends Image_Graph_Dataset_Trivial { /** * 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 */ 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 ++; } } } ?>