Initial Commit of AgileBill Open Source
This commit is contained in:
103
includes/pear/Image/Graph/DataPreprocessor/Array.php
Normal file
103
includes/pear/Image/Graph/DataPreprocessor/Array.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* LICENSE: This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or (at your
|
||||
* option) any later version. This library is distributed in the hope that it
|
||||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
|
||||
* General Public License for more details. You should have received a copy of
|
||||
* the GNU Lesser General Public License along with this library; if not, write
|
||||
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
* 02111-1307 USA
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Graph
|
||||
* @subpackage DataPreprocessor
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version CVS: $Id: Array.php,v 1.6 2005/08/24 20:35:59 nosey Exp $
|
||||
* @link http://pear.php.net/package/Image_Graph
|
||||
*/
|
||||
|
||||
/**
|
||||
* Include file Image/Graph/DataPreprocessor.php
|
||||
*/
|
||||
require_once 'Image/Graph/DataPreprocessor.php';
|
||||
|
||||
/**
|
||||
* Format data as looked up in an array.
|
||||
*
|
||||
* ArrayData is useful when a numercal value is to be translated to
|
||||
* something thats cannot directly be calculated from this value, this could for
|
||||
* example be a dataset meant to plot population of various countries. Since x-
|
||||
* values are numerical and they should really be country names, but there is no
|
||||
* linear correlation between the number and the name, we use an array to 'map'
|
||||
* the numbers to the name, i.e. $array[0] = 'Denmark'; $array[1] = 'Sweden';
|
||||
* ..., where the indexes are the numerical values from the dataset. This is NOT
|
||||
* usefull when the x-values are a large domain, i.e. to map unix timestamps to
|
||||
* date-strings for an x-axis. This is because the x-axis will selecte arbitrary
|
||||
* values for labels, which would in principle require the ArrayData to hold
|
||||
* values for every unix timestamp. However ArrayData can still be used to solve
|
||||
* such a situation, since one can use another value for X-data in the dataset
|
||||
* and then map this (smaller domain) value to a date. That is we for example
|
||||
* instead of using the unix-timestamp we use value 0 to represent the 1st date,
|
||||
* 1 to represent the next date, etc.
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Graph
|
||||
* @subpackage DataPreprocessor
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @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_DataPreprocessor_Array extends Image_Graph_DataPreprocessor
|
||||
{
|
||||
|
||||
/**
|
||||
* The data label array
|
||||
* @var array
|
||||
* @access private
|
||||
*/
|
||||
var $_dataArray;
|
||||
|
||||
/**
|
||||
* Image_Graph_ArrayData [Constructor].
|
||||
*
|
||||
* @param array $array The array to use as a lookup table
|
||||
*/
|
||||
function Image_Graph_DataPreprocessor_Array($array)
|
||||
{
|
||||
parent::Image_Graph_DataPreprocessor();
|
||||
$this->_dataArray = $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the value
|
||||
*
|
||||
* @param var $value The value to process/format
|
||||
* @return string The processed value
|
||||
* @access private
|
||||
*/
|
||||
function _process($value)
|
||||
{
|
||||
if ((is_array($this->_dataArray)) && (isset ($this->_dataArray[$value]))) {
|
||||
return $this->_dataArray[$value];
|
||||
} else {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
66
includes/pear/Image/Graph/DataPreprocessor/Currency.php
Normal file
66
includes/pear/Image/Graph/DataPreprocessor/Currency.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* LICENSE: This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or (at your
|
||||
* option) any later version. This library is distributed in the hope that it
|
||||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
|
||||
* General Public License for more details. You should have received a copy of
|
||||
* the GNU Lesser General Public License along with this library; if not, write
|
||||
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
* 02111-1307 USA
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Graph
|
||||
* @subpackage DataPreprocessor
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version CVS: $Id: Currency.php,v 1.6 2005/08/24 20:35:59 nosey Exp $
|
||||
* @link http://pear.php.net/package/Image_Graph
|
||||
*/
|
||||
|
||||
/**
|
||||
* Include file Image/Graph/DataPreprocessor/Formatted.php
|
||||
*/
|
||||
require_once 'Image/Graph/DataPreprocessor/Formatted.php';
|
||||
|
||||
/**
|
||||
* Format data as a currency.
|
||||
*
|
||||
* Uses the {@link Image_Graph_DataPreprocessor_Formatted} to represent the
|
||||
* values as a currency, i.e. 10 => <20> 10.00
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Graph
|
||||
* @subpackage DataPreprocessor
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @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_DataPreprocessor_Currency extends Image_Graph_DataPreprocessor_Formatted
|
||||
{
|
||||
|
||||
/**
|
||||
* Image_Graph_CurrencyData [Constructor].
|
||||
*
|
||||
* @param string $currencySymbol The symbol representing the currency
|
||||
*/
|
||||
function Image_Graph_DataPreprocessor_Currency($currencySymbol)
|
||||
{
|
||||
parent::Image_Graph_DataPreprocessor_Formatted("$currencySymbol %0.2f");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
90
includes/pear/Image/Graph/DataPreprocessor/Date.php
Normal file
90
includes/pear/Image/Graph/DataPreprocessor/Date.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* LICENSE: This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or (at your
|
||||
* option) any later version. This library is distributed in the hope that it
|
||||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
|
||||
* General Public License for more details. You should have received a copy of
|
||||
* the GNU Lesser General Public License along with this library; if not, write
|
||||
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
* 02111-1307 USA
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Graph
|
||||
* @subpackage DataPreprocessor
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version CVS: $Id: Date.php,v 1.6 2005/08/24 20:35:59 nosey Exp $
|
||||
* @link http://pear.php.net/package/Image_Graph
|
||||
*/
|
||||
|
||||
/**
|
||||
* Include file Image/Graph/DataPreprocessor.php
|
||||
*/
|
||||
require_once 'Image/Graph/DataPreprocessor.php';
|
||||
|
||||
/**
|
||||
* Formats Unix timestamp as a date using specified format.
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Graph
|
||||
* @subpackage DataPreprocessor
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @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_DataPreprocessor_Date extends Image_Graph_DataPreprocessor
|
||||
{
|
||||
|
||||
/**
|
||||
* The format of the Unix time stamp.
|
||||
* See <a href = 'http://www.php.net/manual/en/function.date.php'>PHP
|
||||
* Manual</a> for a description
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $_format;
|
||||
|
||||
/**
|
||||
* Create a DateData preprocessor [Constructor]
|
||||
*
|
||||
* @param string $format See {@link http://www.php.net/manual/en/function.date.php
|
||||
* PHP Manual} for a description
|
||||
*/
|
||||
function Image_Graph_DataPreprocessor_Date($format)
|
||||
{
|
||||
parent::Image_Graph_DataPreprocessor();
|
||||
$this->_format = $format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the value
|
||||
*
|
||||
* @param var $value The value to process/format
|
||||
* @return string The processed value
|
||||
* @access private
|
||||
*/
|
||||
function _process($value)
|
||||
{
|
||||
if (!$value) {
|
||||
return false;
|
||||
} else {
|
||||
return date($this->_format, $value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
90
includes/pear/Image/Graph/DataPreprocessor/Formatted.php
Normal file
90
includes/pear/Image/Graph/DataPreprocessor/Formatted.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* LICENSE: This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or (at your
|
||||
* option) any later version. This library is distributed in the hope that it
|
||||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
|
||||
* General Public License for more details. You should have received a copy of
|
||||
* the GNU Lesser General Public License along with this library; if not, write
|
||||
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
* 02111-1307 USA
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Graph
|
||||
* @subpackage DataPreprocessor
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version CVS: $Id: Formatted.php,v 1.6 2005/08/24 20:35:59 nosey Exp $
|
||||
* @link http://pear.php.net/package/Image_Graph
|
||||
*/
|
||||
|
||||
/**
|
||||
* Include file Image/Graph/DataPreprocessor.php
|
||||
*/
|
||||
require_once 'Image/Graph/DataPreprocessor.php';
|
||||
|
||||
/**
|
||||
* Format data using a (s)printf pattern.
|
||||
*
|
||||
* This method is useful when data must displayed using a simple (s) printf
|
||||
* pattern as described in the {@link http://www.php. net/manual/en/function.
|
||||
* sprintf.php PHP manual}
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Graph
|
||||
* @subpackage DataPreprocessor
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @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_DataPreprocessor_Formatted extends Image_Graph_DataPreprocessor
|
||||
{
|
||||
|
||||
/**
|
||||
* A (s)printf format string.
|
||||
* See {@link http://www.php.net/manual/en/function.sprintf.php PHP Manual}
|
||||
* for a description
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $_format;
|
||||
|
||||
/**
|
||||
* Create a (s)printf format data preprocessor
|
||||
*
|
||||
* @param string $format See {@link http://www.php.net/manual/en/function.sprintf.php
|
||||
* PHP Manual} for a description
|
||||
*/
|
||||
function Image_Graph_DataPreprocessor_Formatted($format)
|
||||
{
|
||||
parent::Image_Graph_DataPreprocessor();
|
||||
$this->_format = $format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the value
|
||||
*
|
||||
* @param var $value The value to process/format
|
||||
* @return string The processed value
|
||||
* @access private
|
||||
*/
|
||||
function _process($value)
|
||||
{
|
||||
return sprintf($this->_format, $value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
92
includes/pear/Image/Graph/DataPreprocessor/Function.php
Normal file
92
includes/pear/Image/Graph/DataPreprocessor/Function.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* LICENSE: This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or (at your
|
||||
* option) any later version. This library is distributed in the hope that it
|
||||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
|
||||
* General Public License for more details. You should have received a copy of
|
||||
* the GNU Lesser General Public License along with this library; if not, write
|
||||
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
* 02111-1307 USA
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Graph
|
||||
* @subpackage DataPreprocessor
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version CVS: $Id: Function.php,v 1.6 2005/08/24 20:35:59 nosey Exp $
|
||||
* @link http://pear.php.net/package/Image_Graph
|
||||
*/
|
||||
|
||||
/**
|
||||
* Include file Image/Graph/DataPreprocessor.php
|
||||
*/
|
||||
require_once 'Image/Graph/DataPreprocessor.php';
|
||||
|
||||
/**
|
||||
* Formatting a value using a userdefined function.
|
||||
*
|
||||
* Use this method to convert/format a value to a 'displayable' lable using a (perhaps)
|
||||
* more complex function. An example could be (not very applicable though) if one would
|
||||
* need for values to be displayed on the reverse order, i.e. 1234 would be displayed as
|
||||
* 4321, then this method can solve this by creating the function that converts the value
|
||||
* and use the FunctionData datapreprocessor to make Image_Graph use this function.
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Graph
|
||||
* @subpackage DataPreprocessor
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @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_DataPreprocessor_Function extends Image_Graph_DataPreprocessor
|
||||
{
|
||||
|
||||
/**
|
||||
* The name of the PHP function
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $_dataFunction;
|
||||
|
||||
/**
|
||||
* Create a FunctionData preprocessor
|
||||
*
|
||||
* @param string $function The name of the PHP function to use as
|
||||
* a preprocessor, this function must take a single parameter and return a
|
||||
* formatted version of this parameter
|
||||
*/
|
||||
function Image_Graph_DataPreprocessor_Function($function)
|
||||
{
|
||||
parent::Image_Graph_DataPreprocessor();
|
||||
$this->_dataFunction = $function;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the value
|
||||
*
|
||||
* @param var $value The value to process/format
|
||||
* @return string The processed value
|
||||
* @access private
|
||||
*/
|
||||
function _process($value)
|
||||
{
|
||||
$function = $this->_dataFunction;
|
||||
return $function ($value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
89
includes/pear/Image/Graph/DataPreprocessor/NumberText.php
Normal file
89
includes/pear/Image/Graph/DataPreprocessor/NumberText.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* LICENSE: This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or (at your
|
||||
* option) any later version. This library is distributed in the hope that it
|
||||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
|
||||
* General Public License for more details. You should have received a copy of
|
||||
* the GNU Lesser General Public License along with this library; if not, write
|
||||
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
* 02111-1307 USA
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Graph
|
||||
* @subpackage DataPreprocessor
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version CVS: $Id: NumberText.php,v 1.6 2005/08/24 20:35:59 nosey Exp $
|
||||
* @link http://pear.php.net/package/Image_Graph
|
||||
*/
|
||||
|
||||
/**
|
||||
* Include file Image/Graph/DataPreprocessor.php
|
||||
*/
|
||||
require_once 'Image/Graph/DataPreprocessor.php';
|
||||
|
||||
/**
|
||||
* Formatting a number as its written in languages supported by Numbers_Words.
|
||||
*
|
||||
* Used to display values as text, i.e. 123 is displayed as one hundred and twenty three.
|
||||
* Requires Numbers_Words
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Graph
|
||||
* @subpackage DataPreprocessor
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @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_DataPreprocessor_NumberText extends Image_Graph_DataPreprocessor
|
||||
{
|
||||
|
||||
/**
|
||||
* The language identifier
|
||||
* @var string
|
||||
* @access private
|
||||
*/
|
||||
var $_language;
|
||||
|
||||
/**
|
||||
* Image_Graph_NumberText [Constructor].
|
||||
*
|
||||
* Supported languages see {@link http://pear.php.net/package/Numbers_Words Numbers_Words}
|
||||
*
|
||||
* @param string $langugage The language identifier for the language.
|
||||
*/
|
||||
function Image_Graph_DataPreprocessor_NumberText($language = 'en_US')
|
||||
{
|
||||
parent::Image_Graph_DataPreprocessor();
|
||||
$this->_language = $language;
|
||||
require_once 'Numbers/Words.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the value
|
||||
*
|
||||
* @param var $value The value to process/format
|
||||
* @return string The processed value
|
||||
* @access private
|
||||
*/
|
||||
function _process($value)
|
||||
{
|
||||
return Numbers_Words::toWords($value, $this->_language);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
79
includes/pear/Image/Graph/DataPreprocessor/RomanNumerals.php
Normal file
79
includes/pear/Image/Graph/DataPreprocessor/RomanNumerals.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* LICENSE: This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or (at your
|
||||
* option) any later version. This library is distributed in the hope that it
|
||||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
|
||||
* General Public License for more details. You should have received a copy of
|
||||
* the GNU Lesser General Public License along with this library; if not, write
|
||||
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
* 02111-1307 USA
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Graph
|
||||
* @subpackage DataPreprocessor
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version CVS: $Id: RomanNumerals.php,v 1.6 2005/08/24 20:35:59 nosey Exp $
|
||||
* @link http://pear.php.net/package/Image_Graph
|
||||
*/
|
||||
|
||||
/**
|
||||
* Include file Image/Graph/DataPreprocessor.php
|
||||
*/
|
||||
require_once 'Image/Graph/DataPreprocessor.php';
|
||||
|
||||
/**
|
||||
* Formatting a value as a roman numerals.
|
||||
*
|
||||
* Values are formatted as roman numeral, i.e. 1 = I, 2 = II, 9 = IX, 2004 = MMIV.
|
||||
* Requires Numbers_Roman
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Graph
|
||||
* @subpackage DataPreprocessor
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @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_DataPreprocessor_RomanNumerals extends Image_Graph_DataPreprocessor
|
||||
{
|
||||
|
||||
/**
|
||||
* Create a RomanNumerals preprocessor
|
||||
*
|
||||
* See {@link http://pear.php.net/package/Numbers_Roman Numbers_Roman}
|
||||
*/
|
||||
function Image_Graph_DataPreprocessor_RomanNumerals()
|
||||
{
|
||||
parent::Image_Graph_DataPreprocessor();
|
||||
include_once 'Numbers/Roman.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the value
|
||||
*
|
||||
* @param var $value The value to process/format
|
||||
* @return string The processed value
|
||||
* @access private
|
||||
*/
|
||||
function _process($value)
|
||||
{
|
||||
return Numbers_Roman::toNumeral($value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
67
includes/pear/Image/Graph/DataPreprocessor/Sequential.php
Normal file
67
includes/pear/Image/Graph/DataPreprocessor/Sequential.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Image_Graph - PEAR PHP OO Graph Rendering Utility.
|
||||
*
|
||||
* PHP versions 4 and 5
|
||||
*
|
||||
* LICENSE: This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or (at your
|
||||
* option) any later version. This library is distributed in the hope that it
|
||||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
|
||||
* General Public License for more details. You should have received a copy of
|
||||
* the GNU Lesser General Public License along with this library; if not, write
|
||||
* to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
* 02111-1307 USA
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Graph
|
||||
* @subpackage DataPreprocessor
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @copyright Copyright (C) 2003, 2004 Jesper Veggerby Hansen
|
||||
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
|
||||
* @version CVS: $Id: Sequential.php,v 1.5 2005/02/21 20:49:50 nosey Exp $
|
||||
* @link http://pear.php.net/package/Image_Graph
|
||||
*/
|
||||
|
||||
/**
|
||||
* Include file Image/Graph/DataPreprocessor/Array.php
|
||||
*/
|
||||
require_once 'Image/Graph/DataPreprocessor/Array.php';
|
||||
|
||||
/**
|
||||
* Formatting values using a sequential data label array, ie. returning the
|
||||
* 'next label' when asked for any label.
|
||||
*
|
||||
* @category Images
|
||||
* @package Image_Graph
|
||||
* @subpackage DataPreprocessor
|
||||
* @author Jesper Veggerby <pear.nosey@veggerby.dk>
|
||||
* @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_DataPreprocessor_Sequential extends Image_Graph_DataPreprocessor_Array
|
||||
{
|
||||
|
||||
/**
|
||||
* Process the value
|
||||
*
|
||||
* @param var $value The value to process/format
|
||||
* @return string The processed value
|
||||
* @access private
|
||||
*/
|
||||
function _process($value)
|
||||
{
|
||||
list ($id, $value) = each($this->_dataArray);
|
||||
return $value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user