[ 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/ -> bargrouped.php (source)

   1  <?php
   2  
   3  require_once 'Horde/Graph/Plot/bar.php';
   4  
   5  /**
   6   * Grouped bar graph implementation for the Horde_Graph package.
   7   *
   8   * $Horde: framework/Graph/Graph/Plot/bargrouped.php,v 1.1.10.4 2006/01/01 21:28:18 jan Exp $
   9   *
  10   * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
  11   *
  12   * See the enclosed file COPYING for license information (LGPL). If you
  13   * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
  14   *
  15   * @author  Chuck Hagenbuch <chuck@horde.org>
  16   * @since   Horde 3.0
  17   * @package Horde_Graph
  18   */
  19  class Horde_Graph_Plot_bargrouped extends Horde_Graph_Plot_bar {
  20  
  21      var $_step = .5;
  22      var $_colors = array();
  23      var $_datasets = array();
  24  
  25      function draw()
  26      {
  27          // Calculate the starting offset for each bar, from which we
  28          // move it over by $this->_step.
  29          $datasets = count($this->_datasets);
  30          $globalOffset = $this->_offset - (($this->_step * ($datasets - 1)) / 2);
  31  
  32          for ($i = 0; $i < $datasets; $i++) {
  33              // Calculate the offset of this set of bars.
  34              $this->_offset = $globalOffset + ($this->_step * $i);
  35  
  36              // Set bar parameters that change per-group.
  37              if (isset($this->_colors[$i])) {
  38                  $this->_color = $this->_colors[$i];
  39              }
  40              $this->_dataset = $this->_datasets[$i];
  41  
  42              // Draw this dataset.
  43              parent::draw();
  44          }
  45      }
  46  
  47  }


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