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 / Plot / Dot.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  3.1 KB  |  99 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 Plot
  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: Dot.php,v 1.11 2005/11/27 22:21:16 nosey Exp $
  28.  * @link       http://pear.php.net/package/Image_Graph
  29.  */
  30.  
  31. /**
  32.  * Include file Image/Graph/Plot.php
  33.  */
  34. require_once 'Image/Graph/Plot.php';
  35.  
  36. /**
  37.  * Dot / scatter chart (only marker).
  38.  *
  39.  * This plot type only displays a {@link Image_Graph_Marker} for the datapoints.
  40.  * The marker must explicitly be defined using {@link Image_Graph_Plot::
  41.  * setMarker()}.
  42.  *
  43.  * @category   Images
  44.  * @package    Image_Graph
  45.  * @subpackage Plot
  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_Plot_Dot extends Image_Graph_Plot
  53. {
  54.  
  55.     /**
  56.      * Perform the actual drawing on the legend.
  57.      *
  58.      * @param int $x0 The top-left x-coordinate
  59.      * @param int $y0 The top-left y-coordinate
  60.      * @param int $x1 The bottom-right x-coordinate
  61.      * @param int $y1 The bottom-right y-coordinate
  62.      * @access private
  63.      */
  64.     function _drawLegendSample($x0, $y0, $x1, $y1)
  65.     {
  66.         if (isset($this->_marker)) {
  67.             $key = key($this->_dataset);
  68.             $samplePoint = $this->_dataset[$key]->_nearby();
  69.             $this->_marker->_drawMarker(($x0 + $x1) / 2, ($y0 + $y1) / 2, $samplePoint);
  70.         }
  71.     }
  72.  
  73.     /**
  74.      * Output the plot
  75.      *
  76.      * @return bool Was the output 'good' (true) or 'bad' (false).
  77.      * @access private
  78.      */
  79.     function _done()
  80.     {
  81.         if (Image_Graph_Plot::_done() === false) {
  82.             return false;
  83.         }
  84.  
  85.         $this->_canvas->startGroup(get_class($this) . '_' . $this->_title);
  86.  
  87.         $this->_clip(true);
  88.                 
  89.         $this->_drawMarker();
  90.         
  91.         $this->_clip(false);
  92.         
  93.         $this->_canvas->endGroup();
  94.         
  95.         return true;
  96.     }
  97. }
  98.  
  99. ?>