home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / Image / Graph / Marker.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  3.6 KB  |  123 lines

  1. <?php
  2.  
  3. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  4.  
  5. /**
  6.  * Image_Graph - PEAR PHP OO Graph Rendering Utility.
  7.  *
  8.  * PHP versions 4 and 5
  9.  *
  10.  * LICENSE: This library is free software; you can redistribute it and/or modify
  11.  * it under the terms of the GNU Lesser General Public License as published by
  12.  * the Free Software Foundation; either version 2.1 of the License, or (at your
  13.  * option) any later version. This library is distributed in the hope that it
  14.  * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  15.  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
  16.  * General Public License for more details. You should have received a copy of
  17.  * the GNU Lesser General Public License along with this library; if not, write
  18.  * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  19.  * 02111-1307 USA
  20.  *
  21.  * @category   Images
  22.  * @package    Image_Graph
  23.  * @subpackage Marker
  24.  * @author     Jesper Veggerby <pear.nosey@veggerby.dk>
  25.  * @copyright  Copyright (C) 2003, 2004 Jesper Veggerby Hansen
  26.  * @license    http://www.gnu.org/copyleft/lesser.html  LGPL License 2.1
  27.  * @version    CVS: $Id: Marker.php,v 1.8 2005/02/21 20:49:47 nosey Exp $
  28.  * @link       http://pear.php.net/package/Image_Graph
  29.  */
  30.  
  31. /**
  32.  * Include file Image/Graph/Plotarea/Element.php
  33.  */
  34. require_once 'Image/Graph/Plotarea/Element.php';
  35.  
  36. /**
  37.  * Data point marker.
  38.  *
  39.  * The data point marker is used for marking the datapoints on a graph with some
  40.  * visual label, fx. a cross, a text box with the value or an icon.
  41.  *
  42.  * @category   Images
  43.  * @package    Image_Graph
  44.  * @subpackage Marker
  45.  * @author     Jesper Veggerby <pear.nosey@veggerby.dk>
  46.  * @copyright  Copyright (C) 2003, 2004 Jesper Veggerby Hansen
  47.  * @license    http://www.gnu.org/copyleft/lesser.html  LGPL License 2.1
  48.  * @version    Release: 0.7.2
  49.  * @link       http://pear.php.net/package/Image_Graph
  50.  * @abstract
  51.  */
  52. class Image_Graph_Marker extends Image_Graph_Plotarea_Element
  53. {
  54.  
  55.     /**
  56.      * Secondary marker
  57.      * @var Marker
  58.      * @access private
  59.      */
  60.     var $_secondaryMarker = false;
  61.  
  62.     /**
  63.      * The 'size' of the marker, the meaning depends on the specific Marker
  64.      * implementation
  65.      * @var int
  66.      * @access private
  67.      */
  68.     var $_size = 6;
  69.  
  70.     /**
  71.      * Set the 'size' of the marker
  72.      *
  73.      * @param int $size The 'size' of the marker, the meaning depends on the
  74.      *   specific Marker implementation
  75.      */
  76.     function setSize($size)
  77.     {
  78.         $this->_size = $size;
  79.     }
  80.  
  81.     /**
  82.      * Set the secondary marker
  83.      *
  84.      * @param Marker $secondaryMarker The secondary marker
  85.      */
  86.     function setSecondaryMarker(& $secondaryMarker)
  87.     {
  88.         $this->_secondaryMarker =& $secondaryMarker;
  89.         $this->_secondaryMarker->_setParent($this);
  90.     }
  91.  
  92.     /**
  93.      * Draw the marker on the canvas
  94.      *
  95.      * @param int $x The X (horizontal) position (in pixels) of the marker on
  96.      *   the canvas
  97.      * @param int $y The Y (vertical) position (in pixels) of the marker on the
  98.      *   canvas
  99.      * @param array $values The values representing the data the marker 'points'
  100.      *   to
  101.      * @access private
  102.      */
  103.     function _drawMarker($x, $y, $values = false)
  104.     {
  105.         if (is_a($this->_secondaryMarker, 'Image_Graph_Marker')) {
  106.             $this->_secondaryMarker->_drawMarker($x, $y, $values);
  107.         }
  108.     }
  109.  
  110.     /**
  111.      * Output to the canvas
  112.      *
  113.      * @return bool Was the output 'good' (true) or 'bad' (false).
  114.      * @access private
  115.      */
  116.     function _done()    
  117.     {
  118.         return true;
  119.     }
  120.  
  121. }
  122.  
  123. ?>