home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / dotproject / lib / jpgraph / src / jpgraph_canvas.php < prev    next >
PHP Script  |  2002-12-11  |  2KB  |  49 lines

  1. <?php
  2. /*=======================================================================
  3. // File:     JPGRAPH_CANVAS.PHP
  4. // Description:    Canvas drawing extension for JpGraph
  5. // Created:     2001-01-08
  6. // Author:    Johan Persson (johanp@aditus.nu)
  7. // Ver:        $Id: jpgraph_canvas.php,v 1.1 2002/12/11 09:41:58 kripper Exp $
  8. //
  9. // License:    This code is released under QPL
  10. // Copyright (C) 2001,2002 Johan Persson
  11. //========================================================================
  12. */
  13.  
  14. //===================================================
  15. // CLASS CanvasGraph
  16. // Description: Creates a simple canvas graph which
  17. // might be used together with the basic Image drawing
  18. // primitives. Useful to auickoly produce some arbitrary
  19. // graphic which benefits from all the functionality in the
  20. // graph liek caching for example. 
  21. //===================================================
  22. class CanvasGraph extends Graph {
  23. //---------------
  24. // CONSTRUCTOR
  25.     function CanvasGraph($aWidth=300,$aHeight=200,$aCachedName="",$timeout=0,$inline=1) {
  26.     $this->Graph($aWidth,$aHeight,$aCachedName,$timeout,$inline);
  27.     }
  28.  
  29. //---------------
  30. // PUBLIC METHODS    
  31.  
  32.     function InitFrame() {
  33.     $this->StrokePlotArea();
  34.     }
  35.  
  36.     // Method description
  37.     function Stroke($aStrokeFileName="") {
  38.     if( $this->texts != null ) {
  39.         for($i=0; $i<count($this->texts); ++$i) {
  40.         $this->texts[$i]->Stroke($this->img);
  41.         }
  42.     }                
  43.     $this->StrokeTitles();
  44.     // Stream the generated picture                    
  45.     $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline,$aStrokeFileName);    
  46.     }
  47. } // Class
  48. /* EOF */
  49. ?>