Source for file BarPlot.class.php
Documentation is available at BarPlot.class.php 
 * This work is hereby released into the Public Domain.  
 * To view a copy of the public domain dedication,  
 * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to  
 * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.  
require_once dirname(__FILE__ ). "/Plot.class.php";  
 * @package linea21.externals  
   * Labels on your bar plot  
   * Construct a new awBarPlot  
   * @param array $values Some numeric values for Y axis  
   * @param int $identifier Plot identifier  
   * @param int $number Bar plot number  
   * @param int $depth Bar plot depth in pixels  
  function awBarPlot($values, $identifier =  1, $number =  1, $depth =  0) {  
    $this->depth = (int) $depth;  
    $this->grid->hideVertical(TRUE);  
   * This method is not compatible with awBarPlot::setBarPadding()  
   * @param float $left Left padding (between 0 and 1)  
   * @param float $right Right padding (between 0 and 1)  
   * This method is not compatible with awBarPlot::setBarPadding()  
   * @param int $width Bars size (between 0 and 1)  
    $padding =  (1 -  $size) /  2;  
    $this->move->set($x, NULL, $y, NULL);  
   * @param int $space Space in pixels  
   * Change line background color  
   * Change line background gradient  
   * Get the background color or gradient of an element of the component  
   * @return Color, Gradient  
    if($this->xAxisZero and $min <=  0 and $max >=  0) {  
    // Distance between two values on the graph  
    $distance =  $this->xAxis->getDistance(0, 1);  
    $leftPadding =  $this->barPadding->left *  $distance;  
    $rightPadding =  $this->barPadding->right *  $distance;  
    $padding =  $leftPadding +  $rightPadding;  
    $barSize =  ($distance -  $padding -  $space) /  $this->number;  
    $barPosition =  $leftPadding +  $barSize *  ($this->identifier -  1);  
    for($key =  0; $key <  $count; $key++ ) {  
      $value =  $this->datay[$key];  
        $barStop =  $barStart +  $barSize;  
        $t1 =  min($zero->y, $position->y);  
        $t2 =  max($zero->y, $position->y);  
        if(round($t2 -  $t1) ==  0) {  
    foreach($this->datay as $key =>  $value) {  
        $position->y -  $this->depth  
        $this->label->draw($driver, $point, $key);  
  // ça bidouille à fond ici !  
  function drawBar($driver, $p1, $p2) {  
    if(abs($p2->y -  $p1->y) >  1) {  
        $b1 =  $p1->move($size, $size);  
        $b2 =  $p2->move(- 1 *  $size, - 1 *  $size);  
        $driver->filledRectangle(  
 
 
        
       |