From 7af18d10dc23084ae8390241c2e9951d530248f7 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Tue, 25 Jan 2011 05:20:28 -0500 Subject: archive some more dead packages --- .../Image/Graph/DataSelector/EveryNthPoint.php | 97 ++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 config/archive/dspam/pear/Image/Graph/DataSelector/EveryNthPoint.php (limited to 'config/archive/dspam/pear/Image/Graph/DataSelector/EveryNthPoint.php') diff --git a/config/archive/dspam/pear/Image/Graph/DataSelector/EveryNthPoint.php b/config/archive/dspam/pear/Image/Graph/DataSelector/EveryNthPoint.php new file mode 100644 index 00000000..62581222 --- /dev/null +++ b/config/archive/dspam/pear/Image/Graph/DataSelector/EveryNthPoint.php @@ -0,0 +1,97 @@ + + * @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/DataSelector.php + */ +require_once 'Image/Graph/DataSelector.php'; + +/** + * Filter out all points except every Nth point. + * + * Use this dataselector if you have a large number of datapoints, but only want to + * show markers for a small number of them, say every 10th. + * + * @category Images + * @package Image_Graph + * @subpackage DataSelector + * @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_DataSelector_EveryNthPoint extends Image_Graph_DataSelector +{ + + /** + * The number of points checked + * @var int + * @access private + */ + var $_pointNum = 0; + + /** + * The number of points between every 'show', default: 10 + * @var int + * @access private + */ + var $_pointInterval = 10; + + /** + * EvertNthPoint [Constructor] + * + * @param int $pointInterval The number of points between every 'show', + * default: 10 + */ + function Image_Graph_DataSelector_EveryNthpoint($pointInterval = 10) + { + parent::Image_Graph_DataSelector(); + $this->_pointInterval = $pointInterval; + } + + /** + * Check if a specified value should be 'selected', ie shown as a marker + * + * @param array $values The values to check + * @return bool True if the Values should cause a marker to be shown, + * false if not + * @access private + */ + function _select($values) + { + $oldPointNum = $this->_pointNum; + $this->_pointNum++; + return (($oldPointNum % $this->_pointInterval) == 0); + } + +} + +?> \ No newline at end of file -- cgit v1.2.3