[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/telephonie/stats/graph/ -> barmoy.class.php (source)

   1  <?PHP
   2  /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   *
   4   * This program is free software; you can redistribute it and/or modify
   5   * it under the terms of the GNU General Public License as published by
   6   * the Free Software Foundation; either version 2 of the License, or
   7   * (at your option) any later version.
   8   *
   9   * This program is distributed in the hope that it will be useful,
  10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12   * GNU General Public License for more details.
  13   *
  14   * You should have received a copy of the GNU General Public License
  15   * along with this program; if not, write to the Free Software
  16   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17   *
  18   * $Id: barmoy.class.php,v 1.1 2005/02/09 16:00:10 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/stats/graph/barmoy.class.php,v $
  20   *
  21   */
  22  
  23  require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/graph/graph.class.php");
  24  
  25  class GraphBarMoy extends DolibarrGraph {
  26  
  27    Function GraphBarMoy($DB, $file)
  28    {
  29      $this->db = $DB;
  30      $this->file = $file;
  31      $this->bgcolor = "#DEE7EC";
  32      $this->barcolor = "green";
  33      $this->client = 0;
  34      $this->showframe = true;
  35    }
  36    
  37    Function GraphDraw($file, $datas, $labels, $moys)
  38    {
  39      // Create the graph. These two calls are always required
  40  
  41      $height = 240;
  42      $width = 320;
  43  
  44      if ($this->width <> $width && $this->width > 0)
  45        $width = $this->width;
  46  
  47      if ($this->height <> $height && $this->height > 0)
  48        $height = $this->height;
  49  
  50      $graph = new Graph($width, $height,"auto");    
  51      $graph->SetScale("textlin");
  52  
  53      $graph->yaxis->scale->SetGrace(20);
  54  
  55      $graph->SetFrame($this->showframe);
  56      
  57      $graph->img->SetMargin(40,20,20,40);
  58      
  59      $b2plot = new BarPlot($datas);
  60  
  61      $b2plot->SetFillColor($this->barcolor);
  62      
  63      $graph->xaxis->scale->SetGrace(20);
  64  
  65      $LabelAngle = 45;
  66      if ($this->LabelAngle <> $LabelAngle && $this->LabelAngle > 0)
  67        $LabelAngle = $this->LabelAngle;
  68  
  69      $graph->xaxis->SetLabelAngle($LabelAngle);
  70  
  71      $graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,8);
  72  
  73      
  74      $b1plot = new BarPlot($moys);
  75      $b1plot->SetFillColor("gray");
  76      
  77      $gbplot = new GroupBarPlot(array($b2plot,$b1plot));
  78  
  79      $graph->Add($gbplot);
  80      
  81      $graph->title->Set($this->titre);
  82      
  83      $graph->title->SetFont(FF_VERDANA,FS_NORMAL);
  84  
  85      $graph->yaxis->title->SetFont(FF_FONT2);
  86      $graph->xaxis->title->SetFont(FF_FONT1);
  87      
  88      $graph->xaxis->SetTickLabels($labels);
  89      
  90      // Display the graph
  91      
  92      $graph->img->SetImgFormat("png");
  93      $graph->Stroke($file);
  94    }
  95  }   
  96  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics