[ Index ]
 

Code source de Horde 3.1.3

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

title

Body

[fermer]

/lib/Horde/Graph/Plot/ -> scatter.php (source)

   1  <?php
   2  /**
   3   * Scatter plot implementation for the Horde_Graph package.
   4   *
   5   * $Horde: framework/Graph/Graph/Plot/scatter.php,v 1.3.12.4 2006/01/01 21:28:18 jan Exp $
   6   *
   7   * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
   8   *
   9   * See the enclosed file COPYING for license information (LGPL). If you
  10   * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
  11   *
  12   * @author  Chuck Hagenbuch <chuck@horde.org>
  13   * @since   Horde 3.0
  14   * @package Horde_Graph
  15   */
  16  class Horde_Graph_Plot_scatter {
  17  
  18      var $_graph;
  19      var $_color = 'blue';
  20      var $_shape = 'square';
  21      var $_dataset;
  22  
  23      function Horde_Graph_Plot_scatter(&$graph, $params)
  24      {
  25          $this->_graph = &$graph;
  26  
  27          foreach ($params as $param => $value) {
  28              $key = '_' . $param;
  29              $this->$key = $value;
  30          }
  31      }
  32  
  33      function draw($minY = false)
  34      {
  35          $data = $this->_graph->_data['y'][$this->_dataset];
  36  
  37          $count = count($data);
  38          $verts = array();
  39          for ($i = 0; $i < $count; $i++) {
  40              $x = $i;
  41              if ($minY === false || $data[$i] >= $minY) {
  42                  $y = $data[$i];
  43                  $this->_graph->translate($x, $y);
  44                  $this->_graph->img->brush($x, $y, $this->_color, $this->_shape);
  45              }
  46          }
  47      }
  48  
  49  }


Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7