[ Index ]
 

Code source de phpMyVisites 2.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/core/include/graphs/ -> PmvGraph.class.php (source)

   1  <?php
   2  /* 
   3   * phpMyVisites : website statistics and audience measurements
   4   * Copyright (C) 2002 - 2006
   5   * http://www.phpmyvisites.net/ 
   6   * phpMyVisites is free software (license GNU/GPL)
   7   * Authors : phpMyVisites team
   8  */
   9  
  10  // $Id: PmvGraph.class.php 202 2007-01-18 04:08:48Z matthieu_ $
  11  
  12  class PmvGraph
  13  {
  14      var $title;
  15  
  16  	function PmvGraph( $width, $height )
  17      {    
  18          $this->width = $width;
  19          $this->height = $height;
  20          $this->graph = new Graph($width, $height);
  21          $this->fontPath = FONTS_PATH.Lang::getFontName();
  22          if(!is_file($this->fontPath))
  23          {
  24              $this->fontPath = FONTS_PATH . $GLOBALS['defaultFont'];
  25          }
  26          $this->font8 = new TTFFont( $this->fontPath, 7);
  27          $this->font9 = new TTFFont( $this->fontPath, 8);
  28          $this->font10 = new TTFFont( $this->fontPath, 9);
  29          $this->font16 = new TTFFont( $this->fontPath, 15);
  30      }
  31      
  32  	function process( )
  33      {
  34          if(DEBUG)
  35          {
  36              $this->graph->setTiming(TRUE);
  37          }
  38          $this->graph->setAntiAliasing(TRUE);
  39          $this->graph->border->setColor( new Color ( 98, 123, 163 ));
  40          $this->graph->shadow->setSize(1);
  41          $this->graph->shadow->setPosition( SHADOW_RIGHT_BOTTOM );
  42          $this->graph->shadow->smooth(TRUE);
  43          $this->graph->shadow->setColor(new Color(83, 104, 138));
  44      }
  45      
  46  	function setPmvTitle( &$o )
  47      {
  48          $o->title->set($this->title);
  49          $o->title->move(0, -6);
  50          $o->title->setFont($this->font16);
  51          $o->title->setColor(new Color(0, 0, 165, 10));
  52  
  53      }
  54      
  55  	function setPmvPadding( &$o )
  56      {
  57          $o->setPadding(35, 15, 40, 25);
  58      }
  59      
  60  	function setPmvBackgroundGradient( &$o )
  61      {
  62          $o->setBackgroundGradient(
  63              new LinearGradient(
  64                  new Color(241, 241, 241),
  65                  new Color(255, 255, 255),
  66                  0
  67              )
  68          );
  69      }
  70      
  71  	function setPmvBarGradient( &$o )
  72      {
  73          $o->setBarGradient(
  74              new LinearGradient(
  75                  new Color(255, 165, 0),
  76                  new Color(255, 207, 94),
  77                  0
  78              )
  79          );
  80      }
  81      
  82  	function setPmvLabelProperties( &$o, &$y )
  83      {
  84          $o->label->set( $y );
  85          $o->label->move(0, -5);
  86          $o->label->setFont(new TTFFont( $this->fontPath, 10));
  87          $o->label->setColor(new Color( 0, 0, 139));
  88          $o->label->setAngle(0);
  89          $o->label->setAlign(NULL, LABEL_TOP);
  90          $o->label->setPadding(3, 1, 0, 6);
  91      }
  92      
  93  	function setPmvBarShadowProperties( &$o )
  94      {
  95          $o->barShadow->setSize(0);
  96          $o->barShadow->setPosition(SHADOW_RIGHT_TOP);
  97          $o->barShadow->setColor(new Color(180, 180, 180));
  98          $o->barShadow->smooth(TRUE);
  99      }
 100  
 101  	function setPmvBarBorderProperties( &$o )
 102      {
 103          $o->barBorder->setColor(new Color(0, 0, 0));
 104      }
 105      
 106  	function setPmvBarSize( &$o )
 107      {
 108          $o->setBarSize( 0.5 );
 109      }
 110      
 111  	function setPmvGroupProperties( &$o )
 112      {
 113          $o->setSize(0.8, 1);
 114          $o->setCenter(0.41, 0.5);
 115          $o->setPadding(35, 26, 40, 27);
 116          $o->setSpace(2, 2);
 117  
 118          $o->grid->setType(LINE_DASHED);
 119          $o->grid->hideVertical(TRUE);
 120          $o->grid->setBackgroundColor(new White);
 121  
 122          $o->axis->left->setColor(new Blue);
 123          $o->axis->left->label->setFont($this->font9);
 124  
 125          $o->axis->bottom->label->setFont($this->font9);
 126          $o->axis->bottom->label->setPadding(0, 0, 0, -12);
 127  //        $o->axis->bottom->label->setAlign(NULL, LABEL_TOP);
 128  
 129          $o->legend->setPosition(1.22, 0.2);
 130          $o->legend->setTextFont($this->font9);
 131          $o->legend->setSpace(10);
 132          
 133      }
 134  	function draw()
 135      {
 136          $this->graph->draw();
 137      }
 138  }
 139  
 140  ?>


Généré le : Mon Nov 26 14:10:01 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics