Changeset 265 for trunk/client/modules/Elezioni/grafici/jpgraph_canvas.php
- Timestamp:
- Apr 13, 2019, 8:05:15 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/modules/Elezioni/grafici/jpgraph_canvas.php
r2 r265 1 1 <?php 2 2 /*======================================================================= 3 // File:JPGRAPH_CANVAS.PHP4 // Description:Canvas drawing extension for JpGraph5 // Created:2001-01-086 // Ver: $Id: jpgraph_canvas.php 781 2006-10-08 08:07:47Z ljp $7 //8 // Copyright (c) Aditus Consulting. All rights reserved.9 //========================================================================10 */3 // File: JPGRAPH_CANVAS.PHP 4 // Description: Canvas drawing extension for JpGraph 5 // Created: 2001-01-08 6 // Ver: $Id: jpgraph_canvas.php 1923 2010-01-11 13:48:49Z ljp $ 7 // 8 // Copyright (c) Asial Corporation. All rights reserved. 9 //======================================================================== 10 */ 11 11 12 12 //=================================================== … … 16 16 // primitives. Useful to auickoly produce some arbitrary 17 17 // graphic which benefits from all the functionality in the 18 // graph liek caching for example. 18 // graph liek caching for example. 19 19 //=================================================== 20 20 class CanvasGraph extends Graph { 21 //---------------22 // CONSTRUCTOR23 function CanvasGraph($aWidth=300,$aHeight=200,$aCachedName="",$timeout=0,$inline=1) {24 $this->Graph($aWidth,$aHeight,$aCachedName,$timeout,$inline);21 //--------------- 22 // CONSTRUCTOR 23 function __construct($aWidth=300,$aHeight=200,$aCachedName="",$timeout=0,$inline=1) { 24 parent::__construct($aWidth,$aHeight,$aCachedName,$timeout,$inline); 25 25 } 26 26 27 //---------------28 // PUBLIC METHODS 27 //--------------- 28 // PUBLIC METHODS 29 29 30 30 function InitFrame() { 31 31 $this->StrokePlotArea(); 32 32 } 33 33 34 34 // Method description 35 35 function Stroke($aStrokeFileName="") { 36 37 38 39 40 } 41 42 43 44 } 45 46 36 if( $this->texts != null ) { 37 for($i=0; $i < count($this->texts); ++$i) { 38 $this->texts[$i]->Stroke($this->img); 39 } 40 } 41 if( $this->iTables !== null ) { 42 for($i=0; $i < count($this->iTables); ++$i) { 43 $this->iTables[$i]->Stroke($this->img); 44 } 45 } 46 $this->StrokeTitles(); 47 47 48 49 50 51 52 53 54 55 48 // If the filename is the predefined value = '_csim_special_' 49 // we assume that the call to stroke only needs to do enough 50 // to correctly generate the CSIM maps. 51 // We use this variable to skip things we don't strictly need 52 // to do to generate the image map to improve performance 53 // a best we can. Therefor you will see a lot of tests !$_csim in the 54 // code below. 55 $_csim = ($aStrokeFileName===_CSIM_SPECIALFILE); 56 56 57 58 59 60 61 57 // We need to know if we have stroked the plot in the 58 // GetCSIMareas. Otherwise the CSIM hasn't been generated 59 // and in the case of GetCSIM called before stroke to generate 60 // CSIM without storing an image to disk GetCSIM must call Stroke. 61 $this->iHasStroked = true; 62 62 63 63 if( !$_csim ) { 64 64 65 // Should we do any final image transformation 66 if( $this->iImgTrans ) { 67 if( !class_exists('ImgTrans') ) { 68 require_once('jpgraph_imgtrans.php'); 69 } 70 71 $tform = new ImgTrans($this->img->img); 72 $this->img->img = $tform->Skew3D($this->iImgTransHorizon,$this->iImgTransSkewDist, 73 $this->iImgTransDirection,$this->iImgTransHighQ, 74 $this->iImgTransMinSize,$this->iImgTransFillColor, 75 $this->iImgTransBorder); 76 } 77 65 // Should we do any final image transformation 66 if( $this->iImgTrans ) { 67 if( !class_exists('ImgTrans',false) ) { 68 require_once('jpgraph_imgtrans.php'); 69 } 78 70 79 // If the filename is given as the special _IMG_HANDLER 80 // then the image handler is returned and the image is NOT 81 // streamed back 82 if( $aStrokeFileName == _IMG_HANDLER ) { 83 return $this->img->img; 84 } 85 else { 86 // Finally stream the generated picture 87 $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline,$aStrokeFileName); 88 return true; 89 } 90 } 71 $tform = new ImgTrans($this->img->img); 72 $this->img->img = $tform->Skew3D($this->iImgTransHorizon,$this->iImgTransSkewDist, 73 $this->iImgTransDirection,$this->iImgTransHighQ, 74 $this->iImgTransMinSize,$this->iImgTransFillColor, 75 $this->iImgTransBorder); 76 } 77 78 79 // If the filename is given as the special _IMG_HANDLER 80 // then the image handler is returned and the image is NOT 81 // streamed back 82 if( $aStrokeFileName == _IMG_HANDLER ) { 83 return $this->img->img; 84 } 85 else { 86 // Finally stream the generated picture 87 $this->cache->PutAndStream($this->img,$this->cache_name,$this->inline,$aStrokeFileName); 88 return true; 89 } 90 } 91 91 } 92 92 } // Class
Note:
See TracChangeset
for help on using the changeset viewer.