[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/Image/Graph/Marker/ -> Bubble.php (source)

   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: Bubble.php,v 1.5 2005/02/21 20:49:50 nosey Exp $
  28   * @link       http://pear.php.net/package/Image_Graph
  29   */
  30  
  31  /**
  32   * Include file Image/Graph/Marker/Circle.php
  33   */
  34  require_once  'Image/Graph/Marker/Circle.php';
  35  
  36  /**
  37   * Display a circle with y-value percentage as radius (require GD2).
  38   *
  39   * This will display a circle centered on the datapoint with a radius calculated
  40   * as a percentage of the maximum value. I.e. the radius depends on the y-value
  41   * of the datapoint
  42   *
  43   * @category   Images
  44   * @package    Image_Graph
  45   * @subpackage Marker
  46   * @author     Jesper Veggerby <pear.nosey@veggerby.dk>
  47   * @copyright  Copyright (C) 2003, 2004 Jesper Veggerby Hansen
  48   * @license    http://www.gnu.org/copyleft/lesser.html  LGPL License 2.1
  49   * @version    Release: 0.7.2
  50   * @link       http://pear.php.net/package/Image_Graph
  51   */
  52  class Image_Graph_Marker_Bubble extends Image_Graph_Marker_Circle
  53  {
  54  
  55      /**
  56       * The radius of the marker when 100%
  57       * @var int
  58       * @access private
  59       */
  60      var $_size100Pct = 40;
  61  
  62      /**
  63       * Sets the maximum radius the marker can occupy
  64       *
  65       * @param int $radius The new Image_Graph_max radius
  66       */
  67      function setMaxRadius($radius)
  68      {
  69          $this->_size100Pct = $radius;
  70      }
  71  
  72      /**
  73       * Draw the marker on the canvas
  74       *
  75       * @param int $x The X (horizontal) position (in pixels) of the marker on
  76       *   the canvas
  77       * @param int $y The Y (vertical) position (in pixels) of the marker on the
  78       *   canvas
  79       * @param array $values The values representing the data the marker 'points'
  80       *   to
  81       * @access private
  82       */
  83      function _drawMarker($x, $y, $values = false)
  84      {
  85          $this->_size = $this->_size100Pct*$values['PCT_MAX_Y']/100;
  86          parent::_drawMarker($x, $y, $values);
  87      }
  88  
  89  }
  90  
  91  ?>


Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7