undef HALF_FREQUENCY_SENDING_TO_CLIENT
[ryzomcore.git] / web / public_php / admin / jpgraph / jpgraph_canvas.php
blob05441710695bbf5fa54a5902d8bcf35a04190dae
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 2006/07/07 13:37:14 powles Exp $
8 //
9 // Copyright (c) Aditus Consulting. All rights reserved.
10 //========================================================================
13 //===================================================
14 // CLASS CanvasGraph
15 // Description: Creates a simple canvas graph which
16 // might be used together with the basic Image drawing
17 // primitives. Useful to auickoly produce some arbitrary
18 // graphic which benefits from all the functionality in the
19 // graph liek caching for example.
20 //===================================================
21 class CanvasGraph extends Graph {
22 //---------------
23 // CONSTRUCTOR
24 function CanvasGraph($aWidth=300,$aHeight=200,$aCachedName="",$timeout=0,$inline=1) {
25 $this->Graph($aWidth,$aHeight,$aCachedName,$timeout,$inline);
28 //---------------
29 // PUBLIC METHODS
31 function InitFrame() {
32 $this->StrokePlotArea();
35 // Method description
36 function Stroke($aStrokeFileName="") {
37 if( $this->texts != null ) {
38 for($i=0; $i < count($this->texts); ++$i) {
39 $this->texts[$i]->Stroke($this->img);
42 if( $this->iTables !== null ) {
43 for($i=0; $i < count($this->iTables); ++$i) {
44 $this->iTables[$i]->Stroke($this->img);
47 $this->StrokeTitles();
49 // Should we do any final image transformation
50 if( $this->iImgTrans ) {
51 if( !class_exists('ImgTrans') ) {
52 require_once('jpgraph_imgtrans.php');
55 $tform = new ImgTrans($this->img->img);
56 $this->img->img = $tform->Skew3D($this->iImgTransHorizon,$this->iImgTransSkewDist,
57 $this->iImgTransDirection,$this->iImgTransHighQ,
58 $this->iImgTransMinSize,$this->iImgTransFillColor,
59 $this->iImgTransBorder);
63 // If the filename is given as the special _IMG_HANDLER
64 // then the image handler is returned and the image is NOT
65 // streamed back
66 if( $aStrokeFileName == _IMG_HANDLER ) {
67 return $this->img->img;
69 else {
70 // Finally stream the generated picture
71 $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline,$aStrokeFileName);
72 return true;
75 } // Class
76 /* EOF */