/tags/v1.0-aigle/composants/statistiques/lib/jpgraph_text.inc.php |
---|
New file |
0,0 → 1,302 |
<?php |
//======================================================================= |
// File: JPGRAPH_TEXT.INC.PHP |
// Description: Class to handle text as object in the graph. |
// The low level text layout engine is handled by the GD class |
// Created: 2001-01-08 (Refactored to separate file 2008-08-01) |
// Ver: $Id: jpgraph_text.inc.php 1844 2009-09-26 17:05:31Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
//=================================================== |
// CLASS Text |
// Description: Arbitrary text object that can be added to the graph |
//=================================================== |
class Text { |
public $t,$margin=0; |
public $x=0,$y=0,$halign="left",$valign="top",$color=array(0,0,0); |
public $hide=false, $dir=0; |
public $iScalePosY=null,$iScalePosX=null; |
public $iWordwrap=0; |
public $font_family=FF_FONT1,$font_style=FS_NORMAL,$font_size=12; |
protected $boxed=false; // Should the text be boxed |
protected $paragraph_align="left"; |
protected $icornerradius=0,$ishadowwidth=3; |
protected $fcolor='white',$bcolor='black',$shadow=false; |
protected $iCSIMarea='',$iCSIMalt='',$iCSIMtarget='',$iCSIMWinTarget=''; |
private $iBoxType = 1; // Which variant of filled box around text we want |
//--------------- |
// CONSTRUCTOR |
// Create new text at absolute pixel coordinates |
function __construct($aTxt="",$aXAbsPos=0,$aYAbsPos=0) { |
if( ! is_string($aTxt) ) { |
JpGraphError::RaiseL(25050);//('First argument to Text::Text() must be s atring.'); |
} |
$this->t = $aTxt; |
$this->x = round($aXAbsPos); |
$this->y = round($aYAbsPos); |
$this->margin = 0; |
} |
//--------------- |
// PUBLIC METHODS |
// Set the string in the text object |
function Set($aTxt) { |
$this->t = $aTxt; |
} |
// Alias for Pos() |
function SetPos($aXAbsPos=0,$aYAbsPos=0,$aHAlign="left",$aVAlign="top") { |
//$this->Pos($aXAbsPos,$aYAbsPos,$aHAlign,$aVAlign); |
$this->x = $aXAbsPos; |
$this->y = $aYAbsPos; |
$this->halign = $aHAlign; |
$this->valign = $aVAlign; |
} |
function SetScalePos($aX,$aY) { |
$this->iScalePosX = $aX; |
$this->iScalePosY = $aY; |
} |
// Specify alignment for the text |
function Align($aHAlign,$aVAlign="top",$aParagraphAlign="") { |
$this->halign = $aHAlign; |
$this->valign = $aVAlign; |
if( $aParagraphAlign != "" ) |
$this->paragraph_align = $aParagraphAlign; |
} |
// Alias |
function SetAlign($aHAlign,$aVAlign="top",$aParagraphAlign="") { |
$this->Align($aHAlign,$aVAlign,$aParagraphAlign); |
} |
// Specifies the alignment for a multi line text |
function ParagraphAlign($aAlign) { |
$this->paragraph_align = $aAlign; |
} |
// Specifies the alignment for a multi line text |
function SetParagraphAlign($aAlign) { |
$this->paragraph_align = $aAlign; |
} |
function SetShadow($aShadowColor='gray',$aShadowWidth=3) { |
$this->ishadowwidth=$aShadowWidth; |
$this->shadow=$aShadowColor; |
$this->boxed=true; |
} |
function SetWordWrap($aCol) { |
$this->iWordwrap = $aCol ; |
} |
// Specify that the text should be boxed. fcolor=frame color, bcolor=border color, |
// $shadow=drop shadow should be added around the text. |
function SetBox($aFrameColor=array(255,255,255),$aBorderColor=array(0,0,0),$aShadowColor=false,$aCornerRadius=4,$aShadowWidth=3) { |
if( $aFrameColor === false ) { |
$this->boxed=false; |
} |
else { |
$this->boxed=true; |
} |
$this->fcolor=$aFrameColor; |
$this->bcolor=$aBorderColor; |
// For backwards compatibility when shadow was just true or false |
if( $aShadowColor === true ) { |
$aShadowColor = 'gray'; |
} |
$this->shadow=$aShadowColor; |
$this->icornerradius=$aCornerRadius; |
$this->ishadowwidth=$aShadowWidth; |
} |
function SetBox2($aFrameColor=array(255,255,255),$aBorderColor=array(0,0,0),$aShadowColor=false,$aCornerRadius=4,$aShadowWidth=3) { |
$this->iBoxType=2; |
$this->SetBox($aFrameColor,$aBorderColor,$aShadowColor,$aCornerRadius,$aShadowWidth); |
} |
// Hide the text |
function Hide($aHide=true) { |
$this->hide=$aHide; |
} |
// This looks ugly since it's not a very orthogonal design |
// but I added this "inverse" of Hide() to harmonize |
// with some classes which I designed more recently (especially) |
// jpgraph_gantt |
function Show($aShow=true) { |
$this->hide=!$aShow; |
} |
// Specify font |
function SetFont($aFamily,$aStyle=FS_NORMAL,$aSize=10) { |
$this->font_family=$aFamily; |
$this->font_style=$aStyle; |
$this->font_size=$aSize; |
} |
// Center the text between $left and $right coordinates |
function Center($aLeft,$aRight,$aYAbsPos=false) { |
$this->x = $aLeft + ($aRight-$aLeft )/2; |
$this->halign = "center"; |
if( is_numeric($aYAbsPos) ) |
$this->y = $aYAbsPos; |
} |
// Set text color |
function SetColor($aColor) { |
$this->color = $aColor; |
} |
function SetAngle($aAngle) { |
$this->SetOrientation($aAngle); |
} |
// Orientation of text. Note only TTF fonts can have an arbitrary angle |
function SetOrientation($aDirection=0) { |
if( is_numeric($aDirection) ) |
$this->dir=$aDirection; |
elseif( $aDirection=="h" ) |
$this->dir = 0; |
elseif( $aDirection=="v" ) |
$this->dir = 90; |
else |
JpGraphError::RaiseL(25051);//(" Invalid direction specified for text."); |
} |
// Total width of text |
function GetWidth($aImg) { |
$aImg->SetFont($this->font_family,$this->font_style,$this->font_size); |
$w = $aImg->GetTextWidth($this->t,$this->dir); |
return $w; |
} |
// Hight of font |
function GetFontHeight($aImg) { |
$aImg->SetFont($this->font_family,$this->font_style,$this->font_size); |
$h = $aImg->GetFontHeight(); |
return $h; |
} |
function GetTextHeight($aImg) { |
$aImg->SetFont($this->font_family,$this->font_style,$this->font_size); |
$h = $aImg->GetTextHeight($this->t,$this->dir); |
return $h; |
} |
function GetHeight($aImg) { |
// Synonym for GetTextHeight() |
$aImg->SetFont($this->font_family,$this->font_style,$this->font_size); |
$h = $aImg->GetTextHeight($this->t,$this->dir); |
return $h; |
} |
// Set the margin which will be interpretated differently depending |
// on the context. |
function SetMargin($aMarg) { |
$this->margin = $aMarg; |
} |
function StrokeWithScale($aImg,$axscale,$ayscale) { |
if( $this->iScalePosX === null || $this->iScalePosY === null ) { |
$this->Stroke($aImg); |
} |
else { |
$this->Stroke($aImg, |
round($axscale->Translate($this->iScalePosX)), |
round($ayscale->Translate($this->iScalePosY))); |
} |
} |
function SetCSIMTarget($aURITarget,$aAlt='',$aWinTarget='') { |
$this->iCSIMtarget = $aURITarget; |
$this->iCSIMalt = $aAlt; |
$this->iCSIMWinTarget = $aWinTarget; |
} |
function GetCSIMareas() { |
if( $this->iCSIMtarget !== '' ) { |
return $this->iCSIMarea; |
} |
else { |
return ''; |
} |
} |
// Display text in image |
function Stroke($aImg,$x=null,$y=null) { |
if( $x !== null ) $this->x = round($x); |
if( $y !== null ) $this->y = round($y); |
// Insert newlines |
if( $this->iWordwrap > 0 ) { |
$this->t = wordwrap($this->t,$this->iWordwrap,"\n"); |
} |
// If position been given as a fraction of the image size |
// calculate the absolute position |
if( $this->x < 1 && $this->x > 0 ) $this->x *= $aImg->width; |
if( $this->y < 1 && $this->y > 0 ) $this->y *= $aImg->height; |
$aImg->PushColor($this->color); |
$aImg->SetFont($this->font_family,$this->font_style,$this->font_size); |
$aImg->SetTextAlign($this->halign,$this->valign); |
if( $this->boxed ) { |
if( $this->fcolor=="nofill" ) { |
$this->fcolor=false; |
} |
$oldweight=$aImg->SetLineWeight(1); |
if( $this->iBoxType == 2 && $this->font_family > FF_FONT2+2 ) { |
$bbox = $aImg->StrokeBoxedText2($this->x, $this->y, |
$this->t, $this->dir, |
$this->fcolor, |
$this->bcolor, |
$this->shadow, |
$this->paragraph_align, |
2,4, |
$this->icornerradius, |
$this->ishadowwidth); |
} |
else { |
$bbox = $aImg->StrokeBoxedText($this->x,$this->y,$this->t, |
$this->dir,$this->fcolor,$this->bcolor,$this->shadow, |
$this->paragraph_align,3,3,$this->icornerradius, |
$this->ishadowwidth); |
} |
$aImg->SetLineWeight($oldweight); |
} |
else { |
$debug=false; |
$bbox = $aImg->StrokeText($this->x,$this->y,$this->t,$this->dir,$this->paragraph_align,$debug); |
} |
// Create CSIM targets |
$coords = $bbox[0].','.$bbox[1].','.$bbox[2].','.$bbox[3].','.$bbox[4].','.$bbox[5].','.$bbox[6].','.$bbox[7]; |
$this->iCSIMarea = "<area shape=\"poly\" coords=\"$coords\" href=\"".htmlentities($this->iCSIMtarget)."\" "; |
if( trim($this->iCSIMalt) != '' ) { |
$this->iCSIMarea .= " alt=\"".$this->iCSIMalt."\" "; |
$this->iCSIMarea .= " title=\"".$this->iCSIMalt."\" "; |
} |
if( trim($this->iCSIMWinTarget) != '' ) { |
$this->iCSIMarea .= " target=\"".$this->iCSIMWinTarget."\" "; |
} |
$this->iCSIMarea .= " />\n"; |
$aImg->PopColor($this->color); |
} |
} // Class |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/imgdata_pushpins.inc.php |
---|
New file |
0,0 → 1,517 |
<?php |
//======================================================================= |
// File: IMGDATA_PUSHPINS.INC |
// Description: Base64 encoded images for pushpins |
// Created: 2003-03-20 |
// Ver: $Id: imgdata_pushpins.inc.php 1106 2009-02-22 20:16:35Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
class ImgData_PushPins extends ImgData { |
protected $name = 'Push pins'; |
protected $an = array(MARK_IMG_PUSHPIN => 'imgdata_small', |
MARK_IMG_SPUSHPIN => 'imgdata_small', |
MARK_IMG_LPUSHPIN => 'imgdata_large'); |
protected $colors = array('blue','green','orange','pink','red'); |
protected $index = array('red' => 0, 'orange' => 1, 'pink' => 2, 'blue' => 3, 'green' => 4 ) ; |
protected $maxidx = 4 ; |
protected $imgdata_large, $imgdata_small ; |
function __construct() { |
// The anchor should be where the needle "hits" the paper |
// (bottom left corner) |
$this->anchor_x = 0; |
$this->anchor_y = 1; |
//========================================================== |
// File: ppl_red.png |
//========================================================== |
$this->imgdata_large[0][0]= 2490 ; |
$this->imgdata_large[0][1]= |
'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'. |
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. |
'B3RJTUUH0wMKBh4Ryh89CgAACUdJREFUeJy9mNtTFFcexz+/7p'. |
'4Lw1wZJKDGCAwmDAqUySamcCq1ed6k9mn3UfMP7F+1T3nYqn2J'. |
'lZdoDEjpbq0KG8EBFBFBEJye6Zmenkv32Ydu5GYiUMmeqq6uqT'. |
'6Xz3zP73aOcIKmAQkIFyD3N/jrBPwlKjLQEglVlJKyUjR3u7cc'. |
'WLoP3/4dvv03LNrQ8I6x1rFbDML9kOmHvh7IRHU9JKmUSG8vpF'. |
'IoXX/TV0AiEM5A5jT0noFMFMJHXUt/d5f9TUAbhtQ3cPFruDog'. |
'8klHMnmO0dGYe/myOJGINEwTz3F2higFXgy8PpAkOC+h8hoaCt'. |
'4ppHFcQAWSgOQlyI/p+lUjmRxWAwNJd3xca/f34yoFi4tgmjtD'. |
'NIFkJ4xcgBCgVqEBFJ9DqcZea/gNAAVEg7AOGYnHe9XoaJd3+X'. |
'LISSSwnz6lsbKCZ9sHh4UVdBkwdA6cPwNnIfJPmC3Ctgft3wwQ'. |
'QPkvTZJJnbExzfvsM2nMzVG7e5fG48d4lnXwTwEYCjJxuHQBog'. |
'BHUfKkgAIIhiGk06hTp/Dm5qS1uYlXLvtWd4gPgIiCrAEcVckT'. |
'Ab5p7TaYJrK1hQaEenrwSiVfQdc91P0kSp7Ii89D5ksY/kAkLy'. |
'IZXFdXkQjS1YUSEbdcRu168V6+HTUNIKJDRwdE+sBIQmP9Ld59'. |
'bEBA3of4F/D+uXb7rGaaCSmXI3pPj64PDaHCYfEqFVSjgWo2D2'. |
'73XlJNQTgCyQykIuBWoNKEeh1aLXBPBCggGdBOgxZVSjoajVhH'. |
'o5HWlIpq4bCQSgm9vXhK4ZZKh5SUYygp4J1EQVUD9xlU18BJQD'. |
'bUbJ5T5XJStyxN9fSI099P3baxV1dRloW2h2ivx/yakg2ot6F1'. |
'EkCa4G1D+zVEq5ArKTWM42Q6HUczQV7U66w9e0ZpdRXlOIQ5vF'. |
'VHUXILKify4jiEzkOqC3peQMoBQymFlMt4Dx6wUSxSsm2UZXEK'. |
'P30QvOUt8/2Sd78CdWwFDTA+gsw3cOlPcPUD+CQB52oQ21RKXM'. |
'eRhGXhOg7VoKrx8KuS4ygZhVg3ZI8FGIfwR9BVgAtfwxdXdP3L'. |
'86nUR91dXelNXTeWWy10paQHX602YAP1ADASAL7LJvFtMpOCc0'. |
'cG3FHuGlz6Gr4YEpnoTCbzsdHRbOzy5RCRiLRMk5rjyOtAimwA'. |
'U4U3SurBN/0wnAASBCVDIKpB4kiAB5Ub0/UvO9LpPAMDGfn005'. |
'AxPCzxep3Q6iqPLUseBoufCZRsAE6g5g5kKIDfKUj3wnpAG8QB'. |
'/Z1OIqANQuI65AtwNScyYXR2XlAXL2YZHzcklRKWl5GVFXFtGx'. |
'MoAiV/EQaAGH6BUQNWgQpwFngv+Ca8KUAQEBcwgTJHyMV7679R'. |
'XS8YqdSI6u/PMD5ukMtJY3GR2uQkr5aXeWVZOEALmA8WsIAxfL'. |
'd0goVLAdCOd+/YpgqeVtBv4yiA++q/RKKXixe7GB8PSyoljcVF'. |
'yg8fyubyMpulEk2lyAIfAAvAC+B+oOQFoAt/+0rAejB/EzjNri'. |
'vvqNnCd64jxcE39V8spnP+vMbAgDSePKE2NcXm06dslMuUlcID'. |
'TuFvqwXMBU8N39bGgRR+ki0Dz4L5DSAe9NGD7zq+6kcN1L6H2b'. |
'ao5WWaQHllRTafPmWrVMJUimoAQrBYJFjQwre7B6A8YAi8LCgD'. |
'5DVo6/hbb/iHK1KggvFeD3hHziQKEMuiNTNDbXGRTdtmw7Iwla'. |
'KGH0oqwbscLOoG46rAY6AOzRhY74PT6QuUKEN4PegXxd/yEDTT'. |
'YMWOk+oEaLkuFdNk0zTZwjfkavDUArXWgGXgFb4dEShXhfYqlI'. |
'ow3w9rg3B6ED60IOOA5oEYQBrcpG+mj9bg0VG8GMJhVDZLyzAo'. |
'VSq8rFYxXXefcjVgG9+uisDrXUCApoKSBcUHMBmHhfcgNwhtD3'. |
'q9IG6Lr15b4OUTmPwBJt8JqGuapp05o0mhoHnptLQfPsR+8IBK'. |
'uYyNH3yr+B77LHheA3tK1Ta+IrMeTL2C6Xl48TOsNWDDgAz7s5'. |
'/r+krP/eddCsbj8fDQ4GBm9MqVvvRXX2VULBayRGRzaYn1SoWa'. |
'UjgB4PIB5QK4ZgBXBKaAHxQsrED1H7CRgCUPwgHZDqACmhWwXv'. |
'2aDRqGYeRyufS169cvThQKV88PDuYbW1vJ5VRK+5euqxWlPMdX'. |
'SRqgreHbZGN3ijfKBXBTAeh2Fdwi2MofshP/dvKwCmKhp4m83Y'. |
'vj8Xg4l8tlCoXC0MTExMTFkZE/1m37wvLGRvKRacoD1209E7Fc'. |
'pZwYREOQqEJ4z3HskHLsz4AoXykPIBSN0t3dTTQafROoHdumXC'. |
'4fjoMiog0ODiauX7+eLxQKV3O53ETdti88nJnJ3rl505ifmWm3'. |
'arWSodR8GNbycDoNHy5C5jFold1k8d+DyvELNwg93d18/vnn9P'. |
'X1oes6nufx/Plz7t+/fxhQKSWJRCI5NjaWHxkZKdj1+sjSwkJm'. |
'+uZN/dZ337VqCwullGUVdZjsgIUC5LqhrUPvCugWuApeApPAzY'. |
'PKHWyaphGNRunt7WVwcBARwfM8Ojo6sCzrMKBhGLphGFEF2Wq1'. |
'2jc7M5OZ/vHH0MPbt93awkJJmeZsC6ZaMK3DCwvWdNioQUb5B6'. |
'AdBR+9SzkAz/NwHIeXL18iIui6TjgcJplMMjY2th8wHo+Hh4aG'. |
'MsPDw6fddru7+Phxx51bt/RbN260qwsLpZhlFZsw9QJ+2Pbrga'. |
'oJG2FY2oKwuTtVEz9uV34NbqdtbW0xPT1NNBoF4MyZM1y5coWu'. |
'rq5dQBHRcrlc4tq1a/l8Pj9RMs38ndu3Ez//9JNXLRZNyuXZJk'. |
'xVYKoExQpsK/+IaAuYb7no8zjC/R+A4zisrq7u+53NZjl16tQ+'. |
'QIlEIslsNpuPRCJXZ2dnh2/duNFRW1oy07a96MKd575yxRqU1B'. |
'5vPMpF5HHa1tYW9+7do7Ozc/eQpZTSQ6FQt1Lq8pMnT/5w7969'. |
'nuLcXE1rNufO9fRMhlKpOyvt9qPtVmvb25fFfvvWbrepVCqHwo'. |
'xaX19vff/996ZhGC8qlkW9Wt1Onz073fXxxz+6MB+9e9dUjuO+'. |
'7ebq9wLdB9hoNCrr6+s/4wf3FCJW3fPmTZhXsNWCprjuW66Dfr'. |
'928KAfBhJAEgiJSLuzs7OSTqctoFkqlZRt26j/I+L/AGjPTN4d'. |
'Nqn4AAAAAElFTkSuQmCC' ; |
//========================================================== |
// File: ppl_orange.png |
//========================================================== |
$this->imgdata_large[1][0]= 2753 ; |
$this->imgdata_large[1][1]= |
'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'. |
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. |
'B3RJTUUH0wMLFQ0VCkHCzQAACk5JREFUeJytmGtzG0d2hp8zNw'. |
'AEcRdJ6EJK9FL0CqZUm9jWbkwq3vhDstl8dmLvz8rP2H8Q75ZT'. |
'pkRfpLgqsS6WIFEKGYkiSBCDO+banQ8DUpRWEkklXQUUqlCDfv'. |
'rp857pgfAOQ4AMOJdg4R/hX96Hf06bvDc5iT07i8yeg8ksiIAI'. |
'4TBi/ds9/vivD/njapNHvRBfHXMu410AM+BUoVSF05NQsi1sO4'. |
'8402AXwLQTuP31OAZO2aG0MEn14iSlnI1z3LnMk8IZYJyBwjIs'. |
'/TWsVIWPJkvMFS4zMfMhUp5BsoCpAAEBLYKaMFGn00jBxnvu02'. |
'35+JHmSJEnBpQEcPo38MmCxd/nS9Ry71Ga/g1W9a8gn0GsHkgA'. |
'6DGjxkqb5CoO+YxF3A3p+jGjQUzoK+L/V0ADzFMwtSR8eLbAr8'. |
'uXOTf9NzhTc0geSLUQcYHgYEH786RMg0zWJHV2Aitv4x/HpHVS'. |
'QA2YBqTTGIUq5qkPMWaWkVwPnPtAA/BevmZcjxaaUtHh8pJJGu'. |
'DpCB9FvT7A7YT7S3p5vFMNzmWo/O0MSx/Ms3TqI8r59zFTfUQe'. |
'I7SBODE3tnfoIxYnNHligwik0zAzDdVpyKbA8sff5YAeMEwgkV'. |
'cufQeTJzZoCsaFLKXPTnNpoUTNsSgJmNoGsuNQjIDwYD2HlnZy'. |
'k++yxTKXZfKTU8zOpjhneeQYkorSmGERtIlICBKRbLX+y98YN3'. |
'ADcNIm+bJD4U3pPnmbEaRgYVRTGBkDSSsmxKfY7ZLuDJA4hdjl'. |
'JEgyBB2SJOvQ9RzTpNKoEwNq0CNFvOXR3/HxMgYVPObaz8kPmh'. |
'hkEWMatAfRONGGvLizyOE9P8KkpwhPDAgQKJQbELUD0oOIhbbH'. |
'JeVTmowxjAgZutB5AoOngA+2DdYrcTyOyYZP9+QpBvI29vwEhb'. |
'It042BVQgDy9KTMfkwQG1A9ACCLlgBBGUwxxoc52WDh2ATyEPp'. |
'1hoaPvrEBh0Dq5an9OUsl/9hylk5b5c+mowLc4E2Jtw4Eoljyf'. |
'ogA/AGEAagNRjGyUxOmEycyVA5EWDBxrmUp3ytLIv/NJP69Goh'. |
'+9mFydIvS5PZYkvH1oY/RFtKymlwBFQAgQd+kAA6qSQ8pvn2mp'. |
'SkJkuVFHPHBnQMrEt5Sl+e4/Lvp51PF1PF5Xy6WMvOWZXMom8z'. |
'OZTQ8+j5sbQiMEwopsCIwRtBGIJSCdzbTGo9NimkDcgdC7Bg49'. |
'TG5n4/nfr0Si77WdYp1YzyZEkWPdteaEnB7pPqBTxuIf/VgciE'. |
'SgasCPwh+GNIkaNNag1RiPge5pEhMQVjfoLcF+eoXSvbKxedwn'. |
'LKzC3KWbOi5/sW5a44/SHFUSgVA7SCzRG0AvA9mPOgFIETgu4n'. |
'Ww0wNQWFAqRSL6D2ZQYBdDrQ7R7jXiwgRcvIL02makuTmWtpM/'. |
'+BlLMl5vuWzLVEuwH6oYnR1KS8kJINGXMM2YdfRlALoQoQQKeb'. |
'bDVwoMdxQMaLCwLo96HZTF5HbrEhmOftianfZisfzueKv7ZmrX'. |
'MsjhxKXZGBjzyeEHmSE3oWiggtyVGmE8DTIXTC5NxgAxOAGUM8'. |
'fun9mnSSLQ/CxNzOTgJ3LIMgoGwkKBiiMyaVviHVkdCO4FEKNv'. |
'LQzWBYHfITPa4UBVM0LR/WB7ARJsdDDTjA6deYFIFUOimJ3d0E'. |
'sNdLavYYgBpthqKcjiiJRO8K6CK0CsJTjfQAGaJtD9vQFAxNNQ'. |
'1FB0yBAfA8gdMAIagLoCVAen0M00zMOTYShNDtoHs9CAIUoI4E'. |
'1IBihCdNhsMhsj6NuV7BCC2IBpBqQaaFOENCCeiEsO1BO4RQgy'. |
'I5Hm4k4oIU9MrgZSAdBeTabZz+ODxKQRRBFBJo6IUc51anYRQo'. |
'dto+24FNxYCiaWKkQsj00KkO4gxRRkAngJ868M0u3OkkM+hxQA'. |
'cQ7YD7GO5XYSsPZybh/TCkFIYY+kWniTW4Q7jXgHvHMhiRpmuW'. |
'ca08GZkkZ/nY6TZMNhCnf2CuPoDVJvxpB+q9BHA8Ag1uH+oP4c'. |
'YEPCzDwmzSLquShHW/E0YRbG/BjZtw40hAy7aNzJlzRn75E6N0'. |
'qiwTzafI7kOU3gWrhzZC2iHcbsPqLlxvJnCt4KC1RYAL3I5hzY'. |
'Xv/huePYCtITQMKEnyB4KQvMURuJvw889HGSwUCs7CwkLpo6tX'. |
'Ty/+7nel6VLGDn/8N9m+eZuo1UP8iNhLau6b3RfmOsHBGTUYw9'. |
'WBNeDrGB4+h/4qNLKwTnLbHj9CJw/6GoIh9Jpvq0HHcayFhYXi'. |
'l3/4w9LK8vLKexfma3G/mb/3n1njTivS7tNQaaU1grQDjJ868D'. |
'Axx6vmxnBrY9C9IcSbSXbavNjb/S3eN6/0m1JcKBScixcvllZW'. |
'Vi6uLC8v12q1v/M8b/HxVjP//YYr32yE4dYWvShO0ogi14xwxq'. |
'F4rbnxZ3cMjtpvEEeMvwA0TdOYn5/PffHFF7Vr166tvPeLXyx7'. |
'nrd4+/btyg/frFo//Xgncnd67qCn78earQqcmYD3fSi1wPCTSV'. |
'3gzqvm9uFOMl5nUAqFQn5paal26dKla57vf7D+6FHph9VV88af'. |
'vgq79bo70e3VT2l9A3hYg4UiRALVHTCHSZvYBm4A//6quf8zoG'. |
'3bpuM4acMwKr1+//SDe/dK31+/bv90/Xrcq9fduNW6rbVeC+E7'. |
'gWdD2DKg4UEpBmPcm10RuScida31ntb62HAigoigDw6Gh0axWH'. |
'QWFhZKi4uLZ+I4PrVer2e+u37dXPvqq6hbr7tOp1NXWq89h6/b'. |
'8FBB34WGBesdcPrj38lkMkGlUuml0+mu53nR3t4eo9HoSLhMJk'. |
'OlUiGdTuN5Hq7rvgA0TdO4cOFC7vPPP6/VarXldqdTu7m2lrv7'. |
'7beq++BBO263b/tKrfWSXlbvwJ6CuAtDgTYiaBFMw6BSqfDxxx'. |
'+rarWqGo0GN2/eZGtrC6XenAkRoVKpcPXqVWZmZmg0Gty6desF'. |
'oIhIOp3Ol8vlmmVZK3fv3Lm09uc/Zwbr653ccPgoNIzvnmn99Z'. |
'7W9QG46lAaM5mM2l95GIYUi0VOnz7N7OwsWmsymQzyuse5Q8Mw'. |
'DNLpNDMzM5w/f/7A6AGgUkoajYa9urpayOXzUz/fvZutr68Pim'. |
'F4/2y1+n2o9Q/ru7uPesPhXnyo4A+vfHp6mmazybNnz9jZ2UFr'. |
'TbPZJAhe+8/aS0Mphed5NBoNABqNBqPR6MWBVWstvu/nnj9/Pv'. |
'vo0aPq5uZmPBgM/qcwPf39xV/9ajU1M3Nvq9PZaw8GoT50PjdN'. |
'k6mpKa5cucL58+eJ45j19XWePHnCzs4OnudhmiaWZRGGIVH05r'. |
'yEYYjrumxubrKxsfFyDQJ6NBp1Pc+7C4jWumBaVm+kVL2l1H2l'. |
'1G6otS+H6V6z8u3tbVzXpdFooJRicXGRqakptre3uXXr1ltrcT'. |
'Qa8ezZszemWAE9rfUdYBOwtVLRbrPZ+48ff+wDvuu6Sr3MB4Dr'. |
'uty6desgfa1WC3iRyrNnz4pSSmezWUzTfGtYtNYcdvC/9sMlgP'. |
'n5N4cAAAAASUVORK5CYII=' ; |
//========================================================== |
// File: ppl_pink.png |
//========================================================== |
$this->imgdata_large[2][0]= 2779 ; |
$this->imgdata_large[2][1]= |
'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'. |
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. |
'B3RJTUUH0wMLFQolY9lkpgAACmhJREFUeJy9mOtzFNl5h5+3b9'. |
'Mz0kzPBWmEVtIiWYhIiC0HCDhB8lb8ISk7nzdZ5+/zJ/8BTmpT'. |
'660CZLwG1pVFgBkgGIHECEaa+/T9nHzQCCQuRpCNz6mp6g893U'. |
'8/c37ve3qEjxiC4OA4n/Lp/EUu/tsMM/+aEWduVBx7WhdkShcY'. |
'xUH2zo0Dwod/5N6vf8V//PoGdx8M8EOFPtK9jI8BdHCcMuVSmf'. |
'LxHLmSZdm2U8xIbmKETDGDZZnIy4dBbCynyGhphurEDBOlHFnn'. |
'qPcyPxTOwDCOccw7w5nlBRZWylI+ny/mZ6rL1dzUZ5/IWGZU3D'. |
'ZIOMQDDaJcHDVGWUbJBi9odVr0QoVSPzigIEaZ8vgSS/8wZU3/'. |
'k1fylipz5dLM2WlrZqHKaGCKbEbontq3KAKWQyZfZKTgYqc9Bp'. |
'2I2PcJ4ogk/UEBQcwipbFZmT13vDBx8fhnE1Ofnp9yJopFyT3X'. |
'yANfks0QHSQMDaL37pOxMLIu2UyVkjVKLjyKSeuD8dAYCFkso1'. |
'gYMaeWJ40T56cl8yAi/O4FSa2P6kYczIDsgVpAqcDImZPMuAB1'. |
'dkLQtcc8a/bwox8IUHAxZVxGZMouSLVYwKuMkD5IxN+JSdsRJB'. |
'pexuTVgYYM6EoGmxkmg3/hEhNUMr/hd7dqbOzExMn/GRDAxWZc'. |
'j3I8HiXfMjF2FQowKw7pjoN6E/Llw/GBJj8qxVOMlX4ipxc/lY'. |
'kl2zBLkmrTcEzMkoNoRLVidLi/9g+Z3I+1xRHX5EcAihxnbPRv'. |
'OTU9kZSmpKPy9FTGrLimPZ1H+UiyGaF67w6n7E1DwMngFDxGvc'. |
'w70v0xZUby5IxjlIyMssUJrJwVWkXBdbXvSvwEibcSdKCAFI16'. |
'4/sc0SRo9cGAGq1DwvQFzV6DVuBiV4zYnlEts6A2TSPcSiXoxo'. |
'QqJCEEFMbQ2b69o5qMiOOPqIMQkagu/aSL7waE8101WFShLjk9'. |
'yxgEvjRUiyYd+gwAjY2J9VpXfZ/JEXLhDp3OR6U4T97+hEnPwx'. |
'tv4HsRjy2tTQSFzQgDUnwSLBQRI+x1ZgcH87Vcv4SF19Kt0ezS'. |
'1h9s0Ma25pgr/YJfnLnEysok0+ezjM6EBLldGqKIJYuDRhOQEJ'. |
'Oih8X9Q0xmcXNjlCofBJgn78wxVz7L2YWf8tPPz1hnfjbjzfxN'. |
'qVwutq2etZXUQSXikcXGIgUiUkJSDIQMJgYGJsaB3c7b1qQ4GZ'. |
'xSkdGZIwMeNLfK6uezMnvJK3pLxeVixfvMsyVjSNSO6IV9adPG'. |
'AArkEEz8oUkFmBjYGO80qfd6pCWIayD59wIKcsjcKqufn7JO/S'. |
'xfyi+5c24pey5rZ09mJRNkiDdT/tzbkBr3SYkpMYpgEaIJSYhI'. |
'kSOY1GhilAQk5ntDIojxCZ/kf87Pl85xbuWEnLiUy+cW3NNuJX'. |
'MmY5meKf6mT7wZS+THdOjxlG06tIlIOMZxchSxcFFEGAwAGGME'. |
'jwyZYSnWL3cXWiIUbUI6hO/vxXuFOV84ycmlBWthNeflTjuzTi'. |
'lzJmM5s46Ej0J63/ZoPmoy6PYxtYVNhmfs0mbAND1mmKVMBY1L'. |
'mxA1LN7WgXQbCApNhKJHRIM+DQbv7yQGhjnJ5NgFuXBuxpu5mD'. |
'udm3LPuY7pmZLUE6L1SIJaIPFuDAqyw9lnwDYv6NFHkWJh4ZDB'. |
'wCBFD3uMxsTAwcBAiElpE/KcPg36dIiOvpsRxDCyhmlP2YY9ZU'. |
'v8NMb/1id+FGO0DTztkSXLOONUqeITsMkW2zwnJEIDFhYGx+A1'. |
'kwK4mASkvKDPc3p0iYhRRwYUhZLUTyV6Eu0t4s1Y4kcx6W6KaM'. |
'EZThcXH59RRhGEgIAddnBwNEBKqqpUtWBIF22YDIhJsbEkJqFN'. |
'qLtERHs7GnUkwISEQAf0uj30bY39PzbiC6qrDu2cExJ69Nhhhz'. |
'59UlIUipCQOnVi4sjG7ubJBy6um0C+he/0iDHQKIQERYyKFLqr'. |
'SI/W6kJCnvOcrWSLSquC1/Jw9Ks3R0FQKHr0uMc9bnCDGjX69A'. |
'H0XlcJkibN5jOe/alCZStHbjJL9lSMLkXExvCXRiDV6GZEeGeX'. |
'3TvvBVQoEjfBL/v0rT75Th7VU5C8gktI6NLlMY+5yU3WWGODDf'. |
'r098tHpNFNH7/2lKdXXdz7efLzVaqJIBOCmK8AJUlI6g0aV+9y'. |
'9+p7AR3bMQpTBWPy7yeN6fy0jNwewfpvC9Xe+3kFoUuXe9zj5n'. |
'BusEGHjh6GIAGawC2FWuvSvbbF1maFylZAsC1ISZADBiVNSJrP'. |
'eX73MY//skHP85z5+fnSxQsXj//4n39cmnPn7LbZlsajBmEnBL'. |
'1nuEGDG9x4aa5Ldz+h0RCuBqwBv1Wo+7vs9r7n++0MmYeAM+zB'. |
'+61EK1QUEnbbtN+9Bh3Hsebn54u//PdfLq9eWl2ZnZ1dSnaSwu'. |
'Pin40b9g3doKE0WoNIl65xj3v75njd3BBubQi6ExKmDWkMRKSl'. |
'tSbVKQcMao1Go5Ugb0+x53nOyZMnSysrKydXLq1cWlxa/McgCB'. |
'Yev3hU+GPrD3I5/q94k3pXYQY58q6B5Bs0HB//neaGx00gyWaz'. |
'VCoV7bquCoKAnZ0dfN/f03egLGj0m3XQNE1jdnY2/+WXXy6trq'. |
'6uzP3oR5eCIFi4detW5feXL1vr679Let37zVB3/mQytjXJwmSB'. |
'wikHp9ShY0RESqObwPrr5oBERKhUKly4cIFqtUq9XufmzZtsbW'. |
'2hXvuDwTTNtxZq8TyvsLy8vLS4uLgahOHphw8elL69fNlc++qr'. |
'uFOrNXPddm1cczVL5f5P+Lv5MuOJgTGxwYbZpZsCdeAq8M1Bcw'. |
'CGYeC6LtVqlRMnTjAyMkKn0yGXyx0N0LZt03Ec1zCMSrfXO37v'. |
'zp3S769csb+/ciXt1mrNdHf3ltZ6Lca8ZpJsduhtCdb2gEFJoQ'. |
'xADYHuHDS3f32lFEEQUK/XGRkZoVAocP78eZaXl9FaI/Jq25Uk'. |
'yWHAYrHozM/PlxYWFibTND32sFbLXrtyxVz76qukXas1M61WTW'. |
'm99gx+20TdN9jqtfjP7QzOwwYNp037Zd0DukDnIByA1pqdnR2+'. |
'++472u02Z8+eZWJiAsMwDsEBRNGBzYJpmsaJEyfyX3zxxdLS0t'. |
'KlVqu1dP3q1cLta9ekU6u1dat1J9b6Sk9kraV1rYXegW7apDYw'. |
'kFY6fPc4MNTw88bwfZ/NzU2UUnieRxAEiAiGcXiXfcigiIjruo'. |
'VyubxkWdbK7fX1xWvffFMInjzBM82uMT5+p++6V1UUrSe7u03t'. |
'+8lezlKt3gHyl0aSJDQaDa5fv876+vo+w6FzDq1BpZRsb2/bly'. |
'9f9vL5/Njdu3fzG0+eMJHNxsfn532vXN5NPG/7abPZal6/Hvfe'. |
'kroPHfsm98f7AHW9Xo+//vrrlmVZm71+37QNw3JnZ9PK4uJGpV'. |
'pt4Dh+vLGhsrmcfv1iHzu01m89HjIdCon2fb8TBMHtvYeRUn50'. |
'1Oj4vqp3Ok1f5LYSadfr9dQfDN642P/XeF2DA+SBAuA4jkOhUK'. |
'BQKESO43S11p3BYBDt7u4y+CtB/i/q7jp1GMiw2AAAAABJRU5E'. |
'rkJggg==' ; |
//========================================================== |
// File: ppl_blue.png |
//========================================================== |
$this->imgdata_large[3][0]= 2284 ; |
$this->imgdata_large[3][1]= |
'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'. |
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. |
'B3RJTUUH0wMLFRAiTZAL3gAACHlJREFUeJy9mGtv29YZgJ9zKF'. |
'F3y/Q9jh05tuQkarKgbYasde0UBdZgwNou/Vqga/sD9mP2B4a1'. |
'BbZ9atFPxb5sqOtmXbI19bqsluPYiR3HN90vFEWRZx/IJI5zqa'. |
'x0OwBBSgR5Hj7v+55zSEFXTUgIJyA9C6/9RsjMjAyFIxxJCDc7'. |
'iBqKgyZACGg3G2x9+xXf/fG33P3mC9qNKsp1O+1JdkEnQTdgIO'. |
'ttCSMUi8gj072MnugllAyB9G8rBGi6RsToJTF6iuRoFi1kHKZf'. |
'7fB8Iggj0/Dy23D2dakNTR3JDsXPvzstxmZGRMER1EwHhQAEgE'. |
'CLhIkPD6InY9S3djGLJVBtQP1Qb4HDAyoJYQOOZkPx49nhTH9i'. |
'7MUBGT7egxkJgd70wZS/CUkoZtA/fRoE1DZ2ACiv52ibReCp4e'. |
'7CIEHomxDiuVdGTqUnf/ZeOjR8fpiVXZul5ZrY3bWwbdcLr/dA'. |
'AAIpAwQjUWIjQ+g9HZvswiCgBVF9/SI6OSLGzo0i+oLi6+Utbq'. |
'+bKEftgwOE/0Ohocf66M+cBjo22U2RQLIHMhmYnvaOpR9S8bSU'. |
'UqCURGpRkuMZMm9cIvPGJZLj0yBjT2LprkiSkykx9cuXIhOnUs'. |
'm+QNC2XdG02ggBTcvFabsPWwTPpBAChSCgh4kYBpoeplWp47Qs'. |
'7EYDt21xINzd5GCAxLExRl89Z+nHjpbKMmjbmkgfDzI0JEW53K'. |
'Jaa6NcAOEX8v52uJzsBlAS6u0hcnTIccPRqhWPCUcLD+s1EaUp'. |
'HCEhEMCyHNpt9SjgIU12A6iw6xb123vYhaaKjB9tlgMD5X+uBp'. |
'zdkpg6azA8EaNQtKlVba+Xez4eCntnJrsDdFsW5nYFpxlFN846'. |
'DXe8utkM4mhi+EgQmjYbS2WqexZKk6BpjwJ2YlK5VjeA3pNDiH'. |
'YjRWPzPE7tmBo8EWwGhkXx+z3uXL7D3rU97LIF8RBEAl6lK/Uo'. |
'6JNM1rZ2aTcr3eUgIQOGTgbdwXMGyRejenLYTvQGbAdRuetSud'. |
'OivVuFZgtCEgICghICnZoMhmlVTPR49LCAEkQUhk/B7KXe0MWf'. |
'nxj8xVR/cDheK14WZmtVMJSBnlGoN6FmQq0FLfdwJgORKPHRo/'. |
'Snzx4G0F/FjJ4KiOdmjPCrrx8bffnMybMv9MQGNG3rzlVqtR1B'. |
'sh/CYXCD4Aag1oCW7ZnUOjSp6WFi/QNEB8Y7BfTNjZyCmUvJ0I'. |
'XXT47MTp98Ybon9VZCk8cVazfqlNargsY34G7ByAlIjkHd9CCr'. |
'LbBdiHViUgiECuDKYCdz8b2cywREdiYZOj8zNnLuzOTzx6ODp+'. |
'OaGaqwVzBFqz0Idhz2loE7YEwBLaAJLQcKbW8qjAcBF5Jh0AMP'. |
'IOHe6kxgtb3UMO2OxkF//ffK28nQqxfvm3szrtnDVa799Qb/+v'. |
'NtsbNSpm3tAv8B+w7Ub0FhAyoBcMPec9oK6raXk48ziQBXQcmC'. |
'pT3YqHa0mpEBkTR6wz/Jjo2cy04+fzwxdDquNfQKO7sFUbpu0c'. |
'wp3JoAYsA42Bbkl4GCryUNDEM7Avm6Z/CgSYBWG8pNuFuDu1Wo'. |
'tjoxKIJGeHIiM/jmK9NnX5ycuJQMtUcqXPvLDTa+qIie4hAJ1U'. |
'vdrmO2HaDfB931twJgAn1A4lGT96obPHPLBbhVgUoTHHWo9aAA'. |
'JVAKpyKEmQNzWRENAsL18ycKjAFN/9gCNvzLB/390MMmE7pnDi'. |
'Bvwt0K5Jv3O+0oB22nJ1Vvjb/UMhOpcKknqN1OiMB2DNHU2G5s'. |
'sVndpGJVcZXjX1IAlvw9PmhRQcOFPhsSDkiBrQR1G7brgs0a7D'. |
'ag3FK4rguqBXarI4Nt1SJv5gls7TEWtJDRBO2GwnIs8maevFnA'. |
'Gx6awLZvzeTBu4kFbLigijC47pscpx0xyDfkvtUEnlarCDtrUC'. |
't2HGIhvPHVdVwqjTIrxRU2a5uUrYoP0QZ2gMvACl7+3V/LuKDq'. |
'sJuDy597516+CEezIHXv7vcgXQu2l+Bvn8He9Y4AE4kgk5P9DE'. |
'R6aFdq5Et5Nit3yTf3m9sBcsAN3+D98c0Fit5JawE25r1zg1Fo'. |
'5B8GFD7g+nVYnu8EUEop9XTa0N/9dUbqcphP/rDJzbUClVbpgR'. |
'y2fXM3fND95qj75J8AC6BWPINfVSBieK+x+6cS5UCzCLu3oFV9'. |
'GqCMx2NGOp2Znpv7aXZudsool3T5J/179sxVlHJ4kGPrP2COBX'. |
'/7DmiApWCjxIMXpYNznYuXM+6TAKWUMppOZzLvv//ery5cuDCT'. |
'SqVS336bCwr1JfAPB9r+2KAFwJS+OcETzZHz/7v3etl6ipz77X'. |
'GAMh6PG+l0OjM3NzczOzs3k0pNnFlbW43+e/GKtMqrblSsF03V'. |
'WHcJA0PjIAzvg9JTze2H67g9DjAwOTmZ+uCDD96anZ2dnZiYmF'. |
'5dW41++Lvfa1fnr7qllVK9103mXNTnJgPA+YugsvB3HTaEl+Qs'. |
'AZ/yeHPPDCiTyaRx5syZbGoilV1dW00szC9oV+avusuLy0Xd0X'. |
'MgFkDM+zkYBZEHV8f7wwKu84zmngQoNU0LaZoWUa4K31y5qX/8'. |
'4cfyyvwVN5/L10NOKNeg8UmDxoKF5Vfj1xXAgD0JrgAcvBDfel'. |
'a4g4AykUgY6XR6emJiIru2ttZXq9S0K19eUcuLy8WQE8o5OAsN'. |
'Ggsmpl+NpoL1g9X4UBU+C9xDgEKIwNTUVOqdd955M9mbnJ3/cj'. |
'6Vu5aTheXCQXNdVeMzAwJSCGEA2XKpnF1cXIzlFnOVhJPIKdR+'. |
'c88ctq4AlVKsrKzw0UcfKcC5uXqzXnNqSzb2pwLxOHP/l7Z/BN'. |
'eB01LKt4HTrusKvGr8jB+hGn8MQAkYQMrfw4Nq/MFPtf+rdvDb'. |
'k8QL+/5Z4Uepxm7bfwHuTAVUWpWaqAAAAABJRU5ErkJggg==' ; |
//========================================================== |
// File: ppl_green.png |
//========================================================== |
$this->imgdata_large[4][0]= 2854 ; |
$this->imgdata_large[4][1]= |
'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'. |
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. |
'B3RJTUUH0wMLFQ4hANhluwAACrNJREFUeJytmF1zE1eagJ+3u9'. |
'XdkvUty2AbmLEtEzDBgZ0UpDBOalNTUzU3czl7tct/2n+wt3M/'. |
'NVM12SSTQQSyW2TA+QAJQogtYYFtyfrqL3WfvWj5g8AEjzfvhS'. |
'SXjk8//Zz3Pf3qCMcJAWxMKlT4kH+jwu/FknnJSUItKFHzCrKA'. |
'BggBQx5ziz/wn/yBz3hED4/oaJfSjgVoYjJJgTLTZCjohp7IGT'. |
'k5aZ4kb+bRTR30Q7djj8f/kpPMUSCFedRL6W8e8qMQNE6S4xpv'. |
'c5HrTPFubiJ3ZnlyOXV59rJYU5Z00h1c3d0brxAiUkScRijisk'. |
'6XLTyiN3s8HuAJpniXa/q8/pt8Or+0kF8oXJm5YiydWcIpOrJu'. |
'rjOQwd54AQwsMpTJYhPSoYuLQ58An/DnBQSdImXO8avsTPbqpc'. |
'lLp67OXDVzMznZLGxSs2qyIRu4at8gKHQEC50kE1icxqCAdxST'. |
'xjEA44tqaJlERl8uLWvvnX5PHuQfcCdxh5qq0aX76vj4WgWyXO'. |
'QiNgBP8IAaddr08X8+wHFmJSQhBbPAZGoSZSt5wQs6qoNC7UEd'. |
'4AEoLIQSCaCCy78Dv8Tiv1hjjW1CRj8XIAgEKqDtt9keboMJZa'. |
'vMjuzQVd3Xr9prTJo+GF/jKZea95R25Lxs8jg5qFGiwDnOS0mW'. |
'NE0rjNRIt3WbklUCA9mV3Zdz8OBT/JfCQLB0SKYVVjGFYSfx/E'. |
'26ow4e6uDujlPFQpE0FU6P8qNTHdXJdEdda0qf0itWBVM3pa/3'. |
'ccUlIECJet0cAJoeYk5EZCeS5IwEoerSxccJBwRqFFf38QCTaO'. |
'TRVFKJm3NTbtLNSyh2IkhIXsvLCesEGNCWdmwyruSD/z9kUlRc'. |
'3bqNlSxhJNJ43p5JITrOEis8Qtr0cXEpU/JT/pmO18n2vb42pU'. |
'3JnDnHMBqyPlpnoAaxhr2llv1ZUBqEGlqYwDQMsskMOcMgVL3Y'. |
'ZOQTHAcQQiIGjHCwCaiovjrv4hbcpKuJJjIcDHm685RGr4GLCx'. |
'YHkAcrLoAoDSLBiAQrMkjqybHJCbxgh+7xAC1MpsgzwRwD3qHL'. |
'WyTIBdlAa6u2rHfXaew06PV78ZZjAwleNnkolECoH5i090wOcY'. |
'+TgwYzFHiPi1zkOkXexeAMASnVU+LiyiA1wFUuaqggACLizeWw'. |
'ycMzyssmVYKkbpGyC5T+OUALk2mKLHKWf+ED/az+YW42d66YL+'. |
'aNrmEEzQCFEnKw368EgEvcN1m80eTIQIt0TFOjMJHkzNEBBYPp'. |
'sblf8QHzrORO5JaWZ5ZLl6cuJyyxpNPv4PZdoT+GyIxBfI5uUg'. |
'eJMCwP2/bIHO1JEudcgUUWOceKNq99mCvnzs5PzRcuTV4y5mRO'. |
'SMIjo47z5S7a94oQCNKgJsZwO7D/IDNg3/LLhRNXt4JohBb4aG'. |
'82GLdXcf93mQ+Y43r2RHZp+cRy6cqJK4l8MS+tdItaqiYtc0Mm'. |
'QpfJARh98HYh9IiXVcaAo58wGb+LBAjbSPgCOcoSa0wzxXtc08'. |
'/pv8mfyL+9MLVQvDJ1JVHJV6SZbFI1qtTsB+KlehRtRTGE8Afo'. |
'P4DRcAxiEudhAHjjzz+ubgX4oHowakHQOlqzICQwyVPITGVOXi'. |
'xfLF6aumzmczl5lHzMff2+fCdPaGttEkXoLQAO9B7C6EugPYby'. |
'gVPjGXc5eIbNAJPjGwiAbaAJUQv8wVG7GROkJFpyOqn/ovgLba'. |
'44L0+sDaraXb6jzq7aBQWjBOyUoHcaopOgmaA3IRyNDZnA1HjO'. |
'HSBkr7eEFDAEngHrQCf+/s2A8cSiSkqcKUeeTjwFy2Jd78t3+L'. |
'TR4itIiBLwLQhzkJyB5Cx4HXDaENVQCBAQcRqFIHTRaBIvuYXg'. |
'AdsouuNxEL0ZUBHnSQp66R73zYfUtQ6OytKT8RckQAJQoLtgO5'. |
'BJgj0D/WfgdyHaAHx8THoUcbGx8ciwhUl3bDEiToURPooeI7pH'. |
'MziK9Yd9nU5a6GgKjOH41vsgI4hAcyC5AZkapF+AoYNrjjsuhx'. |
'FbtPmeB5ykyQQzTPAWAQWC8S9oAI0QRRuPb9jkmyMZNAOTklvC'. |
'GGYZaFkGmkVAh8h4DtKFMIBunG+pB5B5AIkGBDsQ+qBiL20caj'. |
'zhJknq5KlgMkLjJHJos4kYEbFJi5vc5eYbATVN02bNWe19+32t'. |
'aJWlFm3wbf8Rz5NbDFJdlOFBF/g7cBf0JkrbBb+F6j1DOduEkU'. |
'8bWCOiSofPWadBnSZDWmgUkEMGhZCINut8S/0NBtPptFlZrBSu'. |
'vnt1+ndnflfIp9OJ/279Ubbbd+lP7KBKPoEBsgnqLph/BRzwdS'. |
'LnBUFvHcfdpRsGPAGqwMco6jynz+e0SPKYCHMfLX5VKHwcenR+'. |
'Igd1XTcqlUr+xn/cePv91fevzy8sLO2OtrOpWkqL7gXKSAVRdh'. |
'ZFEmEXoYkwBNqovoc/3GHH3aUR+jwC1oD/AWrANi4hGwyBzqEG'. |
'Vvb77Dgi0eT1VZzJZMxKpVJYXV1dXF1dXVm6sPSvruue3Xzcyj'. |
'6/syvDzwj0lNazK6Fj5LFCRZouZpBABj6jXouu3+Np6HNvDHaf'. |
'g91t74msbMuOJicnSSaTKKUQEUQEpRSO69But1/dB0VEm5uby9'. |
'y4cWNpdXX1+sLCworrume//PuXpeqnVeOban0U1PW2kcx+O9L7'. |
'Te9sUB4lWFR9SqNtNGcHx+/RDD2+Am4D94CnQA8OjjlEhMnyJC'. |
'srK8zOzu7BiYioMAzZ2Njg9u3brwIqpSSXy2WXl5eXLly4sOo4'. |
'zoV6vV6oflrVP/7Tx8Hmw1Zb6ydqmpWp7ha8h4O3gjOhzVANmF'. |
'XPMNQWvdDnCXCXuHR+APqH4fbCtm2mp6eZn59H13WJuYXRaKSU'. |
'UiSTyVcBdV3XDcOwRaTU7/en19bWCn/79G+JL/76RbhZ22y7u+'. |
'6ahl71nPDz/nO17m7wAxlabFOihy4+DvAcqAMbPzZ3OFzX5dmz'. |
'Z2iahoiosUUVhiGNRgPHcV4GzGQy5uLiYuH8+fMzo9FoslarJW'. |
'9+elP75E+fBJu1zY7qqpqBUW3T/niohnVvy+1zm5aVtp+WE2XT'. |
'nrHFzbjh1tYLz3XdPjD4R3BKKba2tqhWq4dzUO3noBPn4H5PKy'. |
'LaO++8U7hx48byhQsXVne7u6tf3/v64t3P7mbq9+odt+OuaWi3'. |
'PLxbW2ytubjbQCgiMnt6VlaurWgz0zM0m02q1WrUaDSUUuqI56'. |
'ivDxE5MCgiYllWtlwuL5mmufLV/a/O/uXPf9Ff1F+80Lv6Yx29'. |
'2qHzyZBh3cdvc7gaTZuZkzPh/Py8ACqVSv1/uPZDKXUAGEWRtF'. |
'qtxEcffZTL5XLF+2v39fqjeivshA/TpP83JLwzYFBzcA4370Cc'. |
'S81nTRBUs9lkOByi1GuOPI4Rh3+26JZlnSkWi781DOPXvV4v3+'. |
'/2G0R8kSBxB/jew+tERK+c49m2TblcxrZtXNfl+fPneJ6HZVmU'. |
'y2VJJpNyaJ9TSinlOA5bW1u4rntkQA0oAG8D54gb9W3ianxM3A'. |
'e/cn73U3Hq1Cm5du2aPjs7a+ztcSIShmE4ajQa6tatWzQajZ+0'. |
'fbiKI+It4SvijVUj7kL2qvGfgkskEqTTaZmcnDROnTplJhIJTU'. |
'QiwPd9P/Q8T6XTaQzDIAiCfzjP/wFVfszuFqdHXgAAAABJRU5E'. |
'rkJggg==' ; |
//========================================================== |
// File: pp_red.png |
//========================================================== |
$this->imgdata_small[0][0]= 384 ; |
$this->imgdata_small[0][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'. |
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'. |
'B3RJTUUH0wMJFhouFobZrQAAAQ1JREFUeJyV1dFtwyAQBuD/og'. |
'xQdYxa8gRY6hJ0jK6QdohMkTEuE5wUj5ERen05IoLvID7Jkn2G'. |
'j8MgTMyMXqRlUQBYq9ydmaL2h1cwqD7l30t+L1iwlbYFRegY7I'. |
'SHjkEifGg4ww3aBa/l4+9AhxWWr/dLhEunXUGHq6yGniw3QkOw'. |
'3jJ7UBd82n/VVAlAtvsfp98lAj2sAJOhU4AeQ7DC1ubVBODWDJ'. |
'TtCsEWa6u5M1NeFs1NzgdtuhHGtj+9Q2IDppQUAL6Cyrlz0gDN'. |
'ohSMiJCt861672EiAhEhESG3woJ9V9OKTkwRKbdqz4cHmFLSFg'. |
's69+LvAZKdeZ/n89uLnd2g0S+gjd5g8zzjH5Y/eLLi+NPEAAAA'. |
'AElFTkSuQmCC' ; |
//========================================================== |
// File: pp_orange.png |
//========================================================== |
$this->imgdata_small[1][0]= 403 ; |
$this->imgdata_small[1][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'. |
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'. |
'B3RJTUUH0wMJFhwAnApz5AAAASBJREFUeJyN1dFthDAMBuDf7S'. |
'3BCm2VCRKpS4QxbhikW6IewzcBqm6Fm6JyH7iEEByCn5AJH38g'. |
'BBIRHNUzBAWAGNfe/SrUGv92CtNt309BrfFdMGPjvt9CD8Fyml'. |
'ZZaDchRgA/59FDMD18pvNoNyHxMnUmgLmPHoJ+CqqfMaNAH22C'. |
'fgqKRwR+GRpxGjXBEiuXDBWQhTK3plxijyWWvtKVS5KNG1xM8I'. |
'OBr7geV1WupDqpmTAPKjCqLhxk/z0PImQmjKrAuI6vMXlhFroD'. |
'vfdqITXWqg2YMSJEAFcReoag6UXU2DzPG8w5t09YYsAyLWvHrL'. |
'HUy6D3XmvMAAhAay8kAJpBosX4vt0G4+4Jam6s6Rz1fgFG0ncA'. |
'f3XfOQcA+Acv5IUSdQw9hgAAAABJRU5ErkJggg==' ; |
//========================================================== |
// File: pp_pink.png |
//========================================================== |
$this->imgdata_small[2][0]= 419 ; |
$this->imgdata_small[2][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'. |
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'. |
'B3RJTUUH0wMJFhsQzvz1RwAAATBJREFUeJyd1MFthDAQheF/oi'. |
'gF+JYWQKICkCJRA1vGtrDbxFbhGvY0HVjCLeS2BeTiHFgTB2wg'. |
'eRISstCnmcG2qCpbuXf3ADBQzWsPfZfS9y9HsEu4/Fo33Wf4Fx'. |
'gxL3a1XkI3wbTNXHLoboVeLFUYDqObYBy+Fw/Uh9DdCmtOwIjF'. |
'YvG76CZoOhNGRmpO8zz30CJoOhMAqlDxFzQLppgXj2XaNlP7FF'. |
'GLL7ccMYCBgZERgCvXLBrfi2DEclmiKZwFY4tp6sW26bVfnede'. |
'e5Hc5dC2bUgrXGKqWrwcXnNYDjmCrcCIiQgDcFYV05kQ8SXmnB'. |
'NgPiVN06wrTDGAhz5EWY/FOccTk+cTnHM/YNu2YYllgFxCWuUM'. |
'ikzGx+2Gc+4N+CoJW8n+5a2UKm2aBoBvGA6L7wfl8aoAAAAASU'. |
'VORK5CYII=' ; |
//========================================================== |
// File: pp_blue.png |
//========================================================== |
$this->imgdata_small[3][0]= 883 ; |
$this->imgdata_small[3][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAACi1'. |
'BMVEX///8AAAAAADMAAGYAAJkAAMwAAP8zAAAzADMzAGYzAJkz'. |
'AMwzAP9mAABmADNmAGZmAJlmAMxmAP+ZAACZADOZAGaZAJmZAM'. |
'yZAP/MAADMADPMAGbMAJnMAMzMAP//AAD/ADP/AGb/AJn/AMz/'. |
'AP8AMwAAMzMAM2YAM5kAM8wAM/8zMwAzMzMzM2YzM5kzM8wzM/'. |
'9mMwBmMzNmM2ZmM5lmM8xmM/+ZMwCZMzOZM2aZM5mZM8yZM//M'. |
'MwDMMzPMM2bMM5nMM8zMM///MwD/MzP/M2b/M5n/M8z/M/8AZg'. |
'AAZjMAZmYAZpkAZswAZv8zZgAzZjMzZmYzZpkzZswzZv9mZgBm'. |
'ZjNmZmZmZplmZsxmZv+ZZgCZZjOZZmaZZpmZZsyZZv/MZgDMZj'. |
'PMZmbMZpnMZszMZv//ZgD/ZjP/Zmb/Zpn/Zsz/Zv8AmQAAmTMA'. |
'mWYAmZkAmcwAmf8zmQAzmTMzmWYzmZkzmcwzmf9mmQBmmTNmmW'. |
'ZmmZlmmcxmmf+ZmQCZmTOZmWaZmZmZmcyZmf/MmQDMmTPMmWbM'. |
'mZnMmczMmf//mQD/mTP/mWb/mZn/mcz/mf8AzAAAzDMAzGYAzJ'. |
'kAzMwAzP8zzAAzzDMzzGYzzJkzzMwzzP9mzABmzDNmzGZmzJlm'. |
'zMxmzP+ZzACZzDOZzGaZzJmZzMyZzP/MzADMzDPMzGbMzJnMzM'. |
'zMzP//zAD/zDP/zGb/zJn/zMz/zP8A/wAA/zMA/2YA/5kA/8wA'. |
'//8z/wAz/zMz/2Yz/5kz/8wz//9m/wBm/zNm/2Zm/5lm/8xm//'. |
'+Z/wCZ/zOZ/2aZ/5mZ/8yZ///M/wDM/zPM/2bM/5nM/8zM////'. |
'/wD//zP//2b//5n//8z///9jJVUgAAAAAXRSTlMAQObYZgAAAA'. |
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'. |
'RQfTAwkWGTNerea3AAAAYUlEQVR4nHXNwQ3AIAxDUUfyoROxRZ'. |
'icARin0EBTIP3Hp1gBRqSqYo0seqjZpnngojlWBir5+b8o06lM'. |
'ha5uFKEpDZulV8l52axhVzqaCdxQp32qVSSwC1wN3fYiw7b76w'. |
'bN4SMue4/KbwAAAABJRU5ErkJggg==' ; |
//========================================================== |
// File: pp_green.png |
//========================================================== |
$this->imgdata_small[4][0]= 447 ; |
$this->imgdata_small[4][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'. |
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'. |
'B3RJTUUH0wMJFhkLdq9eKQAAAUxJREFUeJyN1LFVwzAQxvH/8f'. |
'IeDS0FLKABlN6eIwPYAzCHB0gWYI2jj+i1ABUTQN4TRSQ7iiWZ'. |
'qxLn9Mt9ydmiqrSq930AYFiu6YdKrf/hP1gYQn6960PxwBaYMG'. |
'E9UA3dBFtVQjdBOQmBakLennK0CapRwbZRZ3N0O/IeEsqp3HKL'. |
'Smtt5pUZgTPg4gdDud+6xoS97wM2rsxxmRSoTgoVcMZsXJkBho'. |
'SmKqCuOuEtls6nmGMFPTUmxBKx/MeyNfQGLoOOiC2ddsxb1Kzv'. |
'ZzUqu5IXbGDvBJf+hDisi77qFSuhq7Xpuu66TyJLRGbsXVUPxV'. |
'SxsgkzDMt0mKT3/RcjL8C5hHnvJToXY0xYRZ4xnVKsV/S+a8YA'. |
'AvCb3s9g13UhYj+TTo93B3fApRV1FVlEAD6H42DjN9/WvzDYuJ'. |
'dL5b1/ji+/IX8EGWP4AwRii8PdFHTqAAAAAElFTkSuQmCC' ; |
} |
} |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/jpgraph_gradient.php |
---|
New file |
0,0 → 1,434 |
<?php |
/*======================================================================= |
// File: JPGRAPH_GRADIENT.PHP |
// Description: Create a color gradient |
// Created: 2003-02-01 |
// Ver: $Id: jpgraph_gradient.php 1761 2009-08-01 08:31:28Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
*/ |
// Styles for gradient color fill |
define("GRAD_VER",1); |
define("GRAD_VERT",1); |
define("GRAD_HOR",2); |
define("GRAD_MIDHOR",3); |
define("GRAD_MIDVER",4); |
define("GRAD_CENTER",5); |
define("GRAD_WIDE_MIDVER",6); |
define("GRAD_WIDE_MIDHOR",7); |
define("GRAD_LEFT_REFLECTION",8); |
define("GRAD_RIGHT_REFLECTION",9); |
define("GRAD_RAISED_PANEL",10); |
define("GRAD_DIAGONAL",11); |
//=================================================== |
// CLASS Gradient |
// Description: Handles gradient fills. This is to be |
// considered a "friend" class of Class Image. |
//=================================================== |
class Gradient { |
private $img=null, $numcolors=100; |
//--------------- |
// CONSTRUCTOR |
function __construct(&$img) { |
$this->img = $img; |
} |
function SetNumColors($aNum) { |
$this->numcolors=$aNum; |
} |
//--------------- |
// PUBLIC METHODS |
// Produce a gradient filled rectangle with a smooth transition between |
// two colors. |
// ($xl,$yt) Top left corner |
// ($xr,$yb) Bottom right |
// $from_color Starting color in gradient |
// $to_color End color in the gradient |
// $style Which way is the gradient oriented? |
function FilledRectangle($xl,$yt,$xr,$yb,$from_color,$to_color,$style=1) { |
$this->img->SetLineWeight(1); |
switch( $style ) { |
case GRAD_VER: |
$steps = ceil(abs($xr-$xl)+1); |
$delta = $xr>=$xl ? 1 : -1; |
$this->GetColArray($from_color,$to_color,$steps,$colors,$this->numcolors); |
for( $i=0, $x=$xl; $i < $steps; ++$i ) { |
$this->img->current_color = $colors[$i]; |
$this->img->Line($x,$yt,$x,$yb); |
$x += $delta; |
} |
break; |
case GRAD_HOR: |
$steps = ceil(abs($yb-$yt)+1); |
$delta = $yb >= $yt ? 1 : -1; |
$this->GetColArray($from_color,$to_color,$steps,$colors,$this->numcolors); |
for($i=0,$y=$yt; $i < $steps; ++$i) { |
$this->img->current_color = $colors[$i]; |
$this->img->Line($xl,$y,$xr,$y); |
$y += $delta; |
} |
break; |
case GRAD_MIDHOR: |
$steps = ceil(abs($yb-$yt)/2); |
$delta = $yb >= $yt ? 1 : -1; |
$this->GetColArray($from_color,$to_color,$steps,$colors,$this->numcolors); |
for($y=$yt, $i=0; $i < $steps; ++$i) { |
$this->img->current_color = $colors[$i]; |
$this->img->Line($xl,$y,$xr,$y); |
$y += $delta; |
} |
--$i; |
if( abs($yb-$yt) % 2 == 1 ) { |
--$steps; |
} |
for($j=0; $j < $steps; ++$j, --$i) { |
$this->img->current_color = $colors[$i]; |
$this->img->Line($xl,$y,$xr,$y); |
$y += $delta; |
} |
$this->img->Line($xl,$y,$xr,$y); |
break; |
case GRAD_MIDVER: |
$steps = ceil(abs($xr-$xl)/2); |
$delta = $xr>=$xl ? 1 : -1; |
$this->GetColArray($from_color,$to_color,$steps,$colors,$this->numcolors); |
for($x=$xl, $i=0; $i < $steps; ++$i) { |
$this->img->current_color = $colors[$i]; |
$this->img->Line($x,$yb,$x,$yt); |
$x += $delta; |
} |
--$i; |
if( abs($xr-$xl) % 2 == 1 ) { |
--$steps; |
} |
for($j=0; $j < $steps; ++$j, --$i) { |
$this->img->current_color = $colors[$i]; |
$this->img->Line($x,$yb,$x,$yt); |
$x += $delta; |
} |
$this->img->Line($x,$yb,$x,$yt); |
break; |
case GRAD_WIDE_MIDVER: |
$diff = ceil(abs($xr-$xl)); |
$steps = floor(abs($diff)/3); |
$firststep = $diff - 2*$steps ; |
$delta = $xr >= $xl ? 1 : -1; |
$this->GetColArray($from_color,$to_color,$firststep,$colors,$this->numcolors); |
for($x=$xl, $i=0; $i < $firststep; ++$i) { |
$this->img->current_color = $colors[$i]; |
$this->img->Line($x,$yb,$x,$yt); |
$x += $delta; |
} |
--$i; |
$this->img->current_color = $colors[$i]; |
for($j=0; $j< $steps; ++$j) { |
$this->img->Line($x,$yb,$x,$yt); |
$x += $delta; |
} |
for($j=0; $j < $steps; ++$j, --$i) { |
$this->img->current_color = $colors[$i]; |
$this->img->Line($x,$yb,$x,$yt); |
$x += $delta; |
} |
break; |
case GRAD_WIDE_MIDHOR: |
$diff = ceil(abs($yb-$yt)); |
$steps = floor(abs($diff)/3); |
$firststep = $diff - 2*$steps ; |
$delta = $yb >= $yt? 1 : -1; |
$this->GetColArray($from_color,$to_color,$firststep,$colors,$this->numcolors); |
for($y=$yt, $i=0; $i < $firststep; ++$i) { |
$this->img->current_color = $colors[$i]; |
$this->img->Line($xl,$y,$xr,$y); |
$y += $delta; |
} |
--$i; |
$this->img->current_color = $colors[$i]; |
for($j=0; $j < $steps; ++$j) { |
$this->img->Line($xl,$y,$xr,$y); |
$y += $delta; |
} |
for($j=0; $j < $steps; ++$j, --$i) { |
$this->img->current_color = $colors[$i]; |
$this->img->Line($xl,$y,$xr,$y); |
$y += $delta; |
} |
break; |
case GRAD_LEFT_REFLECTION: |
$steps1 = ceil(0.3*abs($xr-$xl)); |
$delta = $xr>=$xl ? 1 : -1; |
$from_color = $this->img->rgb->Color($from_color); |
$adj = 1.4; |
$m = ($adj-1.0)*(255-min(255,min($from_color[0],min($from_color[1],$from_color[2])))); |
$from_color2 = array(min(255,$from_color[0]+$m), |
min(255,$from_color[1]+$m), min(255,$from_color[2]+$m)); |
$this->GetColArray($from_color2,$to_color,$steps1,$colors,$this->numcolors); |
$n = count($colors); |
for($x=$xl, $i=0; $i < $steps1 && $i < $n; ++$i) { |
$this->img->current_color = $colors[$i]; |
$this->img->Line($x,$yb,$x,$yt); |
$x += $delta; |
} |
$steps2 = max(1,ceil(0.08*abs($xr-$xl))); |
$this->img->SetColor($to_color); |
for($j=0; $j< $steps2; ++$j) { |
$this->img->Line($x,$yb,$x,$yt); |
$x += $delta; |
} |
$steps = abs($xr-$xl)-$steps1-$steps2; |
$this->GetColArray($to_color,$from_color,$steps,$colors,$this->numcolors); |
$n = count($colors); |
for($i=0; $i < $steps && $i < $n; ++$i) { |
$this->img->current_color = $colors[$i]; |
$this->img->Line($x,$yb,$x,$yt); |
$x += $delta; |
} |
break; |
case GRAD_RIGHT_REFLECTION: |
$steps1 = ceil(0.7*abs($xr-$xl)); |
$delta = $xr>=$xl ? 1 : -1; |
$this->GetColArray($from_color,$to_color,$steps1,$colors,$this->numcolors); |
$n = count($colors); |
for($x=$xl, $i=0; $i < $steps1 && $i < $n; ++$i) { |
$this->img->current_color = $colors[$i]; |
$this->img->Line($x,$yb,$x,$yt); |
$x += $delta; |
} |
$steps2 = max(1,ceil(0.08*abs($xr-$xl))); |
$this->img->SetColor($to_color); |
for($j=0; $j< $steps2; ++$j) { |
$this->img->Line($x,$yb,$x,$yt); |
$x += $delta; |
} |
$from_color = $this->img->rgb->Color($from_color); |
$adj = 1.4; |
$m = ($adj-1.0)*(255-min(255,min($from_color[0],min($from_color[1],$from_color[2])))); |
$from_color = array(min(255,$from_color[0]+$m), |
min(255,$from_color[1]+$m), min(255,$from_color[2]+$m)); |
$steps = abs($xr-$xl)-$steps1-$steps2; |
$this->GetColArray($to_color,$from_color,$steps,$colors,$this->numcolors); |
$n = count($colors); |
for($i=0; $i < $steps && $i < $n; ++$i) { |
$this->img->current_color = $colors[$i]; |
$this->img->Line($x,$yb,$x,$yt); |
$x += $delta; |
} |
break; |
case GRAD_CENTER: |
$steps = ceil(min(($yb-$yt)+1,($xr-$xl)+1)/2); |
$this->GetColArray($from_color,$to_color,$steps,$colors,$this->numcolors); |
$dx = ($xr-$xl)/2; |
$dy = ($yb-$yt)/2; |
$x=$xl;$y=$yt;$x2=$xr;$y2=$yb; |
$n = count($colors); |
for($x=$xl, $i=0; $x < $xl+$dx && $y < $yt+$dy && $i < $n; ++$x, ++$y, --$x2, --$y2, ++$i) { |
$this->img->current_color = $colors[$i]; |
$this->img->Rectangle($x,$y,$x2,$y2); |
} |
$this->img->Line($x,$y,$x2,$y2); |
break; |
case GRAD_RAISED_PANEL: |
// right to left |
$steps1 = $xr-$xl; |
$delta = $xr>=$xl ? 1 : -1; |
$this->GetColArray($to_color,$from_color,$steps1,$colors,$this->numcolors); |
$n = count($colors); |
for($x=$xl, $i=0; $i < $steps1 && $i < $n; ++$i) { |
$this->img->current_color = $colors[$i]; |
$this->img->Line($x,$yb,$x,$yt); |
$x += $delta; |
} |
// left to right |
$xr -= 3; |
$xl += 3; |
$yb -= 3; |
$yt += 3; |
$steps2 = $xr-$xl; |
$delta = $xr>=$xl ? 1 : -1; |
for($x=$xl, $j=$steps2; $j >= 0; --$j) { |
$this->img->current_color = $colors[$j]; |
$this->img->Line($x,$yb,$x,$yt); |
$x += $delta; |
} |
break; |
case GRAD_DIAGONAL: |
// use the longer dimension to determine the required number of steps. |
// first loop draws from one corner to the mid-diagonal and the second |
// loop draws from the mid-diagonal to the opposing corner. |
if($xr-$xl > $yb - $yt) { |
// width is greater than height -> use x-dimension for steps |
$steps = $xr-$xl; |
$delta = $xr>=$xl ? 1 : -1; |
$this->GetColArray($from_color,$to_color,$steps*2,$colors,$this->numcolors); |
$n = count($colors); |
for($x=$xl, $i=0; $i < $steps && $i < $n; ++$i) { |
$this->img->current_color = $colors[$i]; |
$y = $yt+($i/$steps)*($yb-$yt)*$delta; |
$this->img->Line($x,$yt,$xl,$y); |
$x += $delta; |
} |
for($x=$xl, $i = 0; $i < $steps && $i < $n; ++$i) { |
$this->img->current_color = $colors[$steps+$i]; |
$y = $yt+($i/$steps)*($yb-$yt)*$delta; |
$this->img->Line($x,$yb,$xr,$y); |
$x += $delta; |
} |
} else { |
// height is greater than width -> use y-dimension for steps |
$steps = $yb-$yt; |
$delta = $yb>=$yt ? 1 : -1; |
$this->GetColArray($from_color,$to_color,$steps*2,$colors,$this->numcolors); |
$n = count($colors); |
for($y=$yt, $i=0; $i < $steps && $i < $n; ++$i) { |
$this->img->current_color = $colors[$i]; |
$x = $xl+($i/$steps)*($xr-$xl)*$delta; |
$this->img->Line($x,$yt,$xl,$y); |
$y += $delta; |
} |
for($y=$yt, $i = 0; $i < $steps && $i < $n; ++$i) { |
$this->img->current_color = $colors[$steps+$i]; |
$x = $xl+($i/$steps)*($xr-$xl)*$delta; |
$this->img->Line($x,$yb,$xr,$y); |
$x += $delta; |
} |
} |
break; |
default: |
JpGraphError::RaiseL(7001,$style); |
//("Unknown gradient style (=$style)."); |
break; |
} |
} |
// Fill a special case of a polygon with a flat bottom |
// with a gradient. Can be used for filled line plots. |
// Please note that this is NOT a generic gradient polygon fill |
// routine. It assumes that the bottom is flat (like a drawing |
// of a mountain) |
function FilledFlatPolygon($pts,$from_color,$to_color) { |
if( count($pts) == 0 ) return; |
$maxy=$pts[1]; |
$miny=$pts[1]; |
$n = count($pts) ; |
for( $i=0, $idx=0; $i < $n; $i += 2) { |
$x = round($pts[$i]); |
$y = round($pts[$i+1]); |
$miny = min($miny,$y); |
$maxy = max($maxy,$y); |
} |
$colors = array(); |
$this->GetColArray($from_color,$to_color,abs($maxy-$miny)+1,$colors,$this->numcolors); |
for($i=$miny, $idx=0; $i <= $maxy; ++$i ) { |
$colmap[$i] = $colors[$idx++]; |
} |
$n = count($pts)/2 ; |
$idx = 0 ; |
while( $idx < $n-1 ) { |
$p1 = array(round($pts[$idx*2]),round($pts[$idx*2+1])); |
$p2 = array(round($pts[++$idx*2]),round($pts[$idx*2+1])); |
// Find the largest rectangle we can fill |
$y = max($p1[1],$p2[1]) ; |
for($yy=$maxy; $yy > $y; --$yy) { |
$this->img->current_color = $colmap[$yy]; |
$this->img->Line($p1[0],$yy,$p2[0]-1,$yy); |
} |
if( $p1[1] == $p2[1] ) { |
continue; |
} |
// Fill the rest using lines (slow...) |
$slope = ($p2[0]-$p1[0])/($p1[1]-$p2[1]); |
$x1 = $p1[0]; |
$x2 = $p2[0]-1; |
$start = $y; |
if( $p1[1] > $p2[1] ) { |
while( $y >= $p2[1] ) { |
$x1=$slope*($start-$y)+$p1[0]; |
$this->img->current_color = $colmap[$y]; |
$this->img->Line($x1,$y,$x2,$y); |
--$y; |
} |
} |
else { |
while( $y >= $p1[1] ) { |
$x2=$p2[0]+$slope*($start-$y); |
$this->img->current_color = $colmap[$y]; |
$this->img->Line($x1,$y,$x2,$y); |
--$y; |
} |
} |
} |
} |
//--------------- |
// PRIVATE METHODS |
// Add to the image color map the necessary colors to do the transition |
// between the two colors using $numcolors intermediate colors |
function GetColArray($from_color,$to_color,$arr_size,&$colors,$numcols=100) { |
if( $arr_size==0 ) { |
return; |
} |
// If color is given as text get it's corresponding r,g,b values |
$from_color = $this->img->rgb->Color($from_color); |
$to_color = $this->img->rgb->Color($to_color); |
$rdelta=($to_color[0]-$from_color[0])/$numcols; |
$gdelta=($to_color[1]-$from_color[1])/$numcols; |
$bdelta=($to_color[2]-$from_color[2])/$numcols; |
$colorsperstep = $numcols/$arr_size; |
$prevcolnum = -1; |
$from_alpha = $from_color[3]; |
$to_alpha = $to_color[3]; |
$adelta = ( $to_alpha - $from_alpha ) / $numcols ; |
for ($i=0; $i < $arr_size; ++$i) { |
$colnum = floor($colorsperstep*$i); |
if ( $colnum == $prevcolnum ) { |
$colors[$i] = $colidx; |
} |
else { |
$r = floor($from_color[0] + $colnum*$rdelta); |
$g = floor($from_color[1] + $colnum*$gdelta); |
$b = floor($from_color[2] + $colnum*$bdelta); |
$alpha = $from_alpha + $colnum*$adelta; |
$colidx = $this->img->rgb->Allocate(sprintf("#%02x%02x%02x",$r,$g,$b),$alpha); |
$colors[$i] = $colidx; |
} |
$prevcolnum = $colnum; |
} |
} |
} // Class |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/jpgraph_errhandler.inc.php |
---|
New file |
0,0 → 1,368 |
<?php |
//======================================================================= |
// File: JPGRAPH_ERRHANDLER.PHP |
// Description: Error handler class together with handling of localized |
// error messages. All localized error messages are stored |
// in a separate file under the "lang/" subdirectory. |
// Created: 2006-09-24 |
// Ver: $Id: jpgraph_errhandler.inc.php 1920 2009-12-08 10:02:26Z ljp $ |
// |
// Copyright 2006 (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
if( !defined('DEFAULT_ERR_LOCALE') ) { |
define('DEFAULT_ERR_LOCALE','en'); |
} |
if( !defined('USE_IMAGE_ERROR_HANDLER') ) { |
define('USE_IMAGE_ERROR_HANDLER',true); |
} |
GLOBAL $__jpg_err_locale ; |
$__jpg_err_locale = DEFAULT_ERR_LOCALE; |
class ErrMsgText { |
private $lt=NULL; |
function __construct() { |
GLOBAL $__jpg_err_locale; |
$file = 'lang/'.$__jpg_err_locale.'.inc.php'; |
// If the chosen locale doesn't exist try english |
if( !file_exists(dirname(__FILE__).'/'.$file) ) { |
$__jpg_err_locale = 'en'; |
} |
$file = 'lang/'.$__jpg_err_locale.'.inc.php'; |
if( !file_exists(dirname(__FILE__).'/'.$file) ) { |
die('Chosen locale file ("'.$file.'") for error messages does not exist or is not readable for the PHP process. Please make sure that the file exists and that the file permissions are such that the PHP process is allowed to read this file.'); |
} |
require($file); |
$this->lt = $_jpg_messages; |
} |
function Get($errnbr,$a1=null,$a2=null,$a3=null,$a4=null,$a5=null) { |
GLOBAL $__jpg_err_locale; |
if( !isset($this->lt[$errnbr]) ) { |
return 'Internal error: The specified error message ('.$errnbr.') does not exist in the chosen locale ('.$__jpg_err_locale.')'; |
} |
$ea = $this->lt[$errnbr]; |
$j=0; |
if( $a1 !== null ) { |
$argv[$j++] = $a1; |
if( $a2 !== null ) { |
$argv[$j++] = $a2; |
if( $a3 !== null ) { |
$argv[$j++] = $a3; |
if( $a4 !== null ) { |
$argv[$j++] = $a4; |
if( $a5 !== null ) { |
$argv[$j++] = $a5; |
} |
} |
} |
} |
} |
$numargs = $j; |
if( $ea[1] != $numargs ) { |
// Error message argument count do not match. |
// Just return the error message without arguments. |
return $ea[0]; |
} |
switch( $numargs ) { |
case 1: |
$msg = sprintf($ea[0],$argv[0]); |
break; |
case 2: |
$msg = sprintf($ea[0],$argv[0],$argv[1]); |
break; |
case 3: |
$msg = sprintf($ea[0],$argv[0],$argv[1],$argv[2]); |
break; |
case 4: |
$msg = sprintf($ea[0],$argv[0],$argv[1],$argv[2],$argv[3]); |
break; |
case 5: |
$msg = sprintf($ea[0],$argv[0],$argv[1],$argv[2],$argv[3],$argv[4]); |
break; |
case 0: |
default: |
$msg = sprintf($ea[0]); |
break; |
} |
return $msg; |
} |
} |
// |
// A wrapper class that is used to access the specified error object |
// (to hide the global error parameter and avoid having a GLOBAL directive |
// in all methods. |
// |
class JpGraphError { |
private static $__iImgFlg = true; |
private static $__iLogFile = ''; |
private static $__iTitle = 'JpGraph Error: '; |
public static function Raise($aMsg,$aHalt=true){ |
throw new JpGraphException($aMsg); |
} |
public static function SetErrLocale($aLoc) { |
GLOBAL $__jpg_err_locale ; |
$__jpg_err_locale = $aLoc; |
} |
public static function RaiseL($errnbr,$a1=null,$a2=null,$a3=null,$a4=null,$a5=null) { |
throw new JpGraphExceptionL($errnbr,$a1,$a2,$a3,$a4,$a5); |
} |
public static function SetImageFlag($aFlg=true) { |
self::$__iImgFlg = $aFlg; |
} |
public static function GetImageFlag() { |
return self::$__iImgFlg; |
} |
public static function SetLogFile($aFile) { |
self::$__iLogFile = $aFile; |
} |
public static function GetLogFile() { |
return self::$__iLogFile; |
} |
public static function SetTitle($aTitle) { |
self::$__iTitle = $aTitle; |
} |
public static function GetTitle() { |
return self::$__iTitle; |
} |
} |
class JpGraphException extends Exception { |
// Redefine the exception so message isn't optional |
public function __construct($message, $code = 0) { |
// make sure everything is assigned properly |
parent::__construct($message, $code); |
} |
// custom string representation of object |
public function _toString() { |
return __CLASS__ . ": [{$this->code}]: {$this->message} at " . basename($this->getFile()) . ":" . $this->getLine() . "\n" . $this->getTraceAsString() . "\n"; |
} |
// custom representation of error as an image |
public function Stroke() { |
if( JpGraphError::GetImageFlag() ) { |
$errobj = new JpGraphErrObjectImg(); |
$errobj->SetTitle(JpGraphError::GetTitle()); |
} |
else { |
$errobj = new JpGraphErrObject(); |
$errobj->SetTitle(JpGraphError::GetTitle()); |
$errobj->SetStrokeDest(JpGraphError::GetLogFile()); |
} |
$errobj->Raise($this->getMessage()); |
} |
static public function defaultHandler(Exception $exception) { |
global $__jpg_OldHandler; |
if( $exception instanceof JpGraphException ) { |
$exception->Stroke(); |
} |
else { |
// Restore old handler |
if( $__jpg_OldHandler !== NULL ) { |
set_exception_handler($__jpg_OldHandler); |
} |
throw $exception; |
} |
} |
} |
class JpGraphExceptionL extends JpGraphException { |
// Redefine the exception so message isn't optional |
public function __construct($errcode,$a1=null,$a2=null,$a3=null,$a4=null,$a5=null) { |
// make sure everything is assigned properly |
$errtxt = new ErrMsgText(); |
JpGraphError::SetTitle('JpGraph Error: '.$errcode); |
parent::__construct($errtxt->Get($errcode,$a1,$a2,$a3,$a4,$a5), 0); |
} |
} |
// Setup the default handler |
global $__jpg_OldHandler; |
$__jpg_OldHandler = set_exception_handler(array('JpGraphException','defaultHandler')); |
// |
// First of all set up a default error handler |
// |
//============================================================= |
// The default trivial text error handler. |
//============================================================= |
class JpGraphErrObject { |
protected $iTitle = "JpGraph error: "; |
protected $iDest = false; |
function __construct() { |
// Empty. Reserved for future use |
} |
function SetTitle($aTitle) { |
$this->iTitle = $aTitle; |
} |
function SetStrokeDest($aDest) { |
$this->iDest = $aDest; |
} |
// If aHalt is true then execution can't continue. Typical used for fatal errors |
function Raise($aMsg,$aHalt=false) { |
if( $this->iDest != '' ) { |
if( $this->iDest == 'syslog' ) { |
error_log($this->iTitle.$aMsg); |
} |
else { |
$str = '['.date('r').'] '.$this->iTitle.$aMsg."\n"; |
$f = @fopen($this->iDest,'a'); |
if( $f ) { |
@fwrite($f,$str); |
@fclose($f); |
} |
} |
} |
else { |
$aMsg = $this->iTitle.$aMsg; |
// Check SAPI and if we are called from the command line |
// send the error to STDERR instead |
if( PHP_SAPI == 'cli' ) { |
fwrite(STDERR,$aMsg); |
} |
else { |
echo $aMsg; |
} |
} |
if( $aHalt ) |
exit(1); |
} |
} |
//============================================================== |
// An image based error handler |
//============================================================== |
class JpGraphErrObjectImg extends JpGraphErrObject { |
function __construct() { |
parent::__construct(); |
// Empty. Reserved for future use |
} |
function Raise($aMsg,$aHalt=true) { |
$img_iconerror = |
'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAaV'. |
'BMVEX//////2Xy8mLl5V/Z2VvMzFi/v1WyslKlpU+ZmUyMjEh/'. |
'f0VyckJlZT9YWDxMTDjAwMDy8sLl5bnY2K/MzKW/v5yyspKlpY'. |
'iYmH+MjHY/PzV/f2xycmJlZVlZWU9MTEXY2Ms/PzwyMjLFTjea'. |
'AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACx'. |
'IAAAsSAdLdfvwAAAAHdElNRQfTBgISOCqusfs5AAABLUlEQVR4'. |
'2tWV3XKCMBBGWfkranCIVClKLd/7P2Q3QsgCxjDTq+6FE2cPH+'. |
'xJ0Ogn2lQbsT+Wrs+buAZAV4W5T6Bs0YXBBwpKgEuIu+JERAX6'. |
'wM2rHjmDdEITmsQEEmWADgZm6rAjhXsoMGY9B/NZBwJzBvn+e3'. |
'wHntCAJdGu9SviwIwoZVDxPB9+Rc0TSEbQr0j3SA1gwdSn6Db0'. |
'6Tm1KfV6yzWGQO7zdpvyKLKBDmRFjzeB3LYgK7r6A/noDAfjtS'. |
'IXaIzbJSv6WgUebTMV4EoRB8a2mQiQjgtF91HdKDKZ1gtFtQjk'. |
'YcWaR5OKOhkYt+ZsTFdJRfPAApOpQYJTNHvCRSJR6SJngQadfc'. |
'vd69OLMddVOPCGVnmrFD8bVYd3JXfxXPtLR/+mtv59/ALWiiMx'. |
'qL72fwAAAABJRU5ErkJggg==' ; |
if( function_exists("imagetypes") ) { |
$supported = imagetypes(); |
} else { |
$supported = 0; |
} |
if( !function_exists('imagecreatefromstring') ) { |
$supported = 0; |
} |
if( ob_get_length() || headers_sent() || !($supported & IMG_PNG) ) { |
// Special case for headers already sent or that the installation doesn't support |
// the PNG format (which the error icon is encoded in). |
// Dont return an image since it can't be displayed |
die($this->iTitle.' '.$aMsg); |
} |
$aMsg = wordwrap($aMsg,55); |
$lines = substr_count($aMsg,"\n"); |
// Create the error icon GD |
$erricon = Image::CreateFromString(base64_decode($img_iconerror)); |
// Create an image that contains the error text. |
$w=400; |
$h=100 + 15*max(0,$lines-3); |
$img = new Image($w,$h); |
// Drop shadow |
$img->SetColor("gray"); |
$img->FilledRectangle(5,5,$w-1,$h-1,10); |
$img->SetColor("gray:0.7"); |
$img->FilledRectangle(5,5,$w-3,$h-3,10); |
// Window background |
$img->SetColor("lightblue"); |
$img->FilledRectangle(1,1,$w-5,$h-5); |
$img->CopyCanvasH($img->img,$erricon,5,30,0,0,40,40); |
// Window border |
$img->SetColor("black"); |
$img->Rectangle(1,1,$w-5,$h-5); |
$img->Rectangle(0,0,$w-4,$h-4); |
// Window top row |
$img->SetColor("darkred"); |
for($y=3; $y < 18; $y += 2 ) |
$img->Line(1,$y,$w-6,$y); |
// "White shadow" |
$img->SetColor("white"); |
// Left window edge |
$img->Line(2,2,2,$h-5); |
$img->Line(2,2,$w-6,2); |
// "Gray button shadow" |
$img->SetColor("darkgray"); |
// Gray window shadow |
$img->Line(2,$h-6,$w-5,$h-6); |
$img->Line(3,$h-7,$w-5,$h-7); |
// Window title |
$m = floor($w/2-5); |
$l = 110; |
$img->SetColor("lightgray:1.3"); |
$img->FilledRectangle($m-$l,2,$m+$l,16); |
// Stroke text |
$img->SetColor("darkred"); |
$img->SetFont(FF_FONT2,FS_BOLD); |
$img->StrokeText($m-90,15,$this->iTitle); |
$img->SetColor("black"); |
$img->SetFont(FF_FONT1,FS_NORMAL); |
$txt = new Text($aMsg,52,25); |
$txt->Align("left","top"); |
$txt->Stroke($img); |
if ($this->iDest) { |
$img->Stream($this->iDest); |
} else { |
$img->Headers(); |
$img->Stream(); |
} |
if( $aHalt ) |
die(); |
} |
} |
if( ! USE_IMAGE_ERROR_HANDLER ) { |
JpGraphError::SetImageFlag(false); |
} |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/jpgraph_plotband.php |
---|
New file |
0,0 → 1,635 |
<?php |
//======================================================================= |
// File: JPGRAPH_PLOTBAND.PHP |
// Description: PHP4 Graph Plotting library. Extension module. |
// Created: 2004-02-18 |
// Ver: $Id: jpgraph_plotband.php 1106 2009-02-22 20:16:35Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
// Constants for types of static bands in plot area |
define("BAND_RDIAG",1); // Right diagonal lines |
define("BAND_LDIAG",2); // Left diagonal lines |
define("BAND_SOLID",3); // Solid one color |
define("BAND_VLINE",4); // Vertical lines |
define("BAND_HLINE",5); // Horizontal lines |
define("BAND_3DPLANE",6); // "3D" Plane |
define("BAND_HVCROSS",7); // Vertical/Hor crosses |
define("BAND_DIAGCROSS",8); // Diagonal crosses |
// Utility class to hold coordinates for a rectangle |
class Rectangle { |
public $x,$y,$w,$h; |
public $xe, $ye; |
function __construct($aX,$aY,$aWidth,$aHeight) { |
$this->x=$aX; |
$this->y=$aY; |
$this->w=$aWidth; |
$this->h=$aHeight; |
$this->xe=$aX+$aWidth-1; |
$this->ye=$aY+$aHeight-1; |
} |
} |
//===================================================================== |
// Class RectPattern |
// Base class for pattern hierarchi that is used to display patterned |
// bands on the graph. Any subclass that doesn't override Stroke() |
// must at least implement method DoPattern($aImg) which is responsible |
// for drawing the pattern onto the graph. |
//===================================================================== |
class RectPattern { |
protected $color; |
protected $weight; |
protected $rect=null; |
protected $doframe=true; |
protected $linespacing; // Line spacing in pixels |
protected $iBackgroundColor=-1; // Default is no background fill |
function __construct($aColor,$aWeight=1) { |
$this->color = $aColor; |
$this->weight = $aWeight; |
} |
function SetBackground($aBackgroundColor) { |
$this->iBackgroundColor=$aBackgroundColor; |
} |
function SetPos($aRect) { |
$this->rect = $aRect; |
} |
function ShowFrame($aShow=true) { |
$this->doframe=$aShow; |
} |
function SetDensity($aDens) { |
if( $aDens < 1 || $aDens > 100 ) |
JpGraphError::RaiseL(16001,$aDens); |
//(" Desity for pattern must be between 1 and 100. (You tried $aDens)"); |
// 1% corresponds to linespacing=50 |
// 100 % corresponds to linespacing 1 |
$this->linespacing = floor(((100-$aDens)/100.0)*50)+1; |
} |
function Stroke($aImg) { |
if( $this->rect == null ) |
JpGraphError::RaiseL(16002); |
//(" No positions specified for pattern."); |
if( !(is_numeric($this->iBackgroundColor) && $this->iBackgroundColor==-1) ) { |
$aImg->SetColor($this->iBackgroundColor); |
$aImg->FilledRectangle($this->rect->x,$this->rect->y,$this->rect->xe,$this->rect->ye); |
} |
$aImg->SetColor($this->color); |
$aImg->SetLineWeight($this->weight); |
// Virtual function implemented by subclass |
$this->DoPattern($aImg); |
// Frame around the pattern area |
if( $this->doframe ) |
$aImg->Rectangle($this->rect->x,$this->rect->y,$this->rect->xe,$this->rect->ye); |
} |
} |
//===================================================================== |
// Class RectPatternSolid |
// Implements a solid band |
//===================================================================== |
class RectPatternSolid extends RectPattern { |
function __construct($aColor="black",$aWeight=1) { |
parent::__construct($aColor,$aWeight); |
} |
function DoPattern($aImg) { |
$aImg->SetColor($this->color); |
$aImg->FilledRectangle($this->rect->x,$this->rect->y, |
$this->rect->xe,$this->rect->ye); |
} |
} |
//===================================================================== |
// Class RectPatternHor |
// Implements horizontal line pattern |
//===================================================================== |
class RectPatternHor extends RectPattern { |
function __construct($aColor="black",$aWeight=1,$aLineSpacing=7) { |
parent::__construct($aColor,$aWeight); |
$this->linespacing = $aLineSpacing; |
} |
function DoPattern($aImg) { |
$x0 = $this->rect->x; |
$x1 = $this->rect->xe; |
$y = $this->rect->y; |
while( $y < $this->rect->ye ) { |
$aImg->Line($x0,$y,$x1,$y); |
$y += $this->linespacing; |
} |
} |
} |
//===================================================================== |
// Class RectPatternVert |
// Implements vertical line pattern |
//===================================================================== |
class RectPatternVert extends RectPattern { |
function __construct($aColor="black",$aWeight=1,$aLineSpacing=7) { |
parent::__construct($aColor,$aWeight); |
$this->linespacing = $aLineSpacing; |
} |
//-------------------- |
// Private methods |
// |
function DoPattern($aImg) { |
$x = $this->rect->x; |
$y0 = $this->rect->y; |
$y1 = $this->rect->ye; |
while( $x < $this->rect->xe ) { |
$aImg->Line($x,$y0,$x,$y1); |
$x += $this->linespacing; |
} |
} |
} |
//===================================================================== |
// Class RectPatternRDiag |
// Implements right diagonal pattern |
//===================================================================== |
class RectPatternRDiag extends RectPattern { |
function __construct($aColor="black",$aWeight=1,$aLineSpacing=12) { |
parent::__construct($aColor,$aWeight); |
$this->linespacing = $aLineSpacing; |
} |
function DoPattern($aImg) { |
// -------------------- |
// | / / / / /| |
// |/ / / / / | |
// | / / / / | |
// -------------------- |
$xe = $this->rect->xe; |
$ye = $this->rect->ye; |
$x0 = $this->rect->x + round($this->linespacing/2); |
$y0 = $this->rect->y; |
$x1 = $this->rect->x; |
$y1 = $this->rect->y + round($this->linespacing/2); |
while($x0<=$xe && $y1<=$ye) { |
$aImg->Line($x0,$y0,$x1,$y1); |
$x0 += $this->linespacing; |
$y1 += $this->linespacing; |
} |
if( $xe-$x1 > $ye-$y0 ) { |
// Width larger than height |
$x1 = $this->rect->x + ($y1-$ye); |
$y1 = $ye; |
$y0 = $this->rect->y; |
while( $x0 <= $xe ) { |
$aImg->Line($x0,$y0,$x1,$y1); |
$x0 += $this->linespacing; |
$x1 += $this->linespacing; |
} |
$y0=$this->rect->y + ($x0-$xe); |
$x0=$xe; |
} |
else { |
// Height larger than width |
$diff = $x0-$xe; |
$y0 = $diff+$this->rect->y; |
$x0 = $xe; |
$x1 = $this->rect->x; |
while( $y1 <= $ye ) { |
$aImg->Line($x0,$y0,$x1,$y1); |
$y1 += $this->linespacing; |
$y0 += $this->linespacing; |
} |
$diff = $y1-$ye; |
$y1 = $ye; |
$x1 = $diff + $this->rect->x; |
} |
while( $y0 <= $ye ) { |
$aImg->Line($x0,$y0,$x1,$y1); |
$y0 += $this->linespacing; |
$x1 += $this->linespacing; |
} |
} |
} |
//===================================================================== |
// Class RectPatternLDiag |
// Implements left diagonal pattern |
//===================================================================== |
class RectPatternLDiag extends RectPattern { |
function __construct($aColor="black",$aWeight=1,$aLineSpacing=12) { |
$this->linespacing = $aLineSpacing; |
parent::__construct($aColor,$aWeight); |
} |
function DoPattern($aImg) { |
// -------------------- |
// |\ \ \ \ \ | |
// | \ \ \ \ \| |
// | \ \ \ \ | |
// |------------------| |
$xe = $this->rect->xe; |
$ye = $this->rect->ye; |
$x0 = $this->rect->x + round($this->linespacing/2); |
$y0 = $this->rect->ye; |
$x1 = $this->rect->x; |
$y1 = $this->rect->ye - round($this->linespacing/2); |
while($x0<=$xe && $y1>=$this->rect->y) { |
$aImg->Line($x0,$y0,$x1,$y1); |
$x0 += $this->linespacing; |
$y1 -= $this->linespacing; |
} |
if( $xe-$x1 > $ye-$this->rect->y ) { |
// Width larger than height |
$x1 = $this->rect->x + ($this->rect->y-$y1); |
$y0=$ye; $y1=$this->rect->y; |
while( $x0 <= $xe ) { |
$aImg->Line($x0,$y0,$x1,$y1); |
$x0 += $this->linespacing; |
$x1 += $this->linespacing; |
} |
$y0=$this->rect->ye - ($x0-$xe); |
$x0=$xe; |
} |
else { |
// Height larger than width |
$diff = $x0-$xe; |
$y0 = $ye-$diff; |
$x0 = $xe; |
while( $y1 >= $this->rect->y ) { |
$aImg->Line($x0,$y0,$x1,$y1); |
$y0 -= $this->linespacing; |
$y1 -= $this->linespacing; |
} |
$diff = $this->rect->y - $y1; |
$x1 = $this->rect->x + $diff; |
$y1 = $this->rect->y; |
} |
while( $y0 >= $this->rect->y ) { |
$aImg->Line($x0,$y0,$x1,$y1); |
$y0 -= $this->linespacing; |
$x1 += $this->linespacing; |
} |
} |
} |
//===================================================================== |
// Class RectPattern3DPlane |
// Implements "3D" plane pattern |
//===================================================================== |
class RectPattern3DPlane extends RectPattern { |
private $alpha=50; // Parameter that specifies the distance |
// to "simulated" horizon in pixel from the |
// top of the band. Specifies how fast the lines |
// converge. |
function __construct($aColor="black",$aWeight=1) { |
parent::__construct($aColor,$aWeight); |
$this->SetDensity(10); // Slightly larger default |
} |
function SetHorizon($aHorizon) { |
$this->alpha=$aHorizon; |
} |
function DoPattern($aImg) { |
// "Fake" a nice 3D grid-effect. |
$x0 = $this->rect->x + $this->rect->w/2; |
$y0 = $this->rect->y; |
$x1 = $x0; |
$y1 = $this->rect->ye; |
$x0_right = $x0; |
$x1_right = $x1; |
// BTW "apa" means monkey in Swedish but is really a shortform for |
// "alpha+a" which was the labels I used on paper when I derived the |
// geometric to get the 3D perspective right. |
// $apa is the height of the bounding rectangle plus the distance to the |
// artifical horizon (alpha) |
$apa = $this->rect->h + $this->alpha; |
// Three cases and three loops |
// 1) The endpoint of the line ends on the bottom line |
// 2) The endpoint ends on the side |
// 3) Horizontal lines |
// Endpoint falls on bottom line |
$middle=$this->rect->x + $this->rect->w/2; |
$dist=$this->linespacing; |
$factor=$this->alpha /($apa); |
while($x1>$this->rect->x) { |
$aImg->Line($x0,$y0,$x1,$y1); |
$aImg->Line($x0_right,$y0,$x1_right,$y1); |
$x1 = $middle - $dist; |
$x0 = $middle - $dist * $factor; |
$x1_right = $middle + $dist; |
$x0_right = $middle + $dist * $factor; |
$dist += $this->linespacing; |
} |
// Endpoint falls on sides |
$dist -= $this->linespacing; |
$d=$this->rect->w/2; |
$c = $apa - $d*$apa/$dist; |
while( $x0>$this->rect->x ) { |
$aImg->Line($x0,$y0,$this->rect->x,$this->rect->ye-$c); |
$aImg->Line($x0_right,$y0,$this->rect->xe,$this->rect->ye-$c); |
$dist += $this->linespacing; |
$x0 = $middle - $dist * $factor; |
$x1 = $middle - $dist; |
$x0_right = $middle + $dist * $factor; |
$c = $apa - $d*$apa/$dist; |
} |
// Horizontal lines |
// They need some serious consideration since they are a function |
// of perspective depth (alpha) and density (linespacing) |
$x0=$this->rect->x; |
$x1=$this->rect->xe; |
$y=$this->rect->ye; |
// The first line is drawn directly. Makes the loop below slightly |
// more readable. |
$aImg->Line($x0,$y,$x1,$y); |
$hls = $this->linespacing; |
// A correction factor for vertical "brick" line spacing to account for |
// a) the difference in number of pixels hor vs vert |
// b) visual apperance to make the first layer of "bricks" look more |
// square. |
$vls = $this->linespacing*0.6; |
$ds = $hls*($apa-$vls)/$apa; |
// Get the slope for the "perspective line" going from bottom right |
// corner to top left corner of the "first" brick. |
// Uncomment the following lines if you want to get a visual understanding |
// of what this helpline does. BTW this mimics the way you would get the |
// perspective right when drawing on paper. |
/* |
$x0 = $middle; |
$y0 = $this->rect->ye; |
$len=floor(($this->rect->ye-$this->rect->y)/$vls); |
$x1 = $middle+round($len*$ds); |
$y1 = $this->rect->ye-$len*$vls; |
$aImg->PushColor("red"); |
$aImg->Line($x0,$y0,$x1,$y1); |
$aImg->PopColor(); |
*/ |
$y -= $vls; |
$k=($this->rect->ye-($this->rect->ye-$vls))/($middle-($middle-$ds)); |
$dist = $hls; |
while( $y>$this->rect->y ) { |
$aImg->Line($this->rect->x,$y,$this->rect->xe,$y); |
$adj = $k*$dist/(1+$dist*$k/$apa); |
if( $adj < 2 ) $adj=1; |
$y = $this->rect->ye - round($adj); |
$dist += $hls; |
} |
} |
} |
//===================================================================== |
// Class RectPatternCross |
// Vert/Hor crosses |
//===================================================================== |
class RectPatternCross extends RectPattern { |
private $vert=null; |
private $hor=null; |
function __construct($aColor="black",$aWeight=1) { |
parent::__construct($aColor,$aWeight); |
$this->vert = new RectPatternVert($aColor,$aWeight); |
$this->hor = new RectPatternHor($aColor,$aWeight); |
} |
function SetOrder($aDepth) { |
$this->vert->SetOrder($aDepth); |
$this->hor->SetOrder($aDepth); |
} |
function SetPos($aRect) { |
parent::SetPos($aRect); |
$this->vert->SetPos($aRect); |
$this->hor->SetPos($aRect); |
} |
function SetDensity($aDens) { |
$this->vert->SetDensity($aDens); |
$this->hor->SetDensity($aDens); |
} |
function DoPattern($aImg) { |
$this->vert->DoPattern($aImg); |
$this->hor->DoPattern($aImg); |
} |
} |
//===================================================================== |
// Class RectPatternDiagCross |
// Vert/Hor crosses |
//===================================================================== |
class RectPatternDiagCross extends RectPattern { |
private $left=null; |
private $right=null; |
function __construct($aColor="black",$aWeight=1) { |
parent::__construct($aColor,$aWeight); |
$this->right = new RectPatternRDiag($aColor,$aWeight); |
$this->left = new RectPatternLDiag($aColor,$aWeight); |
} |
function SetOrder($aDepth) { |
$this->left->SetOrder($aDepth); |
$this->right->SetOrder($aDepth); |
} |
function SetPos($aRect) { |
parent::SetPos($aRect); |
$this->left->SetPos($aRect); |
$this->right->SetPos($aRect); |
} |
function SetDensity($aDens) { |
$this->left->SetDensity($aDens); |
$this->right->SetDensity($aDens); |
} |
function DoPattern($aImg) { |
$this->left->DoPattern($aImg); |
$this->right->DoPattern($aImg); |
} |
} |
//===================================================================== |
// Class RectPatternFactory |
// Factory class for rectangular pattern |
//===================================================================== |
class RectPatternFactory { |
function __construct() { |
// Empty |
} |
function Create($aPattern,$aColor,$aWeight=1) { |
switch($aPattern) { |
case BAND_RDIAG: |
$obj = new RectPatternRDiag($aColor,$aWeight); |
break; |
case BAND_LDIAG: |
$obj = new RectPatternLDiag($aColor,$aWeight); |
break; |
case BAND_SOLID: |
$obj = new RectPatternSolid($aColor,$aWeight); |
break; |
case BAND_VLINE: |
$obj = new RectPatternVert($aColor,$aWeight); |
break; |
case BAND_HLINE: |
$obj = new RectPatternHor($aColor,$aWeight); |
break; |
case BAND_3DPLANE: |
$obj = new RectPattern3DPlane($aColor,$aWeight); |
break; |
case BAND_HVCROSS: |
$obj = new RectPatternCross($aColor,$aWeight); |
break; |
case BAND_DIAGCROSS: |
$obj = new RectPatternDiagCross($aColor,$aWeight); |
break; |
default: |
JpGraphError::RaiseL(16003,$aPattern); |
//(" Unknown pattern specification ($aPattern)"); |
} |
return $obj; |
} |
} |
//===================================================================== |
// Class PlotBand |
// Factory class which is used by the client. |
// It is responsible for factoring the corresponding pattern |
// concrete class. |
//===================================================================== |
class PlotBand { |
public $depth; // Determine if band should be over or under the plots |
private $prect=null; |
private $dir, $min, $max; |
function __construct($aDir,$aPattern,$aMin,$aMax,$aColor="black",$aWeight=1,$aDepth=DEPTH_BACK) { |
$f = new RectPatternFactory(); |
$this->prect = $f->Create($aPattern,$aColor,$aWeight); |
if( is_numeric($aMin) && is_numeric($aMax) && ($aMin > $aMax) ) |
JpGraphError::RaiseL(16004); |
//('Min value for plotband is larger than specified max value. Please correct.'); |
$this->dir = $aDir; |
$this->min = $aMin; |
$this->max = $aMax; |
$this->depth=$aDepth; |
} |
// Set position. aRect contains absolute image coordinates |
function SetPos($aRect) { |
assert( $this->prect != null ) ; |
$this->prect->SetPos($aRect); |
} |
function ShowFrame($aFlag=true) { |
$this->prect->ShowFrame($aFlag); |
} |
// Set z-order. In front of pplot or in the back |
function SetOrder($aDepth) { |
$this->depth=$aDepth; |
} |
function SetDensity($aDens) { |
$this->prect->SetDensity($aDens); |
} |
function GetDir() { |
return $this->dir; |
} |
function GetMin() { |
return $this->min; |
} |
function GetMax() { |
return $this->max; |
} |
function PreStrokeAdjust($aGraph) { |
// Nothing to do |
} |
// Display band |
function Stroke($aImg,$aXScale,$aYScale) { |
assert( $this->prect != null ) ; |
if( $this->dir == HORIZONTAL ) { |
if( $this->min === 'min' ) $this->min = $aYScale->GetMinVal(); |
if( $this->max === 'max' ) $this->max = $aYScale->GetMaxVal(); |
// Only draw the bar if it actually appears in the range |
if ($this->min < $aYScale->GetMaxVal() && $this->max > $aYScale->GetMinVal()) { |
// Trucate to limit of axis |
$this->min = max($this->min, $aYScale->GetMinVal()); |
$this->max = min($this->max, $aYScale->GetMaxVal()); |
$x=$aXScale->scale_abs[0]; |
$y=$aYScale->Translate($this->max); |
$width=$aXScale->scale_abs[1]-$aXScale->scale_abs[0]+1; |
$height=abs($y-$aYScale->Translate($this->min))+1; |
$this->prect->SetPos(new Rectangle($x,$y,$width,$height)); |
$this->prect->Stroke($aImg); |
} |
} |
else { // VERTICAL |
if( $this->min === 'min' ) $this->min = $aXScale->GetMinVal(); |
if( $this->max === 'max' ) $this->max = $aXScale->GetMaxVal(); |
// Only draw the bar if it actually appears in the range |
if ($this->min < $aXScale->GetMaxVal() && $this->max > $aXScale->GetMinVal()) { |
// Trucate to limit of axis |
$this->min = max($this->min, $aXScale->GetMinVal()); |
$this->max = min($this->max, $aXScale->GetMaxVal()); |
$y=$aYScale->scale_abs[1]; |
$x=$aXScale->Translate($this->min); |
$height=abs($aYScale->scale_abs[1]-$aYScale->scale_abs[0]); |
$width=abs($x-$aXScale->Translate($this->max)); |
$this->prect->SetPos(new Rectangle($x,$y,$width,$height)); |
$this->prect->Stroke($aImg); |
} |
} |
} |
} |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/jpgraph_led.php |
---|
New file |
0,0 → 1,311 |
<?php |
//======================================================================= |
// File: JPGRAPH_LED.PHP |
// Description: Module to generate Dotted LED-like digits |
// Created: 2006-11-26 |
// Ver: $Id: jpgraph_led.php 1674 2009-07-22 19:42:23Z ljp $ |
// |
// Copyright 2006 (c) Aditus Consulting. All rights reserved. |
// |
// Changed: 2007-08-06 by Alexander Kurochkin (inspector@list.ru) |
//======================================================================== |
// Constants for color schema |
DEFINE('LEDC_RED', 0); |
DEFINE('LEDC_GREEN', 1); |
DEFINE('LEDC_BLUE', 2); |
DEFINE('LEDC_YELLOW', 3); |
DEFINE('LEDC_GRAY', 4); |
DEFINE('LEDC_CHOCOLATE', 5); |
DEFINE('LEDC_PERU', 6); |
DEFINE('LEDC_GOLDENROD', 7); |
DEFINE('LEDC_KHAKI', 8); |
DEFINE('LEDC_OLIVE', 9); |
DEFINE('LEDC_LIMEGREEN', 10); |
DEFINE('LEDC_FORESTGREEN', 11); |
DEFINE('LEDC_TEAL', 12); |
DEFINE('LEDC_STEELBLUE', 13); |
DEFINE('LEDC_NAVY', 14); |
DEFINE('LEDC_INVERTGRAY', 15); |
// Check that mb_strlen() is available |
if( ! function_exists('mb_strlen') ) { |
JpGraphError::RaiseL(25500); |
//'Multibyte strings must be enabled in the PHP installation in order to run the LED module |
// so that the function mb_strlen() is available. See PHP documentation for more information.' |
} |
//======================================================================== |
// CLASS DigitalLED74 |
// Description: |
// Construct a number as an image that looks like LED numbers in a |
// 7x4 digital matrix |
//======================================================================== |
class DigitalLED74 |
{ |
private $iLED_X = 4, $iLED_Y=7, |
// fg-up, fg-down, bg |
$iColorSchema = array( |
LEDC_RED => array('red','darkred:0.9','red:0.3'),// 0 |
LEDC_GREEN => array('green','darkgreen','green:0.3'),// 1 |
LEDC_BLUE => array('lightblue:0.9','darkblue:0.85','darkblue:0.7'),// 2 |
LEDC_YELLOW => array('yellow','yellow:0.4','yellow:0.3'),// 3 |
LEDC_GRAY => array('gray:1.4','darkgray:0.85','darkgray:0.7'), |
LEDC_CHOCOLATE => array('chocolate','chocolate:0.7','chocolate:0.5'), |
LEDC_PERU => array('peru:0.95','peru:0.6','peru:0.5'), |
LEDC_GOLDENROD => array('goldenrod','goldenrod:0.6','goldenrod:0.5'), |
LEDC_KHAKI => array('khaki:0.7','khaki:0.4','khaki:0.3'), |
LEDC_OLIVE => array('#808000','#808000:0.7','#808000:0.6'), |
LEDC_LIMEGREEN => array('limegreen:0.9','limegreen:0.5','limegreen:0.4'), |
LEDC_FORESTGREEN => array('forestgreen','forestgreen:0.7','forestgreen:0.5'), |
LEDC_TEAL => array('teal','teal:0.7','teal:0.5'), |
LEDC_STEELBLUE => array('steelblue','steelblue:0.65','steelblue:0.5'), |
LEDC_NAVY => array('navy:1.3','navy:0.95','navy:0.8'),//14 |
LEDC_INVERTGRAY => array('darkgray','lightgray:1.5','white')//15 |
), |
/* Each line of the character is encoded as a 4 bit value |
0 ____ |
1 ___x |
2 __x_ |
3 __xx |
4 _x__ |
5 _x_x |
6 _xx_ |
7 _xxx |
8 x___ |
9 x__x |
10 x_x_ |
11 x_xx |
12 xx__ |
13 xx_x |
14 xxx_ |
15 xxxx |
*/ |
$iLEDSpec = array( |
0 => array(6,9,11,15,13,9,6), |
1 => array(2,6,10,2,2,2,2), |
2 => array(6,9,1,2,4,8,15), |
3 => array(6,9,1,6,1,9,6), |
4 => array(1,3,5,9,15,1,1), |
5 => array(15,8,8,14,1,9,6), |
6 => array(6,8,8,14,9,9,6), |
7 => array(15,1,1,2,4,4,4), |
8 => array(6,9,9,6,9,9,6), |
9 => array(6,9,9,7,1,1,6), |
'!' => array(4,4,4,4,4,0,4), |
'?' => array(6,9,1,2,2,0,2), |
'#' => array(0,9,15,9,15,9,0), |
'@' => array(6,9,11,11,10,9,6), |
'-' => array(0,0,0,15,0,0,0), |
'_' => array(0,0,0,0,0,0,15), |
'=' => array(0,0,15,0,15,0,0), |
'+' => array(0,0,4,14,4,0,0), |
'|' => array(4,4,4,4,4,4,4), //vertical line, used for simulate rus 'Ы' |
',' => array(0,0,0,0,0,12,4), |
'.' => array(0,0,0,0,0,12,12), |
':' => array(12,12,0,0,0,12,12), |
';' => array(12,12,0,0,0,12,4), |
'[' => array(3,2,2,2,2,2,3), |
']' => array(12,4,4,4,4,4,12), |
'(' => array(1,2,2,2,2,2,1), |
')' => array(8,4,4,4,4,4,8), |
'{' => array(3,2,2,6,2,2,3), |
'}' => array(12,4,4,6,4,4,12), |
'<' => array(1,2,4,8,4,2,1), |
'>' => array(8,4,2,1,2,4,8), |
'*' => array(9,6,15,6,9,0,0), |
'"' => array(10,10,0,0,0,0,0), |
'\'' => array(4,4,0,0,0,0,0), |
'`' => array(4,2,0,0,0,0,0), |
'~' => array(13,11,0,0,0,0,0), |
'^' => array(4,10,0,0,0,0,0), |
'\\' => array(8,8,4,6,2,1,1), |
'/' => array(1,1,2,6,4,8,8), |
'%' => array(1,9,2,6,4,9,8), |
'&' => array(0,4,10,4,11,10,5), |
'$' => array(2,7,8,6,1,14,4), |
' ' => array(0,0,0,0,0,0,0), |
'•' => array(0,0,6,6,0,0,0), //149 |
'°' => array(14,10,14,0,0,0,0), //176 |
'†' => array(4,4,14,4,4,4,4), //134 |
'‡' => array(4,4,14,4,14,4,4), //135 |
'±' => array(0,4,14,4,0,14,0), //177 |
'‰' => array(0,4,2,15,2,4,0), //137 show right arrow |
'™' => array(0,2,4,15,4,2,0), //156 show left arrow |
'Ў' => array(0,0,8,8,0,0,0), //159 show small hi-stick - that need for simulate rus 'Ф' |
"\t" => array(8,8,8,0,0,0,0), //show hi-stick - that need for simulate rus 'У' |
"\r" => array(8,8,8,8,8,8,8), //vertical line - that need for simulate 'M', 'W' and rus 'М','Ш' ,'Щ' |
"\n" => array(15,15,15,15,15,15,15), //fill up - that need for simulate rus 'Ж' |
"Ґ" => array(10,5,10,5,10,5,10), //chess |
"µ" => array(15,0,15,0,15,0,15), //4 horizontal lines |
// latin |
'A' => array(6,9,9,15,9,9,9), |
'B' => array(14,9,9,14,9,9,14), |
'C' => array(6,9,8,8,8,9,6), |
'D' => array(14,9,9,9,9,9,14), |
'E' => array(15,8,8,14,8,8,15), |
'F' => array(15,8,8,14,8,8,8), |
'G' => array(6,9,8,8,11,9,6), |
'H' => array(9,9,9,15,9,9,9), |
'I' => array(14,4,4,4,4,4,14), |
'J' => array(15,1,1,1,1,9,6), |
'K' => array(8,9,10,12,12,10,9), |
'L' => array(8,8,8,8,8,8,15), |
'M' => array(8,13,10,8,8,8,8),// need to add \r |
'N' => array(9,9,13,11,9,9,9), |
'O' => array(6,9,9,9,9,9,6), |
'P' => array(14,9,9,14,8,8,8), |
'Q' => array(6,9,9,9,13,11,6), |
'R' => array(14,9,9,14,12,10,9), |
'S' => array(6,9,8,6,1,9,6), |
'T' => array(14,4,4,4,4,4,4), |
'U' => array(9,9,9,9,9,9,6), |
'V' => array(0,0,0,10,10,10,4), |
'W' => array(8,8,8,8,10,13,8),// need to add \r |
'X' => array(9,9,6,6,6,9,9), |
'Y' => array(10,10,10,10,4,4,4), |
'Z' => array(15,1,2,6,4,8,15), |
// russian utf-8 |
'А' => array(6,9,9,15,9,9,9), |
'Б' => array(14,8,8,14,9,9,14), |
'В' => array(14,9,9,14,9,9,14), |
'Г' => array(15,8,8,8,8,8,8), |
'Д' => array(14,9,9,9,9,9,14), |
'Е' => array(15,8,8,14,8,8,15), |
'Ё' => array(6,15,8,14,8,8,15), |
//Ж is combine: >\n< |
'З' => array(6,9,1,2,1,9,6), |
'И' => array(9,9,9,11,13,9,9), |
'Й' => array(13,9,9,11,13,9,9), |
'К' => array(9,10,12,10,9,9,9), |
'Л' => array(7,9,9,9,9,9,9), |
'М' => array(8,13,10,8,8,8,8),// need to add \r |
'Н' => array(9,9,9,15,9,9,9), |
'О' => array(6,9,9,9,9,9,6), |
'П' => array(15,9,9,9,9,9,9), |
'Р' => array(14,9,9,14,8,8,8), |
'С' => array(6,9,8,8,8,9,6), |
'Т' => array(14,4,4,4,4,4,4), |
'У' => array(9,9,9,7,1,9,6), |
'Ф' => array(2,7,10,10,7,2,2),// need to add Ў |
'Х' => array(9,9,6,6,6,9,9), |
'Ц' => array(10,10,10,10,10,15,1), |
'Ч' => array(9,9,9,7,1,1,1), |
'Ш' => array(10,10,10,10,10,10,15),// \r |
'Щ' => array(10,10,10,10,10,15,0),// need to add \r |
'Ъ' => array(12,4,4,6,5,5,6), |
'Ы' => array(8,8,8,14,9,9,14),// need to add | |
'Ь' => array(8,8,8,14,9,9,14), |
'Э' => array(6,9,1,7,1,9,6), |
'Ю' => array(2,2,2,3,2,2,2),// need to add O |
'Я' => array(7,9,9,7,3,5,9) |
), |
$iSuperSampling = 3, $iMarg = 1, $iRad = 4; |
function __construct($aRadius = 2, $aMargin= 0.6) { |
$this->iRad = $aRadius; |
$this->iMarg = $aMargin; |
} |
function SetSupersampling($aSuperSampling = 2) { |
$this->iSuperSampling = $aSuperSampling; |
} |
function _GetLED($aLedIdx, $aColor = 0) { |
$width= $this->iLED_X*$this->iRad*2 + ($this->iLED_X+1)*$this->iMarg + $this->iRad ; |
$height= $this->iLED_Y*$this->iRad*2 + ($this->iLED_Y)*$this->iMarg + $this->iRad * 2; |
// Adjust radious for supersampling |
$rad = $this->iRad * $this->iSuperSampling; |
// Margin in between "Led" dots |
$marg = $this->iMarg * $this->iSuperSampling; |
$swidth = $width*$this->iSuperSampling; |
$sheight = $height*$this->iSuperSampling; |
$simg = new RotImage($swidth, $sheight, 0, DEFAULT_GFORMAT, false); |
$simg->SetColor($this->iColorSchema[$aColor][2]); |
$simg->FilledRectangle(0, 0, $swidth-1, $sheight-1); |
if( array_key_exists($aLedIdx, $this->iLEDSpec) ) { |
$d = $this->iLEDSpec[$aLedIdx]; |
} |
else { |
$d = array(0,0,0,0,0,0,0); |
} |
for($r = 0; $r < 7; ++$r) { |
$dr = $d[$r]; |
for($c = 0; $c < 4; ++$c) { |
if( ($dr & pow(2,3-$c)) !== 0 ) { |
$color = $this->iColorSchema[$aColor][0]; |
} |
else { |
$color = $this->iColorSchema[$aColor][1]; |
} |
$x = 2*$rad*$c+$rad + ($c+1)*$marg + $rad ; |
$y = 2*$rad*$r+$rad + ($r+1)*$marg + $rad ; |
$simg->SetColor($color); |
$simg->FilledCircle($x,$y,$rad); |
} |
} |
$img = new Image($width, $height, DEFAULT_GFORMAT, false); |
$img->Copy($simg->img, 0, 0, 0, 0, $width, $height, $swidth, $sheight); |
$simg->Destroy(); |
unset($simg); |
return $img; |
} |
function Stroke($aValStr, $aColor = 0, $aFileName = '') { |
$this->StrokeNumber($aValStr, $aColor, $aFileName); |
} |
function StrokeNumber($aValStr, $aColor = 0, $aFileName = '') { |
if( $aColor < 0 || $aColor >= sizeof($this->iColorSchema) ) { |
$aColor = 0; |
} |
if(($n = mb_strlen($aValStr,'utf8')) == 0) { |
$aValStr = ' '; |
$n = 1; |
} |
for($i = 0; $i < $n; ++$i) { |
$d = mb_substr($aValStr, $i, 1, 'utf8'); |
if( ctype_digit($d) ) { |
$d = (int)$d; |
} |
else { |
$d = strtoupper($d); |
} |
$digit_img[$i] = $this->_GetLED($d, $aColor); |
} |
$w = imagesx($digit_img[0]->img); |
$h = imagesy($digit_img[0]->img); |
$number_img = new Image($w*$n, $h, DEFAULT_GFORMAT, false); |
for($i = 0; $i < $n; ++$i) { |
$number_img->Copy($digit_img[$i]->img, $i*$w, 0, 0, 0, $w, $h, $w, $h); |
} |
if( $aFileName != '' ) { |
$number_img->Stream($aFileName); |
} else { |
$number_img->Headers(); |
$number_img->Stream(); |
} |
} |
} |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/jpgraph_bar.php |
---|
New file |
0,0 → 1,1136 |
<?php |
/*======================================================================= |
// File: JPGRAPH_BAR.PHP |
// Description: Bar plot extension for JpGraph |
// Created: 2001-01-08 |
// Ver: $Id: jpgraph_bar.php 1905 2009-10-06 18:00:21Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
*/ |
require_once('jpgraph_plotband.php'); |
// Pattern for Bars |
DEFINE('PATTERN_DIAG1',1); |
DEFINE('PATTERN_DIAG2',2); |
DEFINE('PATTERN_DIAG3',3); |
DEFINE('PATTERN_DIAG4',4); |
DEFINE('PATTERN_CROSS1',5); |
DEFINE('PATTERN_CROSS2',6); |
DEFINE('PATTERN_CROSS3',7); |
DEFINE('PATTERN_CROSS4',8); |
DEFINE('PATTERN_STRIPE1',9); |
DEFINE('PATTERN_STRIPE2',10); |
//=================================================== |
// CLASS BarPlot |
// Description: Main code to produce a bar plot |
//=================================================== |
class BarPlot extends Plot { |
public $fill=false,$fill_color="lightblue"; // Default is to fill with light blue |
public $iPattern=-1,$iPatternDensity=80,$iPatternColor='black'; |
public $valuepos='top'; |
public $grad=false,$grad_style=1; |
public $grad_fromcolor=array(50,50,200),$grad_tocolor=array(255,255,255); |
public $ymin=0; |
protected $width=0.4; // in percent of major ticks |
protected $abswidth=-1; // Width in absolute pixels |
protected $ybase=0; // Bars start at 0 |
protected $align="center"; |
protected $bar_shadow=false; |
protected $bar_shadow_color="black"; |
protected $bar_shadow_hsize=3,$bar_shadow_vsize=3; |
//--------------- |
// CONSTRUCTOR |
function __construct($datay,$datax=false) { |
parent::__construct($datay,$datax); |
++$this->numpoints; |
} |
//--------------- |
// PUBLIC METHODS |
// Set a drop shadow for the bar (or rather an "up-right" shadow) |
function SetShadow($aColor="black",$aHSize=3,$aVSize=3,$aShow=true) { |
$this->bar_shadow=$aShow; |
$this->bar_shadow_color=$aColor; |
$this->bar_shadow_vsize=$aVSize; |
$this->bar_shadow_hsize=$aHSize; |
// Adjust the value margin to compensate for shadow |
$this->value->margin += $aVSize; |
} |
// DEPRECATED use SetYBase instead |
function SetYMin($aYStartValue) { |
//die("JpGraph Error: Deprecated function SetYMin. Use SetYBase() instead."); |
$this->ybase=$aYStartValue; |
} |
// Specify the base value for the bars |
function SetYBase($aYStartValue) { |
$this->ybase=$aYStartValue; |
} |
// The method will take the specified pattern anre |
// return a pattern index that corresponds to the original |
// patterm being rotated 90 degreees. This is needed when plottin |
// Horizontal bars |
function RotatePattern($aPat,$aRotate=true) { |
$rotate = array(1 => 2, 2 => 1, 3 => 3, 4 => 5, 5 => 4, 6 => 6, 7 => 7, 8 => 8); |
if( $aRotate ) { |
return $rotate[$aPat]; |
} |
else { |
return $aPat; |
} |
} |
function Legend($graph) { |
if( $this->grad && $this->legend!="" && !$this->fill ) { |
$color=array($this->grad_fromcolor,$this->grad_tocolor); |
// In order to differentiate between gradients and cooors specified as an RGB triple |
$graph->legend->Add($this->legend,$color,"",-$this->grad_style, |
$this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); |
} |
elseif( $this->legend!="" && ($this->iPattern > -1 || is_array($this->iPattern)) ) { |
if( is_array($this->iPattern) ) { |
$p1 = $this->RotatePattern( $this->iPattern[0], $graph->img->a == 90 ); |
$p2 = $this->iPatternColor[0]; |
$p3 = $this->iPatternDensity[0]; |
} |
else { |
$p1 = $this->RotatePattern( $this->iPattern, $graph->img->a == 90 ); |
$p2 = $this->iPatternColor; |
$p3 = $this->iPatternDensity; |
} |
if( $p3 < 90 ) $p3 += 5; |
$color = array($p1,$p2,$p3,$this->fill_color); |
// A kludge: Too mark that we add a pattern we use a type value of < 100 |
$graph->legend->Add($this->legend,$color,"",-101, |
$this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); |
} |
elseif( $this->fill_color && $this->legend!="" ) { |
if( is_array($this->fill_color) ) { |
$graph->legend->Add($this->legend,$this->fill_color[0],"",0, |
$this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); |
} |
else { |
$graph->legend->Add($this->legend,$this->fill_color,"",0, |
$this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); |
} |
} |
} |
// Gets called before any axis are stroked |
function PreStrokeAdjust($graph) { |
parent::PreStrokeAdjust($graph); |
// If we are using a log Y-scale we want the base to be at the |
// minimum Y-value unless the user have specifically set some other |
// value than the default. |
if( substr($graph->axtype,-3,3)=="log" && $this->ybase==0 ) |
$this->ybase = $graph->yaxis->scale->GetMinVal(); |
// For a "text" X-axis scale we will adjust the |
// display of the bars a little bit. |
if( substr($graph->axtype,0,3)=="tex" ) { |
// Position the ticks between the bars |
$graph->xaxis->scale->ticks->SetXLabelOffset(0.5,0); |
// Center the bars |
if( $this->abswidth > -1 ) { |
$graph->SetTextScaleAbsCenterOff($this->abswidth); |
} |
else { |
if( $this->align == "center" ) |
$graph->SetTextScaleOff(0.5-$this->width/2); |
elseif( $this->align == "right" ) |
$graph->SetTextScaleOff(1-$this->width); |
} |
} |
elseif( ($this instanceof AccBarPlot) || ($this instanceof GroupBarPlot) ) { |
// We only set an absolute width for linear and int scale |
// for text scale the width will be set to a fraction of |
// the majstep width. |
if( $this->abswidth == -1 ) { |
// Not set |
// set width to a visuable sensible default |
$this->abswidth = $graph->img->plotwidth/(2*$this->numpoints); |
} |
} |
} |
function Min() { |
$m = parent::Min(); |
if( $m[1] >= $this->ybase ) $m[1] = $this->ybase; |
return $m; |
} |
function Max() { |
$m = parent::Max(); |
if( $m[1] <= $this->ybase ) $m[1] = $this->ybase; |
return $m; |
} |
// Specify width as fractions of the major stepo size |
function SetWidth($aWidth) { |
if( $aWidth > 1 ) { |
// Interpret this as absolute width |
$this->abswidth=$aWidth; |
} |
else { |
$this->width=$aWidth; |
} |
} |
// Specify width in absolute pixels. If specified this |
// overrides SetWidth() |
function SetAbsWidth($aWidth) { |
$this->abswidth=$aWidth; |
} |
function SetAlign($aAlign) { |
$this->align=$aAlign; |
} |
function SetNoFill() { |
$this->grad = false; |
$this->fill_color=false; |
$this->fill=false; |
} |
function SetFillColor($aColor) { |
// Do an extra error check if the color is specified as an RGB array triple |
// In that case convert it to a hex string since it will otherwise be |
// interpretated as an array of colors for each individual bar. |
$aColor = RGB::tryHexConversion($aColor); |
$this->fill = true ; |
$this->fill_color=$aColor; |
} |
function SetFillGradient($aFromColor,$aToColor=null,$aStyle=null) { |
$this->grad = true; |
$this->grad_fromcolor = $aFromColor; |
$this->grad_tocolor = $aToColor; |
$this->grad_style = $aStyle; |
} |
function SetValuePos($aPos) { |
$this->valuepos = $aPos; |
} |
function SetPattern($aPattern, $aColor='black'){ |
if( is_array($aPattern) ) { |
$n = count($aPattern); |
$this->iPattern = array(); |
$this->iPatternDensity = array(); |
if( is_array($aColor) ) { |
$this->iPatternColor = array(); |
if( count($aColor) != $n ) { |
JpGraphError::RaiseL(2001);//('NUmber of colors is not the same as the number of patterns in BarPlot::SetPattern()'); |
} |
} |
else { |
$this->iPatternColor = $aColor; |
} |
for( $i=0; $i < $n; ++$i ) { |
$this->_SetPatternHelper($aPattern[$i], $this->iPattern[$i], $this->iPatternDensity[$i]); |
if( is_array($aColor) ) { |
$this->iPatternColor[$i] = $aColor[$i]; |
} |
} |
} |
else { |
$this->_SetPatternHelper($aPattern, $this->iPattern, $this->iPatternDensity); |
$this->iPatternColor = $aColor; |
} |
} |
function _SetPatternHelper($aPattern, &$aPatternValue, &$aDensity){ |
switch( $aPattern ) { |
case PATTERN_DIAG1: |
$aPatternValue= 1; |
$aDensity = 92; |
break; |
case PATTERN_DIAG2: |
$aPatternValue= 1; |
$aDensity = 78; |
break; |
case PATTERN_DIAG3: |
$aPatternValue= 2; |
$aDensity = 92; |
break; |
case PATTERN_DIAG4: |
$aPatternValue= 2; |
$aDensity = 78; |
break; |
case PATTERN_CROSS1: |
$aPatternValue= 8; |
$aDensity = 90; |
break; |
case PATTERN_CROSS2: |
$aPatternValue= 8; |
$aDensity = 78; |
break; |
case PATTERN_CROSS3: |
$aPatternValue= 8; |
$aDensity = 65; |
break; |
case PATTERN_CROSS4: |
$aPatternValue= 7; |
$aDensity = 90; |
break; |
case PATTERN_STRIPE1: |
$aPatternValue= 5; |
$aDensity = 94; |
break; |
case PATTERN_STRIPE2: |
$aPatternValue= 5; |
$aDensity = 85; |
break; |
default: |
JpGraphError::RaiseL(2002); |
//('Unknown pattern specified in call to BarPlot::SetPattern()'); |
} |
} |
function Stroke($img,$xscale,$yscale) { |
$numpoints = count($this->coords[0]); |
if( isset($this->coords[1]) ) { |
if( count($this->coords[1])!=$numpoints ) { |
JpGraphError::RaiseL(2003,count($this->coords[1]),$numpoints); |
//"Number of X and Y points are not equal. Number of X-points:".count($this->coords[1])."Number of Y-points:$numpoints"); |
} |
else { |
$exist_x = true; |
} |
} |
else { |
$exist_x = false; |
} |
$numbars=count($this->coords[0]); |
// Use GetMinVal() instead of scale[0] directly since in the case |
// of log scale we get a correct value. Log scales will have negative |
// values for values < 1 while still not representing negative numbers. |
if( $yscale->GetMinVal() >= 0 ) |
$zp=$yscale->scale_abs[0]; |
else { |
$zp=$yscale->Translate(0); |
} |
if( $this->abswidth > -1 ) { |
$abswidth=$this->abswidth; |
} |
else { |
$abswidth=round($this->width*$xscale->scale_factor,0); |
} |
// Count pontetial pattern array to avoid doing the count for each iteration |
if( is_array($this->iPattern) ) { |
$np = count($this->iPattern); |
} |
$grad = null; |
for($i=0; $i < $numbars; ++$i) { |
// If value is NULL, or 0 then don't draw a bar at all |
if ($this->coords[0][$i] === null || $this->coords[0][$i] === '' ) |
continue; |
if( $exist_x ) { |
$x=$this->coords[1][$i]; |
} |
else { |
$x=$i; |
} |
$x=$xscale->Translate($x); |
// Comment Note: This confuses the positioning when using acc together with |
// grouped bars. Workaround for fixing #191 |
/* |
if( !$xscale->textscale ) { |
if($this->align=="center") |
$x -= $abswidth/2; |
elseif($this->align=="right") |
$x -= $abswidth; |
} |
*/ |
// Stroke fill color and fill gradient |
$pts=array( |
$x,$zp, |
$x,$yscale->Translate($this->coords[0][$i]), |
$x+$abswidth,$yscale->Translate($this->coords[0][$i]), |
$x+$abswidth,$zp); |
if( $this->grad ) { |
if( $grad === null ) { |
$grad = new Gradient($img); |
} |
if( is_array($this->grad_fromcolor) ) { |
// The first argument (grad_fromcolor) can be either an array or a single color. If it is an array |
// then we have two choices. It can either a) be a single color specified as an RGB triple or it can be |
// an array to specify both (from, to style) for each individual bar. The way to know the difference is |
// to investgate the first element. If this element is an integer [0,255] then we assume it is an RGB |
// triple. |
$ng = count($this->grad_fromcolor); |
if( $ng === 3 ) { |
if( is_numeric($this->grad_fromcolor[0]) && $this->grad_fromcolor[0] > 0 && $this->grad_fromcolor[0] < 256 ) { |
// RGB Triple |
$fromcolor = $this->grad_fromcolor; |
$tocolor = $this->grad_tocolor; |
$style = $this->grad_style; |
} |
else { |
$fromcolor = $this->grad_fromcolor[$i % $ng][0]; |
$tocolor = $this->grad_fromcolor[$i % $ng][1]; |
$style = $this->grad_fromcolor[$i % $ng][2]; |
} |
} |
else { |
$fromcolor = $this->grad_fromcolor[$i % $ng][0]; |
$tocolor = $this->grad_fromcolor[$i % $ng][1]; |
$style = $this->grad_fromcolor[$i % $ng][2]; |
} |
$grad->FilledRectangle($pts[2],$pts[3], |
$pts[6],$pts[7], |
$fromcolor,$tocolor,$style); |
} |
else { |
$grad->FilledRectangle($pts[2],$pts[3], |
$pts[6],$pts[7], |
$this->grad_fromcolor,$this->grad_tocolor,$this->grad_style); |
} |
} |
elseif( !empty($this->fill_color) ) { |
if(is_array($this->fill_color)) { |
$img->PushColor($this->fill_color[$i % count($this->fill_color)]); |
} else { |
$img->PushColor($this->fill_color); |
} |
$img->FilledPolygon($pts); |
$img->PopColor(); |
} |
// Remember value of this bar |
$val=$this->coords[0][$i]; |
if( !empty($val) && !is_numeric($val) ) { |
JpGraphError::RaiseL(2004,$i,$val); |
//'All values for a barplot must be numeric. You have specified value['.$i.'] == \''.$val.'\''); |
} |
// Determine the shadow |
if( $this->bar_shadow && $val != 0) { |
$ssh = $this->bar_shadow_hsize; |
$ssv = $this->bar_shadow_vsize; |
// Create points to create a "upper-right" shadow |
if( $val > 0 ) { |
$sp[0]=$pts[6]; $sp[1]=$pts[7]; |
$sp[2]=$pts[4]; $sp[3]=$pts[5]; |
$sp[4]=$pts[2]; $sp[5]=$pts[3]; |
$sp[6]=$pts[2]+$ssh; $sp[7]=$pts[3]-$ssv; |
$sp[8]=$pts[4]+$ssh; $sp[9]=$pts[5]-$ssv; |
$sp[10]=$pts[6]+$ssh; $sp[11]=$pts[7]-$ssv; |
} |
elseif( $val < 0 ) { |
$sp[0]=$pts[4]; $sp[1]=$pts[5]; |
$sp[2]=$pts[6]; $sp[3]=$pts[7]; |
$sp[4]=$pts[0]; $sp[5]=$pts[1]; |
$sp[6]=$pts[0]+$ssh; $sp[7]=$pts[1]-$ssv; |
$sp[8]=$pts[6]+$ssh; $sp[9]=$pts[7]-$ssv; |
$sp[10]=$pts[4]+$ssh; $sp[11]=$pts[5]-$ssv; |
} |
if( is_array($this->bar_shadow_color) ) { |
$numcolors = count($this->bar_shadow_color); |
if( $numcolors == 0 ) { |
JpGraphError::RaiseL(2005);//('You have specified an empty array for shadow colors in the bar plot.'); |
} |
$img->PushColor($this->bar_shadow_color[$i % $numcolors]); |
} |
else { |
$img->PushColor($this->bar_shadow_color); |
} |
$img->FilledPolygon($sp); |
$img->PopColor(); |
} |
// Stroke the pattern |
if( is_array($this->iPattern) ) { |
$f = new RectPatternFactory(); |
if( is_array($this->iPatternColor) ) { |
$pcolor = $this->iPatternColor[$i % $np]; |
} |
else { |
$pcolor = $this->iPatternColor; |
} |
$prect = $f->Create($this->iPattern[$i % $np],$pcolor,1); |
$prect->SetDensity($this->iPatternDensity[$i % $np]); |
if( $val < 0 ) { |
$rx = $pts[0]; |
$ry = $pts[1]; |
} |
else { |
$rx = $pts[2]; |
$ry = $pts[3]; |
} |
$width = abs($pts[4]-$pts[0])+1; |
$height = abs($pts[1]-$pts[3])+1; |
$prect->SetPos(new Rectangle($rx,$ry,$width,$height)); |
$prect->Stroke($img); |
} |
else { |
if( $this->iPattern > -1 ) { |
$f = new RectPatternFactory(); |
$prect = $f->Create($this->iPattern,$this->iPatternColor,1); |
$prect->SetDensity($this->iPatternDensity); |
if( $val < 0 ) { |
$rx = $pts[0]; |
$ry = $pts[1]; |
} |
else { |
$rx = $pts[2]; |
$ry = $pts[3]; |
} |
$width = abs($pts[4]-$pts[0])+1; |
$height = abs($pts[1]-$pts[3])+1; |
$prect->SetPos(new Rectangle($rx,$ry,$width,$height)); |
$prect->Stroke($img); |
} |
} |
// Stroke the outline of the bar |
if( is_array($this->color) ) { |
$img->SetColor($this->color[$i % count($this->color)]); |
} |
else { |
$img->SetColor($this->color); |
} |
$pts[] = $pts[0]; |
$pts[] = $pts[1]; |
if( $this->weight > 0 ) { |
$img->SetLineWeight($this->weight); |
$img->Polygon($pts); |
} |
// Determine how to best position the values of the individual bars |
$x=$pts[2]+($pts[4]-$pts[2])/2; |
$this->value->SetMargin(5); |
if( $this->valuepos=='top' ) { |
$y=$pts[3]; |
if( $img->a === 90 ) { |
if( $val < 0 ) { |
$this->value->SetAlign('right','center'); |
} |
else { |
$this->value->SetAlign('left','center'); |
} |
} |
else { |
if( $val < 0 ) { |
$this->value->SetMargin(-5); |
$y=$pts[1]; |
$this->value->SetAlign('center','bottom'); |
} |
else { |
$this->value->SetAlign('center','bottom'); |
} |
} |
$this->value->Stroke($img,$val,$x,$y); |
} |
elseif( $this->valuepos=='max' ) { |
$y=$pts[3]; |
if( $img->a === 90 ) { |
if( $val < 0 ) |
$this->value->SetAlign('left','center'); |
else |
$this->value->SetAlign('right','center'); |
} |
else { |
if( $val < 0 ) { |
$this->value->SetAlign('center','bottom'); |
} |
else { |
$this->value->SetAlign('center','top'); |
} |
} |
$this->value->SetMargin(-5); |
$this->value->Stroke($img,$val,$x,$y); |
} |
elseif( $this->valuepos=='center' ) { |
$y = ($pts[3] + $pts[1])/2; |
$this->value->SetAlign('center','center'); |
$this->value->SetMargin(0); |
$this->value->Stroke($img,$val,$x,$y); |
} |
elseif( $this->valuepos=='bottom' || $this->valuepos=='min' ) { |
$y=$pts[1]; |
if( $img->a === 90 ) { |
if( $val < 0 ) |
$this->value->SetAlign('right','center'); |
else |
$this->value->SetAlign('left','center'); |
} |
$this->value->SetMargin(3); |
$this->value->Stroke($img,$val,$x,$y); |
} |
else { |
JpGraphError::RaiseL(2006,$this->valuepos); |
//'Unknown position for values on bars :'.$this->valuepos); |
} |
// Create the client side image map |
$rpts = $img->ArrRotate($pts); |
$csimcoord=round($rpts[0]).", ".round($rpts[1]); |
for( $j=1; $j < 4; ++$j){ |
$csimcoord .= ", ".round($rpts[2*$j]).", ".round($rpts[2*$j+1]); |
} |
if( !empty($this->csimtargets[$i]) ) { |
$this->csimareas .= '<area shape="poly" coords="'.$csimcoord.'" '; |
$this->csimareas .= " href=\"".htmlentities($this->csimtargets[$i])."\""; |
if( !empty($this->csimwintargets[$i]) ) { |
$this->csimareas .= " target=\"".$this->csimwintargets[$i]."\" "; |
} |
$sval=''; |
if( !empty($this->csimalts[$i]) ) { |
$sval=sprintf($this->csimalts[$i],$this->coords[0][$i]); |
$this->csimareas .= " title=\"$sval\" alt=\"$sval\" "; |
} |
$this->csimareas .= " />\n"; |
} |
} |
return true; |
} |
} // Class |
//=================================================== |
// CLASS GroupBarPlot |
// Description: Produce grouped bar plots |
//=================================================== |
class GroupBarPlot extends BarPlot { |
private $plots, $nbrplots=0; |
//--------------- |
// CONSTRUCTOR |
function GroupBarPlot($plots) { |
$this->width=0.7; |
$this->plots = $plots; |
$this->nbrplots = count($plots); |
if( $this->nbrplots < 1 ) { |
JpGraphError::RaiseL(2007);//('Cannot create GroupBarPlot from empty plot array.'); |
} |
for($i=0; $i < $this->nbrplots; ++$i ) { |
if( empty($this->plots[$i]) || !isset($this->plots[$i]) ) { |
JpGraphError::RaiseL(2008,$i);//("Group bar plot element nbr $i is undefined or empty."); |
} |
} |
$this->numpoints = $plots[0]->numpoints; |
$this->width=0.7; |
} |
//--------------- |
// PUBLIC METHODS |
function Legend($graph) { |
$n = count($this->plots); |
for($i=0; $i < $n; ++$i) { |
$c = get_class($this->plots[$i]); |
if( !($this->plots[$i] instanceof BarPlot) ) { |
JpGraphError::RaiseL(2009,$c); |
//('One of the objects submitted to GroupBar is not a BarPlot. Make sure that you create the Group Bar plot from an array of BarPlot or AccBarPlot objects. (Class = '.$c.')'); |
} |
$this->plots[$i]->DoLegend($graph); |
} |
} |
function Min() { |
list($xmin,$ymin) = $this->plots[0]->Min(); |
$n = count($this->plots); |
for($i=0; $i < $n; ++$i) { |
list($xm,$ym) = $this->plots[$i]->Min(); |
$xmin = max($xmin,$xm); |
$ymin = min($ymin,$ym); |
} |
return array($xmin,$ymin); |
} |
function Max() { |
list($xmax,$ymax) = $this->plots[0]->Max(); |
$n = count($this->plots); |
for($i=0; $i < $n; ++$i) { |
list($xm,$ym) = $this->plots[$i]->Max(); |
$xmax = max($xmax,$xm); |
$ymax = max($ymax,$ym); |
} |
return array($xmax,$ymax); |
} |
function GetCSIMareas() { |
$n = count($this->plots); |
$csimareas=''; |
for($i=0; $i < $n; ++$i) { |
$csimareas .= $this->plots[$i]->csimareas; |
} |
return $csimareas; |
} |
// Stroke all the bars next to each other |
function Stroke($img,$xscale,$yscale) { |
$tmp=$xscale->off; |
$n = count($this->plots); |
$subwidth = $this->width/$this->nbrplots ; |
for( $i=0; $i < $n; ++$i ) { |
$this->plots[$i]->ymin=$this->ybase; |
$this->plots[$i]->SetWidth($subwidth); |
// If the client have used SetTextTickInterval() then |
// major_step will be > 1 and the positioning will fail. |
// If we assume it is always one the positioning will work |
// fine with a text scale but this will not work with |
// arbitrary linear scale |
$xscale->off = $tmp+$i*round($xscale->scale_factor* $subwidth); |
$this->plots[$i]->Stroke($img,$xscale,$yscale); |
} |
$xscale->off=$tmp; |
} |
} // Class |
//=================================================== |
// CLASS AccBarPlot |
// Description: Produce accumulated bar plots |
//=================================================== |
class AccBarPlot extends BarPlot { |
private $plots=null,$nbrplots=0; |
//--------------- |
// CONSTRUCTOR |
function __construct($plots) { |
$this->plots = $plots; |
$this->nbrplots = count($plots); |
if( $this->nbrplots < 1 ) { |
JpGraphError::RaiseL(2010);//('Cannot create AccBarPlot from empty plot array.'); |
} |
for($i=0; $i < $this->nbrplots; ++$i ) { |
if( empty($this->plots[$i]) || !isset($this->plots[$i]) ) { |
JpGraphError::RaiseL(2011,$i);//("Acc bar plot element nbr $i is undefined or empty."); |
} |
} |
// We can only allow individual plost which do not have specified X-positions |
for($i=0; $i < $this->nbrplots; ++$i ) { |
if( !empty($this->plots[$i]->coords[1]) ) { |
JpGraphError::RaiseL(2015); |
//'Individual bar plots in an AccBarPlot or GroupBarPlot can not have specified X-positions.'); |
} |
} |
// Use 0 weight by default which means that the individual bar |
// weights will be used per part n the accumulated bar |
$this->SetWeight(0); |
$this->numpoints = $plots[0]->numpoints; |
$this->value = new DisplayValue(); |
} |
//--------------- |
// PUBLIC METHODS |
function Legend($graph) { |
$n = count($this->plots); |
for( $i=$n-1; $i >= 0; --$i ) { |
$c = get_class($this->plots[$i]); |
if( !($this->plots[$i] instanceof BarPlot) ) { |
JpGraphError::RaiseL(2012,$c); |
//('One of the objects submitted to AccBar is not a BarPlot. Make sure that you create the AccBar plot from an array of BarPlot objects.(Class='.$c.')'); |
} |
$this->plots[$i]->DoLegend($graph); |
} |
} |
function Max() { |
list($xmax) = $this->plots[0]->Max(); |
$nmax=0; |
for($i=0; $i < count($this->plots); ++$i) { |
$n = count($this->plots[$i]->coords[0]); |
$nmax = max($nmax,$n); |
list($x) = $this->plots[$i]->Max(); |
$xmax = max($xmax,$x); |
} |
for( $i = 0; $i < $nmax; $i++ ) { |
// Get y-value for bar $i by adding the |
// individual bars from all the plots added. |
// It would be wrong to just add the |
// individual plots max y-value since that |
// would in most cases give to large y-value. |
$y=0; |
if( !isset($this->plots[0]->coords[0][$i]) ) { |
JpGraphError::RaiseL(2014); |
} |
if( $this->plots[0]->coords[0][$i] > 0 ) |
$y=$this->plots[0]->coords[0][$i]; |
for( $j = 1; $j < $this->nbrplots; $j++ ) { |
if( !isset($this->plots[$j]->coords[0][$i]) ) { |
JpGraphError::RaiseL(2014); |
} |
if( $this->plots[$j]->coords[0][$i] > 0 ) |
$y += $this->plots[$j]->coords[0][$i]; |
} |
$ymax[$i] = $y; |
} |
$ymax = max($ymax); |
// Bar always start at baseline |
if( $ymax <= $this->ybase ) |
$ymax = $this->ybase; |
return array($xmax,$ymax); |
} |
function Min() { |
$nmax=0; |
list($xmin,$ysetmin) = $this->plots[0]->Min(); |
for($i=0; $i < count($this->plots); ++$i) { |
$n = count($this->plots[$i]->coords[0]); |
$nmax = max($nmax,$n); |
list($x,$y) = $this->plots[$i]->Min(); |
$xmin = Min($xmin,$x); |
$ysetmin = Min($y,$ysetmin); |
} |
for( $i = 0; $i < $nmax; $i++ ) { |
// Get y-value for bar $i by adding the |
// individual bars from all the plots added. |
// It would be wrong to just add the |
// individual plots max y-value since that |
// would in most cases give to large y-value. |
$y=0; |
if( $this->plots[0]->coords[0][$i] < 0 ) |
$y=$this->plots[0]->coords[0][$i]; |
for( $j = 1; $j < $this->nbrplots; $j++ ) { |
if( $this->plots[$j]->coords[0][$i] < 0 ) |
$y += $this->plots[ $j ]->coords[0][$i]; |
} |
$ymin[$i] = $y; |
} |
$ymin = Min($ysetmin,Min($ymin)); |
// Bar always start at baseline |
if( $ymin >= $this->ybase ) |
$ymin = $this->ybase; |
return array($xmin,$ymin); |
} |
// Stroke acc bar plot |
function Stroke($img,$xscale,$yscale) { |
$pattern=NULL; |
$img->SetLineWeight($this->weight); |
$grad=null; |
for($i=0; $i < $this->numpoints-1; $i++) { |
$accy = 0; |
$accy_neg = 0; |
for($j=0; $j < $this->nbrplots; ++$j ) { |
$img->SetColor($this->plots[$j]->color); |
if ( $this->plots[$j]->coords[0][$i] >= 0) { |
$yt=$yscale->Translate($this->plots[$j]->coords[0][$i]+$accy); |
$accyt=$yscale->Translate($accy); |
$accy+=$this->plots[$j]->coords[0][$i]; |
} |
else { |
//if ( $this->plots[$j]->coords[0][$i] < 0 || $accy_neg < 0 ) { |
$yt=$yscale->Translate($this->plots[$j]->coords[0][$i]+$accy_neg); |
$accyt=$yscale->Translate($accy_neg); |
$accy_neg+=$this->plots[$j]->coords[0][$i]; |
} |
$xt=$xscale->Translate($i); |
if( $this->abswidth > -1 ) { |
$abswidth=$this->abswidth; |
} |
else { |
$abswidth=round($this->width*$xscale->scale_factor,0); |
} |
$pts=array($xt,$accyt,$xt,$yt,$xt+$abswidth,$yt,$xt+$abswidth,$accyt); |
if( $this->bar_shadow ) { |
$ssh = $this->bar_shadow_hsize; |
$ssv = $this->bar_shadow_vsize; |
// We must also differ if we are a positive or negative bar. |
if( $j === 0 ) { |
// This gets extra complicated since we have to |
// see all plots to see if we are negative. It could |
// for example be that all plots are 0 until the very |
// last one. We therefore need to save the initial setup |
// for both the negative and positive case |
// In case the final bar is positive |
$sp[0]=$pts[6]+1; $sp[1]=$pts[7]; |
$sp[2]=$pts[6]+$ssh; $sp[3]=$pts[7]-$ssv; |
// In case the final bar is negative |
$nsp[0]=$pts[0]; $nsp[1]=$pts[1]; |
$nsp[2]=$pts[0]+$ssh; $nsp[3]=$pts[1]-$ssv; |
$nsp[4]=$pts[6]+$ssh; $nsp[5]=$pts[7]-$ssv; |
$nsp[10]=$pts[6]+1; $nsp[11]=$pts[7]; |
} |
if( $j === $this->nbrplots-1 ) { |
// If this is the last plot of the bar and |
// the total value is larger than 0 then we |
// add the shadow. |
if( is_array($this->bar_shadow_color) ) { |
$numcolors = count($this->bar_shadow_color); |
if( $numcolors == 0 ) { |
JpGraphError::RaiseL(2013);//('You have specified an empty array for shadow colors in the bar plot.'); |
} |
$img->PushColor($this->bar_shadow_color[$i % $numcolors]); |
} |
else { |
$img->PushColor($this->bar_shadow_color); |
} |
if( $accy > 0 ) { |
$sp[4]=$pts[4]+$ssh; $sp[5]=$pts[5]-$ssv; |
$sp[6]=$pts[2]+$ssh; $sp[7]=$pts[3]-$ssv; |
$sp[8]=$pts[2]; $sp[9]=$pts[3]-1; |
$sp[10]=$pts[4]+1; $sp[11]=$pts[5]; |
$img->FilledPolygon($sp,4); |
} |
elseif( $accy_neg < 0 ) { |
$nsp[6]=$pts[4]+$ssh; $nsp[7]=$pts[5]-$ssv; |
$nsp[8]=$pts[4]+1; $nsp[9]=$pts[5]; |
$img->FilledPolygon($nsp,4); |
} |
$img->PopColor(); |
} |
} |
// If value is NULL or 0, then don't draw a bar at all |
if ($this->plots[$j]->coords[0][$i] == 0 ) continue; |
if( $this->plots[$j]->grad ) { |
if( $grad === null ) { |
$grad = new Gradient($img); |
} |
if( is_array($this->plots[$j]->grad_fromcolor) ) { |
// The first argument (grad_fromcolor) can be either an array or a single color. If it is an array |
// then we have two choices. It can either a) be a single color specified as an RGB triple or it can be |
// an array to specify both (from, to style) for each individual bar. The way to know the difference is |
// to investgate the first element. If this element is an integer [0,255] then we assume it is an RGB |
// triple. |
$ng = count($this->plots[$j]->grad_fromcolor); |
if( $ng === 3 ) { |
if( is_numeric($this->plots[$j]->grad_fromcolor[0]) && $this->plots[$j]->grad_fromcolor[0] > 0 && |
$this->plots[$j]->grad_fromcolor[0] < 256 ) { |
// RGB Triple |
$fromcolor = $this->plots[$j]->grad_fromcolor; |
$tocolor = $this->plots[$j]->grad_tocolor; |
$style = $this->plots[$j]->grad_style; |
} |
else { |
$fromcolor = $this->plots[$j]->grad_fromcolor[$i % $ng][0]; |
$tocolor = $this->plots[$j]->grad_fromcolor[$i % $ng][1]; |
$style = $this->plots[$j]->grad_fromcolor[$i % $ng][2]; |
} |
} |
else { |
$fromcolor = $this->plots[$j]->grad_fromcolor[$i % $ng][0]; |
$tocolor = $this->plots[$j]->grad_fromcolor[$i % $ng][1]; |
$style = $this->plots[$j]->grad_fromcolor[$i % $ng][2]; |
} |
$grad->FilledRectangle($pts[2],$pts[3], |
$pts[6],$pts[7], |
$fromcolor,$tocolor,$style); |
} |
else { |
$grad->FilledRectangle($pts[2],$pts[3], |
$pts[6],$pts[7], |
$this->plots[$j]->grad_fromcolor, |
$this->plots[$j]->grad_tocolor, |
$this->plots[$j]->grad_style); |
} |
} else { |
if (is_array($this->plots[$j]->fill_color) ) { |
$numcolors = count($this->plots[$j]->fill_color); |
$fillcolor = $this->plots[$j]->fill_color[$i % $numcolors]; |
// If the bar is specified to be non filled then the fill color is false |
if( $fillcolor !== false ) { |
$img->SetColor($this->plots[$j]->fill_color[$i % $numcolors]); |
} |
} |
else { |
$fillcolor = $this->plots[$j]->fill_color; |
if( $fillcolor !== false ) { |
$img->SetColor($this->plots[$j]->fill_color); |
} |
} |
if( $fillcolor !== false ) { |
$img->FilledPolygon($pts); |
} |
} |
$img->SetColor($this->plots[$j]->color); |
// Stroke the pattern |
if( $this->plots[$j]->iPattern > -1 ) { |
if( $pattern===NULL ) { |
$pattern = new RectPatternFactory(); |
} |
$prect = $pattern->Create($this->plots[$j]->iPattern,$this->plots[$j]->iPatternColor,1); |
$prect->SetDensity($this->plots[$j]->iPatternDensity); |
if( $this->plots[$j]->coords[0][$i] < 0 ) { |
$rx = $pts[0]; |
$ry = $pts[1]; |
} |
else { |
$rx = $pts[2]; |
$ry = $pts[3]; |
} |
$width = abs($pts[4]-$pts[0])+1; |
$height = abs($pts[1]-$pts[3])+1; |
$prect->SetPos(new Rectangle($rx,$ry,$width,$height)); |
$prect->Stroke($img); |
} |
// CSIM array |
if( $i < count($this->plots[$j]->csimtargets) ) { |
// Create the client side image map |
$rpts = $img->ArrRotate($pts); |
$csimcoord=round($rpts[0]).", ".round($rpts[1]); |
for( $k=1; $k < 4; ++$k){ |
$csimcoord .= ", ".round($rpts[2*$k]).", ".round($rpts[2*$k+1]); |
} |
if( ! empty($this->plots[$j]->csimtargets[$i]) ) { |
$this->csimareas.= '<area shape="poly" coords="'.$csimcoord.'" '; |
$this->csimareas.= " href=\"".$this->plots[$j]->csimtargets[$i]."\" "; |
if( ! empty($this->plots[$j]->csimwintargets[$i]) ) { |
$this->csimareas.= " target=\"".$this->plots[$j]->csimwintargets[$i]."\" "; |
} |
$sval=''; |
if( !empty($this->plots[$j]->csimalts[$i]) ) { |
$sval=sprintf($this->plots[$j]->csimalts[$i],$this->plots[$j]->coords[0][$i]); |
$this->csimareas .= " title=\"$sval\" "; |
} |
$this->csimareas .= " alt=\"$sval\" />\n"; |
} |
} |
$pts[] = $pts[0]; |
$pts[] = $pts[1]; |
$img->SetLineWeight($this->plots[$j]->weight); |
$img->Polygon($pts); |
$img->SetLineWeight(1); |
} |
// Daw potential bar around the entire accbar bar |
if( $this->weight > 0 ) { |
$y=$yscale->Translate(0); |
$img->SetColor($this->color); |
$img->SetLineWeight($this->weight); |
$img->Rectangle($pts[0],$y,$pts[6],$pts[5]); |
} |
// Draw labels for each acc.bar |
$x=$pts[2]+($pts[4]-$pts[2])/2; |
if($this->bar_shadow) $x += $ssh; |
// First stroke the accumulated value for the entire bar |
// This value is always placed at the top/bottom of the bars |
if( $accy_neg < 0 ) { |
$y=$yscale->Translate($accy_neg); |
$this->value->Stroke($img,$accy_neg,$x,$y); |
} |
else { |
$y=$yscale->Translate($accy); |
$this->value->Stroke($img,$accy,$x,$y); |
} |
$accy = 0; |
$accy_neg = 0; |
for($j=0; $j < $this->nbrplots; ++$j ) { |
// We don't print 0 values in an accumulated bar plot |
if( $this->plots[$j]->coords[0][$i] == 0 ) continue; |
if ($this->plots[$j]->coords[0][$i] > 0) { |
$yt=$yscale->Translate($this->plots[$j]->coords[0][$i]+$accy); |
$accyt=$yscale->Translate($accy); |
if( $this->plots[$j]->valuepos=='center' ) { |
$y = $accyt-($accyt-$yt)/2; |
} |
elseif( $this->plots[$j]->valuepos=='bottom' ) { |
$y = $accyt; |
} |
else { // top or max |
$y = $accyt-($accyt-$yt); |
} |
$accy+=$this->plots[$j]->coords[0][$i]; |
if( $this->plots[$j]->valuepos=='center' ) { |
$this->plots[$j]->value->SetAlign("center","center"); |
$this->plots[$j]->value->SetMargin(0); |
} |
elseif( $this->plots[$j]->valuepos=='bottom' ) { |
$this->plots[$j]->value->SetAlign('center','bottom'); |
$this->plots[$j]->value->SetMargin(2); |
} |
else { |
$this->plots[$j]->value->SetAlign('center','top'); |
$this->plots[$j]->value->SetMargin(1); |
} |
} else { |
$yt=$yscale->Translate($this->plots[$j]->coords[0][$i]+$accy_neg); |
$accyt=$yscale->Translate($accy_neg); |
$accy_neg+=$this->plots[$j]->coords[0][$i]; |
if( $this->plots[$j]->valuepos=='center' ) { |
$y = $accyt-($accyt-$yt)/2; |
} |
elseif( $this->plots[$j]->valuepos=='bottom' ) { |
$y = $accyt; |
} |
else { |
$y = $accyt-($accyt-$yt); |
} |
if( $this->plots[$j]->valuepos=='center' ) { |
$this->plots[$j]->value->SetAlign("center","center"); |
$this->plots[$j]->value->SetMargin(0); |
} |
elseif( $this->plots[$j]->valuepos=='bottom' ) { |
$this->plots[$j]->value->SetAlign('center',$j==0 ? 'bottom':'top'); |
$this->plots[$j]->value->SetMargin(-2); |
} |
else { |
$this->plots[$j]->value->SetAlign('center','bottom'); |
$this->plots[$j]->value->SetMargin(-1); |
} |
} |
$this->plots[$j]->value->Stroke($img,$this->plots[$j]->coords[0][$i],$x,$y); |
} |
} |
return true; |
} |
} // Class |
/* EOF */ |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/jpgraph_pie3d.php |
---|
New file |
0,0 → 1,933 |
<?php |
/*======================================================================= |
// File: JPGRAPH_PIE3D.PHP |
// Description: 3D Pie plot extension for JpGraph |
// Created: 2001-03-24 |
// Ver: $Id: jpgraph_pie3d.php 1329 2009-06-20 19:23:30Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
*/ |
//=================================================== |
// CLASS PiePlot3D |
// Description: Plots a 3D pie with a specified projection |
// angle between 20 and 70 degrees. |
//=================================================== |
class PiePlot3D extends PiePlot { |
private $labelhintcolor="red",$showlabelhint=true; |
private $angle=50; |
private $edgecolor="", $edgeweight=1; |
private $iThickness=false; |
//--------------- |
// CONSTRUCTOR |
function __construct($data) { |
$this->radius = 0.5; |
$this->data = $data; |
$this->title = new Text(""); |
$this->title->SetFont(FF_FONT1,FS_BOLD); |
$this->value = new DisplayValue(); |
$this->value->Show(); |
$this->value->SetFormat('%.0f%%'); |
} |
//--------------- |
// PUBLIC METHODS |
// Set label arrays |
function SetLegends($aLegend) { |
$this->legends = array_reverse(array_slice($aLegend,0,count($this->data))); |
} |
function SetSliceColors($aColors) { |
$this->setslicecolors = $aColors; |
} |
function Legend($aGraph) { |
parent::Legend($aGraph); |
$aGraph->legend->txtcol = array_reverse($aGraph->legend->txtcol); |
} |
function SetCSIMTargets($aTargets,$aAlts='',$aWinTargets='') { |
$this->csimtargets = $aTargets; |
$this->csimwintargets = $aWinTargets; |
$this->csimalts = $aAlts; |
} |
// Should the slices be separated by a line? If color is specified as "" no line |
// will be used to separate pie slices. |
function SetEdge($aColor='black',$aWeight=1) { |
$this->edgecolor = $aColor; |
$this->edgeweight = $aWeight; |
} |
// Specify projection angle for 3D in degrees |
// Must be between 20 and 70 degrees |
function SetAngle($a) { |
if( $a<5 || $a>90 ) { |
JpGraphError::RaiseL(14002); |
//("PiePlot3D::SetAngle() 3D Pie projection angle must be between 5 and 85 degrees."); |
} |
else { |
$this->angle = $a; |
} |
} |
function Add3DSliceToCSIM($i,$xc,$yc,$height,$width,$thick,$sa,$ea) { //Slice number, ellipse centre (x,y), height, width, start angle, end angle |
$sa *= M_PI/180; |
$ea *= M_PI/180; |
//add coordinates of the centre to the map |
$coords = "$xc, $yc"; |
//add coordinates of the first point on the arc to the map |
$xp = floor($width*cos($sa)/2+$xc); |
$yp = floor($yc-$height*sin($sa)/2); |
$coords.= ", $xp, $yp"; |
//If on the front half, add the thickness offset |
if ($sa >= M_PI && $sa <= 2*M_PI*1.01) { |
$yp = floor($yp+$thick); |
$coords.= ", $xp, $yp"; |
} |
//add coordinates every 0.2 radians |
$a=$sa+0.2; |
while ($a<$ea) { |
$xp = floor($width*cos($a)/2+$xc); |
if ($a >= M_PI && $a <= 2*M_PI*1.01) { |
$yp = floor($yc-($height*sin($a)/2)+$thick); |
} else { |
$yp = floor($yc-$height*sin($a)/2); |
} |
$coords.= ", $xp, $yp"; |
$a += 0.2; |
} |
//Add the last point on the arc |
$xp = floor($width*cos($ea)/2+$xc); |
$yp = floor($yc-$height*sin($ea)/2); |
if ($ea >= M_PI && $ea <= 2*M_PI*1.01) { |
$coords.= ", $xp, ".floor($yp+$thick); |
} |
$coords.= ", $xp, $yp"; |
$alt=''; |
if( !empty($this->csimtargets[$i]) ) { |
$this->csimareas .= "<area shape=\"poly\" coords=\"$coords\" href=\"".$this->csimtargets[$i]."\""; |
if( !empty($this->csimwintargets[$i]) ) { |
$this->csimareas .= " target=\"".$this->csimwintargets[$i]."\" "; |
} |
if( !empty($this->csimalts[$i]) ) { |
$tmp=sprintf($this->csimalts[$i],$this->data[$i]); |
$this->csimareas .= "alt=\"$tmp\" title=\"$tmp\" "; |
} |
$this->csimareas .= " />\n"; |
} |
} |
function SetLabels($aLabels,$aLblPosAdj="auto") { |
$this->labels = $aLabels; |
$this->ilabelposadj=$aLblPosAdj; |
} |
// Distance from the pie to the labels |
function SetLabelMargin($m) { |
$this->value->SetMargin($m); |
} |
// Show a thin line from the pie to the label for a specific slice |
function ShowLabelHint($f=true) { |
$this->showlabelhint=$f; |
} |
// Set color of hint line to label for each slice |
function SetLabelHintColor($c) { |
$this->labelhintcolor=$c; |
} |
function SetHeight($aHeight) { |
$this->iThickness = $aHeight; |
} |
// Normalize Angle between 0-360 |
function NormAngle($a) { |
// Normalize anle to 0 to 2M_PI |
// |
if( $a > 0 ) { |
while($a > 360) $a -= 360; |
} |
else { |
while($a < 0) $a += 360; |
} |
if( $a < 0 ) |
$a = 360 + $a; |
if( $a == 360 ) $a=0; |
return $a; |
} |
// Draw one 3D pie slice at position ($xc,$yc) with height $z |
function Pie3DSlice($img,$xc,$yc,$w,$h,$sa,$ea,$z,$fillcolor,$shadow=0.65) { |
// Due to the way the 3D Pie algorithm works we are |
// guaranteed that any slice we get into this method |
// belongs to either the left or right side of the |
// pie ellipse. Hence, no slice will cross 90 or 270 |
// point. |
if( ($sa < 90 && $ea > 90) || ( ($sa > 90 && $sa < 270) && $ea > 270) ) { |
JpGraphError::RaiseL(14003);//('Internal assertion failed. Pie3D::Pie3DSlice'); |
exit(1); |
} |
$p[] = array(); |
// Setup pre-calculated values |
$rsa = $sa/180*M_PI; // to Rad |
$rea = $ea/180*M_PI; // to Rad |
$sinsa = sin($rsa); |
$cossa = cos($rsa); |
$sinea = sin($rea); |
$cosea = cos($rea); |
// p[] is the points for the overall slice and |
// pt[] is the points for the top pie |
// Angular step when approximating the arc with a polygon train. |
$step = 0.05; |
if( $sa >= 270 ) { |
if( $ea > 360 || ($ea > 0 && $ea <= 90) ) { |
if( $ea > 0 && $ea <= 90 ) { |
// Adjust angle to simplify conditions in loops |
$rea += 2*M_PI; |
} |
$p = array($xc,$yc,$xc,$yc+$z, |
$xc+$w*$cossa,$z+$yc-$h*$sinsa); |
$pt = array($xc,$yc,$xc+$w*$cossa,$yc-$h*$sinsa); |
for( $a=$rsa; $a < 2*M_PI; $a += $step ) { |
$tca = cos($a); |
$tsa = sin($a); |
$p[] = $xc+$w*$tca; |
$p[] = $z+$yc-$h*$tsa; |
$pt[] = $xc+$w*$tca; |
$pt[] = $yc-$h*$tsa; |
} |
$pt[] = $xc+$w; |
$pt[] = $yc; |
$p[] = $xc+$w; |
$p[] = $z+$yc; |
$p[] = $xc+$w; |
$p[] = $yc; |
$p[] = $xc; |
$p[] = $yc; |
for( $a=2*M_PI+$step; $a < $rea; $a += $step ) { |
$pt[] = $xc + $w*cos($a); |
$pt[] = $yc - $h*sin($a); |
} |
$pt[] = $xc+$w*$cosea; |
$pt[] = $yc-$h*$sinea; |
$pt[] = $xc; |
$pt[] = $yc; |
} |
else { |
$p = array($xc,$yc,$xc,$yc+$z, |
$xc+$w*$cossa,$z+$yc-$h*$sinsa); |
$pt = array($xc,$yc,$xc+$w*$cossa,$yc-$h*$sinsa); |
$rea = $rea == 0.0 ? 2*M_PI : $rea; |
for( $a=$rsa; $a < $rea; $a += $step ) { |
$tca = cos($a); |
$tsa = sin($a); |
$p[] = $xc+$w*$tca; |
$p[] = $z+$yc-$h*$tsa; |
$pt[] = $xc+$w*$tca; |
$pt[] = $yc-$h*$tsa; |
} |
$pt[] = $xc+$w*$cosea; |
$pt[] = $yc-$h*$sinea; |
$pt[] = $xc; |
$pt[] = $yc; |
$p[] = $xc+$w*$cosea; |
$p[] = $z+$yc-$h*$sinea; |
$p[] = $xc+$w*$cosea; |
$p[] = $yc-$h*$sinea; |
$p[] = $xc; |
$p[] = $yc; |
} |
} |
elseif( $sa >= 180 ) { |
$p = array($xc,$yc,$xc,$yc+$z,$xc+$w*$cosea,$z+$yc-$h*$sinea); |
$pt = array($xc,$yc,$xc+$w*$cosea,$yc-$h*$sinea); |
for( $a=$rea; $a>$rsa; $a -= $step ) { |
$tca = cos($a); |
$tsa = sin($a); |
$p[] = $xc+$w*$tca; |
$p[] = $z+$yc-$h*$tsa; |
$pt[] = $xc+$w*$tca; |
$pt[] = $yc-$h*$tsa; |
} |
$pt[] = $xc+$w*$cossa; |
$pt[] = $yc-$h*$sinsa; |
$pt[] = $xc; |
$pt[] = $yc; |
$p[] = $xc+$w*$cossa; |
$p[] = $z+$yc-$h*$sinsa; |
$p[] = $xc+$w*$cossa; |
$p[] = $yc-$h*$sinsa; |
$p[] = $xc; |
$p[] = $yc; |
} |
elseif( $sa >= 90 ) { |
if( $ea > 180 ) { |
$p = array($xc,$yc,$xc,$yc+$z,$xc+$w*$cosea,$z+$yc-$h*$sinea); |
$pt = array($xc,$yc,$xc+$w*$cosea,$yc-$h*$sinea); |
for( $a=$rea; $a > M_PI; $a -= $step ) { |
$tca = cos($a); |
$tsa = sin($a); |
$p[] = $xc+$w*$tca; |
$p[] = $z + $yc - $h*$tsa; |
$pt[] = $xc+$w*$tca; |
$pt[] = $yc-$h*$tsa; |
} |
$p[] = $xc-$w; |
$p[] = $z+$yc; |
$p[] = $xc-$w; |
$p[] = $yc; |
$p[] = $xc; |
$p[] = $yc; |
$pt[] = $xc-$w; |
$pt[] = $z+$yc; |
$pt[] = $xc-$w; |
$pt[] = $yc; |
for( $a=M_PI-$step; $a > $rsa; $a -= $step ) { |
$pt[] = $xc + $w*cos($a); |
$pt[] = $yc - $h*sin($a); |
} |
$pt[] = $xc+$w*$cossa; |
$pt[] = $yc-$h*$sinsa; |
$pt[] = $xc; |
$pt[] = $yc; |
} |
else { // $sa >= 90 && $ea <= 180 |
$p = array($xc,$yc,$xc,$yc+$z, |
$xc+$w*$cosea,$z+$yc-$h*$sinea, |
$xc+$w*$cosea,$yc-$h*$sinea, |
$xc,$yc); |
$pt = array($xc,$yc,$xc+$w*$cosea,$yc-$h*$sinea); |
for( $a=$rea; $a>$rsa; $a -= $step ) { |
$pt[] = $xc + $w*cos($a); |
$pt[] = $yc - $h*sin($a); |
} |
$pt[] = $xc+$w*$cossa; |
$pt[] = $yc-$h*$sinsa; |
$pt[] = $xc; |
$pt[] = $yc; |
} |
} |
else { // sa > 0 && ea < 90 |
$p = array($xc,$yc,$xc,$yc+$z, |
$xc+$w*$cossa,$z+$yc-$h*$sinsa, |
$xc+$w*$cossa,$yc-$h*$sinsa, |
$xc,$yc); |
$pt = array($xc,$yc,$xc+$w*$cossa,$yc-$h*$sinsa); |
for( $a=$rsa; $a < $rea; $a += $step ) { |
$pt[] = $xc + $w*cos($a); |
$pt[] = $yc - $h*sin($a); |
} |
$pt[] = $xc+$w*$cosea; |
$pt[] = $yc-$h*$sinea; |
$pt[] = $xc; |
$pt[] = $yc; |
} |
$img->PushColor($fillcolor.":".$shadow); |
$img->FilledPolygon($p); |
$img->PopColor(); |
$img->PushColor($fillcolor); |
$img->FilledPolygon($pt); |
$img->PopColor(); |
} |
function SetStartAngle($aStart) { |
if( $aStart < 0 || $aStart > 360 ) { |
JpGraphError::RaiseL(14004);//('Slice start angle must be between 0 and 360 degrees.'); |
} |
$this->startangle = $aStart; |
} |
// Draw a 3D Pie |
function Pie3D($aaoption,$img,$data,$colors,$xc,$yc,$d,$angle,$z, |
$shadow=0.65,$startangle=0,$edgecolor="",$edgeweight=1) { |
//--------------------------------------------------------------------------- |
// As usual the algorithm get more complicated than I originally |
// envisioned. I believe that this is as simple as it is possible |
// to do it with the features I want. It's a good exercise to start |
// thinking on how to do this to convince your self that all this |
// is really needed for the general case. |
// |
// The algorithm two draw 3D pies without "real 3D" is done in |
// two steps. |
// First imagine the pie cut in half through a thought line between |
// 12'a clock and 6'a clock. It now easy to imagine that we can plot |
// the individual slices for each half by starting with the topmost |
// pie slice and continue down to 6'a clock. |
// |
// In the algortithm this is done in three principal steps |
// Step 1. Do the knife cut to ensure by splitting slices that extends |
// over the cut line. This is done by splitting the original slices into |
// upto 3 subslices. |
// Step 2. Find the top slice for each half |
// Step 3. Draw the slices from top to bottom |
// |
// The thing that slightly complicates this scheme with all the |
// angle comparisons below is that we can have an arbitrary start |
// angle so we must take into account the different equivalence classes. |
// For the same reason we must walk through the angle array in a |
// modulo fashion. |
// |
// Limitations of algorithm: |
// * A small exploded slice which crosses the 270 degree point |
// will get slightly nagged close to the center due to the fact that |
// we print the slices in Z-order and that the slice left part |
// get printed first and might get slightly nagged by a larger |
// slice on the right side just before the right part of the small |
// slice. Not a major problem though. |
//--------------------------------------------------------------------------- |
// Determine the height of the ellippse which gives an |
// indication of the inclination angle |
$h = ($angle/90.0)*$d; |
$sum = 0; |
for($i=0; $i<count($data); ++$i ) { |
$sum += $data[$i]; |
} |
// Special optimization |
if( $sum==0 ) return; |
if( $this->labeltype == 2 ) { |
$this->adjusted_data = $this->AdjPercentage($data); |
} |
// Setup the start |
$accsum = 0; |
$a = $startangle; |
$a = $this->NormAngle($a); |
// |
// Step 1 . Split all slices that crosses 90 or 270 |
// |
$idx=0; |
$adjexplode=array(); |
$numcolors = count($colors); |
for($i=0; $i<count($data); ++$i, ++$idx ) { |
$da = $data[$i]/$sum * 360; |
if( empty($this->explode_radius[$i]) ) { |
$this->explode_radius[$i]=0; |
} |
$expscale=1; |
if( $aaoption == 1 ) { |
$expscale=2; |
} |
$la = $a + $da/2; |
$explode = array( $xc + $this->explode_radius[$i]*cos($la*M_PI/180)*$expscale, |
$yc - $this->explode_radius[$i]*sin($la*M_PI/180) * ($h/$d) *$expscale ); |
$adjexplode[$idx] = $explode; |
$labeldata[$i] = array($la,$explode[0],$explode[1]); |
$originalangles[$i] = array($a,$a+$da); |
$ne = $this->NormAngle($a+$da); |
if( $da <= 180 ) { |
// If the slice size is <= 90 it can at maximum cut across |
// one boundary (either 90 or 270) where it needs to be split |
$split=-1; // no split |
if( ($da<=90 && ($a <= 90 && $ne > 90)) || |
(($da <= 180 && $da >90) && (($a < 90 || $a >= 270) && $ne > 90)) ) { |
$split = 90; |
} |
elseif( ($da<=90 && ($a <= 270 && $ne > 270)) || |
(($da<=180 && $da>90) && ($a >= 90 && $a < 270 && ($a+$da) > 270 )) ) { |
$split = 270; |
} |
if( $split > 0 ) { // split in two |
$angles[$idx] = array($a,$split); |
$adjcolors[$idx] = $colors[$i % $numcolors]; |
$adjexplode[$idx] = $explode; |
$angles[++$idx] = array($split,$ne); |
$adjcolors[$idx] = $colors[$i % $numcolors]; |
$adjexplode[$idx] = $explode; |
} |
else { // no split |
$angles[$idx] = array($a,$ne); |
$adjcolors[$idx] = $colors[$i % $numcolors]; |
$adjexplode[$idx] = $explode; |
} |
} |
else { |
// da>180 |
// Slice may, depending on position, cross one or two |
// bonudaries |
if( $a < 90 ) $split = 90; |
elseif( $a <= 270 ) $split = 270; |
else $split = 90; |
$angles[$idx] = array($a,$split); |
$adjcolors[$idx] = $colors[$i % $numcolors]; |
$adjexplode[$idx] = $explode; |
//if( $a+$da > 360-$split ) { |
// For slices larger than 270 degrees we might cross |
// another boundary as well. This means that we must |
// split the slice further. The comparison gets a little |
// bit complicated since we must take into accound that |
// a pie might have a startangle >0 and hence a slice might |
// wrap around the 0 angle. |
// Three cases: |
// a) Slice starts before 90 and hence gets a split=90, but |
// we must also check if we need to split at 270 |
// b) Slice starts after 90 but before 270 and slices |
// crosses 90 (after a wrap around of 0) |
// c) If start is > 270 (hence the firstr split is at 90) |
// and the slice is so large that it goes all the way |
// around 270. |
if( ($a < 90 && ($a+$da > 270)) || ($a > 90 && $a<=270 && ($a+$da>360+90) ) || ($a > 270 && $this->NormAngle($a+$da)>270) ) { |
$angles[++$idx] = array($split,360-$split); |
$adjcolors[$idx] = $colors[$i % $numcolors]; |
$adjexplode[$idx] = $explode; |
$angles[++$idx] = array(360-$split,$ne); |
$adjcolors[$idx] = $colors[$i % $numcolors]; |
$adjexplode[$idx] = $explode; |
} |
else { |
// Just a simple split to the previous decided |
// angle. |
$angles[++$idx] = array($split,$ne); |
$adjcolors[$idx] = $colors[$i % $numcolors]; |
$adjexplode[$idx] = $explode; |
} |
} |
$a += $da; |
$a = $this->NormAngle($a); |
} |
// Total number of slices |
$n = count($angles); |
for($i=0; $i<$n; ++$i) { |
list($dbgs,$dbge) = $angles[$i]; |
} |
// |
// Step 2. Find start index (first pie that starts in upper left quadrant) |
// |
$minval = $angles[0][0]; |
$min = 0; |
for( $i=0; $i<$n; ++$i ) { |
if( $angles[$i][0] < $minval ) { |
$minval = $angles[$i][0]; |
$min = $i; |
} |
} |
$j = $min; |
$cnt = 0; |
while( $angles[$j][1] <= 90 ) { |
$j++; |
if( $j>=$n) { |
$j=0; |
} |
if( $cnt > $n ) { |
JpGraphError::RaiseL(14005); |
//("Pie3D Internal error (#1). Trying to wrap twice when looking for start index"); |
} |
++$cnt; |
} |
$start = $j; |
// |
// Step 3. Print slices in z-order |
// |
$cnt = 0; |
// First stroke all the slices between 90 and 270 (left half circle) |
// counterclockwise |
while( $angles[$j][0] < 270 && $aaoption !== 2 ) { |
list($x,$y) = $adjexplode[$j]; |
$this->Pie3DSlice($img,$x,$y,$d,$h,$angles[$j][0],$angles[$j][1], |
$z,$adjcolors[$j],$shadow); |
$last = array($x,$y,$j); |
$j++; |
if( $j >= $n ) $j=0; |
if( $cnt > $n ) { |
JpGraphError::RaiseL(14006); |
//("Pie3D Internal Error: Z-Sorting algorithm for 3D Pies is not working properly (2). Trying to wrap twice while stroking."); |
} |
++$cnt; |
} |
$slice_left = $n-$cnt; |
$j=$start-1; |
if($j<0) $j=$n-1; |
$cnt = 0; |
// The stroke all slices from 90 to -90 (right half circle) |
// clockwise |
while( $cnt < $slice_left && $aaoption !== 2 ) { |
list($x,$y) = $adjexplode[$j]; |
$this->Pie3DSlice($img,$x,$y,$d,$h,$angles[$j][0],$angles[$j][1], |
$z,$adjcolors[$j],$shadow); |
$j--; |
if( $cnt > $n ) { |
JpGraphError::RaiseL(14006); |
//("Pie3D Internal Error: Z-Sorting algorithm for 3D Pies is not working properly (2). Trying to wrap twice while stroking."); |
} |
if($j<0) $j=$n-1; |
$cnt++; |
} |
// Now do a special thing. Stroke the last slice on the left |
// halfcircle one more time. This is needed in the case where |
// the slice close to 270 have been exploded. In that case the |
// part of the slice close to the center of the pie might be |
// slightly nagged. |
if( $aaoption !== 2 ) |
$this->Pie3DSlice($img,$last[0],$last[1],$d,$h,$angles[$last[2]][0], |
$angles[$last[2]][1],$z,$adjcolors[$last[2]],$shadow); |
if( $aaoption !== 1 ) { |
// Now print possible labels and add csim |
$this->value->ApplyFont($img); |
$margin = $img->GetFontHeight()/2 + $this->value->margin ; |
for($i=0; $i < count($data); ++$i ) { |
$la = $labeldata[$i][0]; |
$x = $labeldata[$i][1] + cos($la*M_PI/180)*($d+$margin)*$this->ilabelposadj; |
$y = $labeldata[$i][2] - sin($la*M_PI/180)*($h+$margin)*$this->ilabelposadj; |
if( $this->ilabelposadj >= 1.0 ) { |
if( $la > 180 && $la < 360 ) $y += $z; |
} |
if( $this->labeltype == 0 ) { |
if( $sum > 0 ) $l = 100*$data[$i]/$sum; |
else $l = 0; |
} |
elseif( $this->labeltype == 1 ) { |
$l = $data[$i]; |
} |
else { |
$l = $this->adjusted_data[$i]; |
} |
if( isset($this->labels[$i]) && is_string($this->labels[$i]) ) { |
$l=sprintf($this->labels[$i],$l); |
} |
$this->StrokeLabels($l,$img,$labeldata[$i][0]*M_PI/180,$x,$y,$z); |
$this->Add3DSliceToCSIM($i,$labeldata[$i][1],$labeldata[$i][2],$h*2,$d*2,$z, |
$originalangles[$i][0],$originalangles[$i][1]); |
} |
} |
// |
// Finally add potential lines in pie |
// |
if( $edgecolor=="" || $aaoption !== 0 ) return; |
$accsum = 0; |
$a = $startangle; |
$a = $this->NormAngle($a); |
$a *= M_PI/180.0; |
$idx=0; |
$img->PushColor($edgecolor); |
$img->SetLineWeight($edgeweight); |
$fulledge = true; |
for($i=0; $i < count($data) && $fulledge; ++$i ) { |
if( empty($this->explode_radius[$i]) ) { |
$this->explode_radius[$i]=0; |
} |
if( $this->explode_radius[$i] > 0 ) { |
$fulledge = false; |
} |
} |
for($i=0; $i < count($data); ++$i, ++$idx ) { |
$da = $data[$i]/$sum * 2*M_PI; |
$this->StrokeFullSliceFrame($img,$xc,$yc,$a,$a+$da,$d,$h,$z,$edgecolor, |
$this->explode_radius[$i],$fulledge); |
$a += $da; |
} |
$img->PopColor(); |
} |
function StrokeFullSliceFrame($img,$xc,$yc,$sa,$ea,$w,$h,$z,$edgecolor,$exploderadius,$fulledge) { |
$step = 0.02; |
if( $exploderadius > 0 ) { |
$la = ($sa+$ea)/2; |
$xc += $exploderadius*cos($la); |
$yc -= $exploderadius*sin($la) * ($h/$w) ; |
} |
$p = array($xc,$yc,$xc+$w*cos($sa),$yc-$h*sin($sa)); |
for($a=$sa; $a < $ea; $a += $step ) { |
$p[] = $xc + $w*cos($a); |
$p[] = $yc - $h*sin($a); |
} |
$p[] = $xc+$w*cos($ea); |
$p[] = $yc-$h*sin($ea); |
$p[] = $xc; |
$p[] = $yc; |
$img->SetColor($edgecolor); |
$img->Polygon($p); |
// Unfortunately we can't really draw the full edge around the whole of |
// of the slice if any of the slices are exploded. The reason is that |
// this algorithm is to simply. There are cases where the edges will |
// "overwrite" other slices when they have been exploded. |
// Doing the full, proper 3D hidden lines stiff is actually quite |
// tricky. So for exploded pies we only draw the top edge. Not perfect |
// but the "real" solution is much more complicated. |
if( $fulledge && !( $sa > 0 && $sa < M_PI && $ea < M_PI) ) { |
if($sa < M_PI && $ea > M_PI) { |
$sa = M_PI; |
} |
if($sa < 2*M_PI && (($ea >= 2*M_PI) || ($ea > 0 && $ea < $sa ) ) ) { |
$ea = 2*M_PI; |
} |
if( $sa >= M_PI && $ea <= 2*M_PI ) { |
$p = array($xc + $w*cos($sa),$yc - $h*sin($sa), |
$xc + $w*cos($sa),$z + $yc - $h*sin($sa)); |
for($a=$sa+$step; $a < $ea; $a += $step ) { |
$p[] = $xc + $w*cos($a); |
$p[] = $z + $yc - $h*sin($a); |
} |
$p[] = $xc + $w*cos($ea); |
$p[] = $z + $yc - $h*sin($ea); |
$p[] = $xc + $w*cos($ea); |
$p[] = $yc - $h*sin($ea); |
$img->SetColor($edgecolor); |
$img->Polygon($p); |
} |
} |
} |
function Stroke($img,$aaoption=0) { |
$n = count($this->data); |
// If user hasn't set the colors use the theme array |
if( $this->setslicecolors==null ) { |
$colors = array_keys($img->rgb->rgb_table); |
sort($colors); |
$idx_a=$this->themearr[$this->theme]; |
$ca = array(); |
$m = count($idx_a); |
for($i=0; $i < $m; ++$i) { |
$ca[$i] = $colors[$idx_a[$i]]; |
} |
$ca = array_reverse(array_slice($ca,0,$n)); |
} |
else { |
$ca = $this->setslicecolors; |
} |
if( $this->posx <= 1 && $this->posx > 0 ) { |
$xc = round($this->posx*$img->width); |
} |
else { |
$xc = $this->posx ; |
} |
if( $this->posy <= 1 && $this->posy > 0 ) { |
$yc = round($this->posy*$img->height); |
} |
else { |
$yc = $this->posy ; |
} |
if( $this->radius <= 1 ) { |
$width = floor($this->radius*min($img->width,$img->height)); |
// Make sure that the pie doesn't overflow the image border |
// The 0.9 factor is simply an extra margin to leave some space |
// between the pie an the border of the image. |
$width = min($width,min($xc*0.9,($yc*90/$this->angle-$width/4)*0.9)); |
} |
else { |
$width = $this->radius * ($aaoption === 1 ? 2 : 1 ) ; |
} |
// Add a sanity check for width |
if( $width < 1 ) { |
JpGraphError::RaiseL(14007);//("Width for 3D Pie is 0. Specify a size > 0"); |
} |
// Establish a thickness. By default the thickness is a fifth of the |
// pie slice width (=pie radius) but since the perspective depends |
// on the inclination angle we use some heuristics to make the edge |
// slightly thicker the less the angle. |
// Has user specified an absolute thickness? In that case use |
// that instead |
if( $this->iThickness ) { |
$thick = $this->iThickness; |
$thick *= ($aaoption === 1 ? 2 : 1 ); |
} |
else { |
$thick = $width/12; |
} |
$a = $this->angle; |
if( $a <= 30 ) $thick *= 1.6; |
elseif( $a <= 40 ) $thick *= 1.4; |
elseif( $a <= 50 ) $thick *= 1.2; |
elseif( $a <= 60 ) $thick *= 1.0; |
elseif( $a <= 70 ) $thick *= 0.8; |
elseif( $a <= 80 ) $thick *= 0.7; |
else $thick *= 0.6; |
$thick = floor($thick); |
if( $this->explode_all ) { |
for($i=0; $i < $n; ++$i) |
$this->explode_radius[$i]=$this->explode_r; |
} |
$this->Pie3D($aaoption,$img,$this->data, $ca, $xc, $yc, $width, $this->angle, |
$thick, 0.65, $this->startangle, $this->edgecolor, $this->edgeweight); |
// Adjust title position |
if( $aaoption != 1 ) { |
$this->title->SetPos($xc,$yc-$this->title->GetFontHeight($img)-$width/2-$this->title->margin, "center","bottom"); |
$this->title->Stroke($img); |
} |
} |
//--------------- |
// PRIVATE METHODS |
// Position the labels of each slice |
function StrokeLabels($label,$img,$a,$xp,$yp,$z) { |
$this->value->halign="left"; |
$this->value->valign="top"; |
// Position the axis title. |
// dx, dy is the offset from the top left corner of the bounding box that sorrounds the text |
// that intersects with the extension of the corresponding axis. The code looks a little |
// bit messy but this is really the only way of having a reasonable position of the |
// axis titles. |
$this->value->ApplyFont($img); |
$h=$img->GetTextHeight($label); |
// For numeric values the format of the display value |
// must be taken into account |
if( is_numeric($label) ) { |
if( $label >= 0 ) { |
$w=$img->GetTextWidth(sprintf($this->value->format,$label)); |
} |
else { |
$w=$img->GetTextWidth(sprintf($this->value->negformat,$label)); |
} |
} |
else { |
$w=$img->GetTextWidth($label); |
} |
while( $a > 2*M_PI ) { |
$a -= 2*M_PI; |
} |
if( $a>=7*M_PI/4 || $a <= M_PI/4 ) $dx=0; |
if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dx=($a-M_PI/4)*2/M_PI; |
if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dx=1; |
if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dx=(1-($a-M_PI*5/4)*2/M_PI); |
if( $a>=7*M_PI/4 ) $dy=(($a-M_PI)-3*M_PI/4)*2/M_PI; |
if( $a<=M_PI/4 ) $dy=(1-$a*2/M_PI); |
if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dy=1; |
if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dy=(1-($a-3*M_PI/4)*2/M_PI); |
if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dy=0; |
$x = round($xp-$dx*$w); |
$y = round($yp-$dy*$h); |
// Mark anchor point for debugging |
/* |
$img->SetColor('red'); |
$img->Line($xp-10,$yp,$xp+10,$yp); |
$img->Line($xp,$yp-10,$xp,$yp+10); |
*/ |
$oldmargin = $this->value->margin; |
$this->value->margin=0; |
$this->value->Stroke($img,$label,$x,$y); |
$this->value->margin=$oldmargin; |
} |
} // Class |
/* EOF */ |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/jpgraph_legend.inc.php |
---|
New file |
0,0 → 1,484 |
<?php |
//======================================================================= |
// File: JPGRAPH_LEGEND.INC.PHP |
// Description: Class to handle the legend box in the graph that gives |
// names on the data series. The number of rows and columns |
// in the legend are user specifyable. |
// Created: 2001-01-08 (Refactored to separate file 2008-08-01) |
// Ver: $Id: jpgraph_legend.inc.php 1926 2010-01-11 16:33:07Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
DEFINE('_DEFAULT_LPM_SIZE',8); // Default Legend Plot Mark size |
//=================================================== |
// CLASS Legend |
// Description: Responsible for drawing the box containing |
// all the legend text for the graph |
//=================================================== |
class Legend { |
public $txtcol=array(); |
public $font_family=FF_FONT1,$font_style=FS_NORMAL,$font_size=12; |
private $color=array(0,0,0); // Default fram color |
private $fill_color=array(235,235,235); // Default fill color |
private $shadow=true; // Shadow around legend "box" |
private $shadow_color='darkgray'; |
private $mark_abs_hsize=_DEFAULT_LPM_SIZE,$mark_abs_vsize=_DEFAULT_LPM_SIZE; |
private $xmargin=10,$ymargin=0,$shadow_width=2; |
private $xlmargin=4; |
private $ylinespacing=5; |
// We need a separate margin since the baseline of the last text would coincide with the bottom otherwise |
private $ybottom_margin = 8; |
private $xpos=0.05, $ypos=0.15, $xabspos=-1, $yabspos=-1; |
private $halign="right", $valign="top"; |
private $font_color='black'; |
private $hide=false,$layout_n=1; |
private $weight=1,$frameweight=1; |
private $csimareas=''; |
private $reverse = false ; |
private $bkg_gradtype=-1, $bkg_gradfrom='lightgray', $bkg_gradto='gray'; |
//--------------- |
// CONSTRUCTOR |
function __construct() { |
// Empty |
} |
//--------------- |
// PUBLIC METHODS |
function Hide($aHide=true) { |
$this->hide=$aHide; |
} |
function SetHColMargin($aXMarg) { |
$this->xmargin = $aXMarg; |
} |
function SetVColMargin($aSpacing) { |
$this->ylinespacing = $aSpacing ; |
} |
function SetLeftMargin($aXMarg) { |
$this->xlmargin = $aXMarg; |
} |
// Synonym |
function SetLineSpacing($aSpacing) { |
$this->ylinespacing = $aSpacing ; |
} |
function SetShadow($aShow='gray',$aWidth=4) { |
if( is_string($aShow) ) { |
$this->shadow_color = $aShow; |
$this->shadow=true; |
} |
else { |
$this->shadow = $aShow; |
} |
$this->shadow_width = $aWidth; |
} |
function SetMarkAbsSize($aSize) { |
$this->mark_abs_vsize = $aSize ; |
$this->mark_abs_hsize = $aSize ; |
} |
function SetMarkAbsVSize($aSize) { |
$this->mark_abs_vsize = $aSize ; |
} |
function SetMarkAbsHSize($aSize) { |
$this->mark_abs_hsize = $aSize ; |
} |
function SetLineWeight($aWeight) { |
$this->weight = $aWeight; |
} |
function SetFrameWeight($aWeight) { |
$this->frameweight = $aWeight; |
} |
function SetLayout($aDirection=LEGEND_VERT) { |
$this->layout_n = $aDirection==LEGEND_VERT ? 1 : 99 ; |
} |
function SetColumns($aCols) { |
$this->layout_n = $aCols ; |
} |
function SetReverse($f=true) { |
$this->reverse = $f ; |
} |
// Set color on frame around box |
function SetColor($aFontColor,$aColor='black') { |
$this->font_color=$aFontColor; |
$this->color=$aColor; |
} |
function SetFont($aFamily,$aStyle=FS_NORMAL,$aSize=10) { |
$this->font_family = $aFamily; |
$this->font_style = $aStyle; |
$this->font_size = $aSize; |
} |
function SetPos($aX,$aY,$aHAlign='right',$aVAlign='top') { |
$this->Pos($aX,$aY,$aHAlign,$aVAlign); |
} |
function SetAbsPos($aX,$aY,$aHAlign='right',$aVAlign='top') { |
$this->xabspos=$aX; |
$this->yabspos=$aY; |
$this->halign=$aHAlign; |
$this->valign=$aVAlign; |
} |
function Pos($aX,$aY,$aHAlign='right',$aVAlign='top') { |
if( !($aX<1 && $aY<1) ) { |
JpGraphError::RaiseL(25120);//(" Position for legend must be given as percentage in range 0-1"); |
} |
$this->xpos=$aX; |
$this->ypos=$aY; |
$this->halign=$aHAlign; |
$this->valign=$aVAlign; |
} |
function SetFillColor($aColor) { |
$this->fill_color=$aColor; |
} |
function Clear() { |
$this->txtcol = array(); |
} |
function Add($aTxt,$aColor,$aPlotmark='',$aLinestyle=0,$csimtarget='',$csimalt='',$csimwintarget='') { |
$this->txtcol[]=array($aTxt,$aColor,$aPlotmark,$aLinestyle,$csimtarget,$csimalt,$csimwintarget); |
} |
function GetCSIMAreas() { |
return $this->csimareas; |
} |
function SetBackgroundGradient($aFrom='navy',$aTo='silver',$aGradType=2) { |
$this->bkg_gradtype=$aGradType; |
$this->bkg_gradfrom = $aFrom; |
$this->bkg_gradto = $aTo; |
} |
function Stroke($aImg) { |
// Constant |
$fillBoxFrameWeight=1; |
if( $this->hide ) return; |
$aImg->SetFont($this->font_family,$this->font_style,$this->font_size); |
if( $this->reverse ) { |
$this->txtcol = array_reverse($this->txtcol); |
} |
$n=count($this->txtcol); |
if( $n == 0 ) return; |
// Find out the max width and height of each column to be able |
// to size the legend box. |
$numcolumns = ($n > $this->layout_n ? $this->layout_n : $n); |
for( $i=0; $i < $numcolumns; ++$i ) { |
$colwidth[$i] = $aImg->GetTextWidth($this->txtcol[$i][0]) + |
2*$this->xmargin + 2*$this->mark_abs_hsize; |
$colheight[$i] = 0; |
} |
// Find our maximum height in each row |
$rows = 0 ; $rowheight[0] = 0; |
for( $i=0; $i < $n; ++$i ) { |
$h = max($this->mark_abs_vsize,$aImg->GetTextHeight($this->txtcol[$i][0]))+$this->ylinespacing; |
// Makes sure we always have a minimum of 1/4 (1/2 on each side) of the mark as space |
// between two vertical legend entries |
//$h = round(max($h,$this->mark_abs_vsize+$this->ymargin)); |
//echo "Textheight #$i: tetxheight=".$aImg->GetTextHeight($this->txtcol[$i][0]).', '; |
//echo "h=$h ({$this->mark_abs_vsize},{$this->ymargin})<br>"; |
if( $i % $numcolumns == 0 ) { |
$rows++; |
$rowheight[$rows-1] = 0; |
} |
$rowheight[$rows-1] = max($rowheight[$rows-1],$h); |
} |
$abs_height = 0; |
for( $i=0; $i < $rows; ++$i ) { |
$abs_height += $rowheight[$i] ; |
} |
// Make sure that the height is at least as high as mark size + ymargin |
$abs_height = max($abs_height,$this->mark_abs_vsize); |
$abs_height += $this->ybottom_margin; |
// Find out the maximum width in each column |
for( $i=$numcolumns; $i < $n; ++$i ) { |
$colwidth[$i % $numcolumns] = max( |
$aImg->GetTextWidth($this->txtcol[$i][0])+2*$this->xmargin+2*$this->mark_abs_hsize, |
$colwidth[$i % $numcolumns]); |
} |
// Get the total width |
$mtw = 0; |
for( $i=0; $i < $numcolumns; ++$i ) { |
$mtw += $colwidth[$i] ; |
} |
// remove the last rows interpace margin (since there is no next row) |
$abs_height -= $this->ylinespacing; |
// Find out maximum width we need for legend box |
$abs_width = $mtw+$this->xlmargin+($numcolumns-1)*$this->mark_abs_hsize; |
if( $this->xabspos === -1 && $this->yabspos === -1 ) { |
$this->xabspos = $this->xpos*$aImg->width ; |
$this->yabspos = $this->ypos*$aImg->height ; |
} |
// Positioning of the legend box |
if( $this->halign == 'left' ) { |
$xp = $this->xabspos; |
} |
elseif( $this->halign == 'center' ) { |
$xp = $this->xabspos - $abs_width/2; |
} |
else { |
$xp = $aImg->width - $this->xabspos - $abs_width; |
} |
$yp=$this->yabspos; |
if( $this->valign == 'center' ) { |
$yp-=$abs_height/2; |
} |
elseif( $this->valign == 'bottom' ) { |
$yp-=$abs_height; |
} |
// Stroke legend box |
$aImg->SetColor($this->color); |
$aImg->SetLineWeight($this->frameweight); |
$aImg->SetLineStyle('solid'); |
if( $this->shadow ) { |
$aImg->ShadowRectangle($xp,$yp, |
$xp+$abs_width+$this->shadow_width+2, |
$yp+$abs_height+$this->shadow_width+2, |
$this->fill_color,$this->shadow_width+2,$this->shadow_color); |
} |
else { |
$aImg->SetColor($this->fill_color); |
$aImg->FilledRectangle($xp,$yp,$xp+$abs_width,$yp+$abs_height); |
$aImg->SetColor($this->color); |
$aImg->Rectangle($xp,$yp,$xp+$abs_width,$yp+$abs_height); |
} |
if( $this->bkg_gradtype >= 0 ) { |
$grad = new Gradient($aImg); |
$grad->FilledRectangle($xp+1, $yp+1, |
$xp+$abs_width-3, $yp+$abs_height-3, |
$this->bkg_gradfrom, $this->bkg_gradto, |
$this->bkg_gradtype); |
} |
// x1,y1 is the position for the legend marker + text |
// The vertical position is the baseline position for the text |
// and every marker is adjusted acording to that. |
// For multiline texts this get more complicated. |
$x1 = $xp + $this->xlmargin; |
$y1 = $yp + $rowheight[0] - $this->ylinespacing + 2 ; // The ymargin is included in rowheight |
// Now, y1 is the bottom vertical position of the first legend, i.e if |
// the legend has multiple lines it is the bottom line. |
$grad = new Gradient($aImg); |
$patternFactory = null; |
// Now stroke each legend in turn |
// Each plot has added the following information to the legend |
// p[0] = Legend text |
// p[1] = Color, |
// p[2] = For markers a reference to the PlotMark object |
// p[3] = For lines the line style, for gradient the negative gradient style |
// p[4] = CSIM target |
// p[5] = CSIM Alt text |
$i = 1 ; $row = 0; |
foreach($this->txtcol as $p) { |
// STROKE DEBUG BOX |
if( _JPG_DEBUG ) { |
$aImg->SetLineWeight(1); |
$aImg->SetColor('red'); |
$aImg->SetLineStyle('solid'); |
$aImg->Rectangle($x1,$y1,$xp+$abs_width-1,$y1-$rowheight[$row]); |
} |
$aImg->SetLineWeight($this->weight); |
$x1 = round($x1)+1; // We add one to not collide with the border |
$y1=round($y1); |
// This is the center offset up from the baseline which is |
// considered the "center" of the marks. This gets slightly complicated since |
// we need to consider if the text is a multiline paragraph or if it is only |
// a single line. The reason is that for single line the y1 corresponds to the baseline |
// and that is fine. However for a multiline paragraph there is no single baseline |
// and in that case the y1 corresponds to the lowest y for the bounding box. In that |
// case we center the mark in the middle of the paragraph |
if( !preg_match('/\n/',$p[0]) ) { |
// Single line |
$marky = ceil($y1-$this->mark_abs_vsize/2)-1; |
} else { |
// Paragraph |
$marky = $y1 - $aImg->GetTextHeight($p[0])/2; |
// echo "y1=$y1, p[o]={$p[0]}, marky=$marky<br>"; |
} |
//echo "<br>Mark #$i: marky=$marky<br>"; |
$x1 += $this->mark_abs_hsize; |
if ( !empty($p[2]) && $p[2]->GetType() > -1 ) { |
// Make a plot mark legend. This is constructed with a mark which |
// is run through with a line |
// First construct a bit of the line that looks exactly like the |
// line in the plot |
$aImg->SetColor($p[1]); |
if( is_string($p[3]) || $p[3]>0 ) { |
$aImg->SetLineStyle($p[3]); |
$aImg->StyleLine($x1-$this->mark_abs_hsize,$marky,$x1+$this->mark_abs_hsize,$marky); |
} |
// Stroke a mark with the standard size |
// (As long as it is not an image mark ) |
if( $p[2]->GetType() != MARK_IMG ) { |
// Clear any user callbacks since we ont want them called for |
// the legend marks |
$p[2]->iFormatCallback = ''; |
$p[2]->iFormatCallback2 = ''; |
// Since size for circles is specified as the radius |
// this means that we must half the size to make the total |
// width behave as the other marks |
if( $p[2]->GetType() == MARK_FILLEDCIRCLE || $p[2]->GetType() == MARK_CIRCLE ) { |
$p[2]->SetSize(min($this->mark_abs_vsize,$this->mark_abs_hsize)/2); |
$p[2]->Stroke($aImg,$x1,$marky); |
} |
else { |
$p[2]->SetSize(min($this->mark_abs_vsize,$this->mark_abs_hsize)); |
$p[2]->Stroke($aImg,$x1,$marky); |
} |
} |
} |
elseif ( !empty($p[2]) && (is_string($p[3]) || $p[3]>0 ) ) { |
// Draw a styled line |
$aImg->SetColor($p[1]); |
$aImg->SetLineStyle($p[3]); |
$aImg->StyleLine($x1-$this->mark_abs_hsize,$marky,$x1+$this->mark_abs_hsize,$marky); |
$aImg->StyleLine($x1-$this->mark_abs_hsize,$marky+1,$x1+$this->mark_abs_hsize,$marky+1); |
} |
else { |
// Draw a colored box |
$color = $p[1] ; |
// We make boxes slightly larger to better show |
$boxsize = max($this->mark_abs_vsize,$this->mark_abs_hsize) + 2 ; |
$ym = $marky-ceil($boxsize/2) ; // Marker y-coordinate |
// We either need to plot a gradient or a |
// pattern. To differentiate we use a kludge. |
// Patterns have a p[3] value of < -100 |
if( $p[3] < -100 ) { |
// p[1][0] == iPattern, p[1][1] == iPatternColor, p[1][2] == iPatternDensity |
if( $patternFactory == null ) { |
$patternFactory = new RectPatternFactory(); |
} |
$prect = $patternFactory->Create($p[1][0],$p[1][1],1); |
$prect->SetBackground($p[1][3]); |
$prect->SetDensity($p[1][2]+1); |
$prect->SetPos(new Rectangle($x1,$ym,$boxsize,$boxsize)); |
$prect->Stroke($aImg); |
$prect=null; |
} |
else { |
if( is_array($color) && count($color)==2 ) { |
// The client want a gradient color |
$grad->FilledRectangle($x1-$boxsize/2,$ym, |
$x1+$boxsize/2,$ym+$boxsize, |
$color[0],$color[1],-$p[3]); |
} |
else { |
$aImg->SetColor($p[1]); |
$aImg->FilledRectangle($x1-$boxsize/2,$ym, |
$x1+$boxsize/2,$ym+$boxsize); |
} |
$aImg->SetColor($this->color); |
$aImg->SetLineWeight($fillBoxFrameWeight); |
$aImg->Rectangle($x1-$boxsize/2,$ym, |
$x1+$boxsize/2,$ym+$boxsize); |
} |
} |
$aImg->SetColor($this->font_color); |
$aImg->SetFont($this->font_family,$this->font_style,$this->font_size); |
$aImg->SetTextAlign('left','baseline'); |
$debug=false; |
$aImg->StrokeText($x1+$this->mark_abs_hsize+$this->xmargin,$y1,$p[0], |
0,'left',$debug); |
// Add CSIM for Legend if defined |
if( !empty($p[4]) ) { |
$xs = $x1 - $this->mark_abs_hsize ; |
$ys = $y1 + 1 ; |
$xe = $x1 + $aImg->GetTextWidth($p[0]) + $this->mark_abs_hsize + $this->xmargin ; |
$ye = $y1-$rowheight[$row]+1; |
$coords = "$xs,$ys,$xe,$y1,$xe,$ye,$xs,$ye"; |
if( ! empty($p[4]) ) { |
$this->csimareas .= "<area shape=\"poly\" coords=\"$coords\" href=\"".htmlentities($p[4])."\""; |
if( !empty($p[6]) ) { |
$this->csimareas .= " target=\"".$p[6]."\""; |
} |
if( !empty($p[5]) ) { |
$tmp=sprintf($p[5],$p[0]); |
$this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" "; |
} |
$this->csimareas .= " />\n"; |
} |
} |
if( $i >= $this->layout_n ) { |
$x1 = $xp+$this->xlmargin; |
$row++; |
if( !empty($rowheight[$row]) ) |
$y1 += $rowheight[$row]; |
$i = 1; |
} |
else { |
$x1 += $colwidth[($i-1) % $numcolumns] ; |
++$i; |
} |
} |
} |
} // Class |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/imgdata_squares.inc.php |
---|
New file |
0,0 → 1,150 |
<?php |
//======================================================================= |
// File: IMGDATA_SQUARES.INC |
// Description: Base64 encoded images for squares |
// Created: 2003-03-20 |
// Ver: $Id: imgdata_squares.inc.php 1106 2009-02-22 20:16:35Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
class ImgData_Squares extends ImgData { |
protected $name = 'Squares'; |
protected $an = array(MARK_IMG_SQUARE =>'imgdata'); |
protected $colors = array('bluegreen','blue','green', |
'lightblue','orange','purple','red','yellow'); |
protected $index = array('bluegreen' =>2,'blue'=>5,'green'=>6, |
'lightblue'=>0,'orange'=>7,'purple'=>4,'red'=>3,'yellow'=>1); |
protected $maxidx = 7 ; |
protected $imgdata ; |
function ImgData_Squares () { |
//========================================================== |
//sq_lblue.png |
//========================================================== |
$this->imgdata[0][0]= 362 ; |
$this->imgdata[0][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAIAAADZrBkAAAAABm'. |
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. |
'B3RJTUUH0wMLFgojiPx/ygAAAPdJREFUeNpj/P377+kzHx89/c'. |
'VAHNBQ5VBX52HavPWWjg6nnDQbkXoUFTnnL7zD9PPXrz17HxCj'. |
'E6Jn6fL7H7/+ZWJgYCBGJ7IeBgYGJogofp1oehDa8OjE1IOiDa'. |
'tOrHoYGBhY0NwD0enirMDAwMDFxYRVD7ptyDrNTAU0NXix6sGu'. |
'jYGBgZOT9e/f/0xMjFyczFgVsGAKCfBza2kKzpl3hIuT1c9Xb/'. |
'PW58/foKchJqx6tmy98vbjj8cvPm/afMnXW1JShA2fNmQ9EBFc'. |
'Opnw6MGjkwm/Hlw6mQjqwaqTiRg9mDoZv//4M2/+UYJ64EBWgj'. |
'cm2hwA8l24oNDl+DMAAAAASUVORK5CYII=' ; |
//========================================================== |
//sq_yellow.png |
//========================================================== |
$this->imgdata[1][0]= 338 ; |
$this->imgdata[1][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAWl'. |
'BMVEX////+/+H+/9/9/9v8/8P8/8H8/7v8/7n6/4P5/335/3n5'. |
'/3X4/1f4/1P3/031/w30/wn0/wPt+ADp9ADm8ADk7gDc5gDa5A'. |
'DL1ADFzgCwuACqsgClrABzeAC9M0MzAAAAAWJLR0QAiAUdSAAA'. |
'AAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEDlOgDj'. |
'EAAAB+SURBVHjaVcpbCsQgDEDRGERGKopjDa2a/W9zfLWj9/Nw'. |
'Ac21ZRBOtZlRN9ApzSYFaDUj79KIorRDbJNO9bN/GUSh2ZRJFJ'. |
'S18iorURBiyksO8buT0zkfYaUqzI91ckfhWhoGXTLzsDjI68Sz'. |
'pGMjrzPzauA/iXk1AtykmvgBC8UcWUdc9HkAAAAASUVORK5CYI'. |
'I=' ; |
//========================================================== |
//sq_blgr.png |
//========================================================== |
$this->imgdata[2][0]= 347 ; |
$this->imgdata[2][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAZl'. |
'BMVEX////0+vv0+vrz+fry+frv+Png7e/d7e/a6+zY6+250tSz'. |
'0tSyztCtztGM0NWIz9SDzdNfsLVcrrRZrbJOp61MpqtIr7dHn6'. |
'RErrZArLQ6q7M2g4kygYcsp68npa4ctr8QZ20JnqepKsl4AAAA'. |
'AWJLR0QAiAUdSAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU'. |
'1FB9MDCxYEByp8tpUAAAB7SURBVHjaVcjRFoIgDADQWZpWJpjY'. |
'MsnG//9kzIFn3McLzfArDA3MndFjrhvgfDHFBEB9pt0CVzwrY3'. |
'n2yicjhY4vTSp0nbXtN+hCV53SHDWe61dZY+/9463r2XuifHAM'. |
'0SoH+6xEcovUlCfefeFSIwfTTQ3fB+pi4lV/bTIgvmaA7a0AAA'. |
'AASUVORK5CYII=' ; |
//========================================================== |
//sq_red.png |
//========================================================== |
$this->imgdata[3][0]= 324 ; |
$this->imgdata[3][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAXV'. |
'BMVEX////++Pn99/j99ff99fb98/X98/T98PL55uj43+P24+bw'. |
'kKPvjaHviJ3teJHpxMnoL2Pjs73WW3rWNljVWXnUVnbUK1DTJk'. |
'3SUHPOBz/KQmmxPVmuOFasNFOeIkWVka/fAAAAAWJLR0QAiAUd'. |
'SAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEHd'. |
'ceT+8AAABtSURBVHjaVchbAkMwEAXQq6i3VrQiQfa/zDYTw8z5'. |
'PCjGt9JVWFt1XWPh1fWNdfDy+tq6WPfRUPENNKnSnXNWPB4uv2'. |
'b54nSZ8jHrMtOxvWZZZtpD4KP6xLkO9/AhzhaCOMhJh68cOjzV'. |
'/K/4Ac2cG+nBcaRuAAAAAElFTkSuQmCC' ; |
//========================================================== |
//sq_pink.png |
//========================================================== |
$this->imgdata[4][0]= 445 ; |
$this->imgdata[4][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAApV'. |
'BMVEX////6+Pz69/v49Pr38/r17/jr4+/l3Onj2efh1ua/L+i+'. |
'q8m+Lue9Lua8qsS8LuW8LeS7pca5LOG4LN+2Y9O2YNW1ZdO1Kt'. |
'y0atC0aNGzb82zbc6zKtuzKdqycsuwa8qtJtOISZ2GRpuFN6GE'. |
'NqCDQpmCMZ+BPpd/LJ1/K519S5B9Jpx9Jpt9JZt6RY11BJZ1BJ'. |
'V0BJV0BJRzBJNvNoRtIoJUEmdZ/XbrAAAAAWJLR0QAiAUdSAAA'. |
'AAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYDF3iKMD'. |
'YAAACeSURBVHjaVczbEoIgGARgCiMtrexoWpaa2FHUgvd/tH4Y'. |
'BnEvv9ldhNPradPnnGBUTtPDzMRPSIF46SaBoR25dYjz3I20Lb'. |
'ek6BgQz73Il7KKpSgCO0pTHU0886J1sCe0ZYbALjGhjFnEM2es'. |
'VhZVI4d+B1QtfnV47ywCEaKeP/p7JdLejSYt0j6NIiOq1wJZIs'. |
'QTDA0ELHwhPBCwyR/Cni9cOmzJtwAAAABJRU5ErkJggg==' ; |
//========================================================== |
//sq_blue.png |
//========================================================== |
$this->imgdata[5][0]= 283 ; |
$this->imgdata[5][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAQl'. |
'BMVEX////4+fz39/z19vvy8vru7/ni4+7g4fHW1ue8vteXmt6B'. |
'hdhiZ7FQVaZETcxCSJo1Oq4zNoMjKakhJHcKFaMEC2jRVYdWAA'. |
'AAAWJLR0QAiAUdSAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0'. |
'SU1FB9MDCxYDN0PkEP4AAABfSURBVHjaVchHAoAgDATAVcCCIF'. |
'j4/1elJEjmOFDHKVgDv4iz640gLs+LMF6ZUv/VqcXXplU7Gqpy'. |
'PFzBT5qml9NzlOX259riWHlS4kOffviHD8PQYZx2EFMPRkw+9Q'. |
'FSnRPeWEDzKAAAAABJRU5ErkJggg==' ; |
//========================================================== |
//sq_green.png |
//========================================================== |
$this->imgdata[6][0]= 325 ; |
$this->imgdata[6][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAXV'. |
'BMVEX////2+vX1+vX1+fT0+fPz+PPx9/Dv9u7u9e3h7uHe697a'. |
'6dnO2s3I1sa10LOvza2ay5aEwYBWlE9TqE5Tkk1RkEpMrUJMg0'. |
'hKiUNGpEFBojw8oTcsbScaYBMWlwmMT0NtAAAAAWJLR0QAiAUd'. |
'SAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEFd'. |
'nFx90AAABuSURBVHjaVc9HAoAgDADB2HuJWLDx/2cKBITscW4L'. |
'5byzMIWtZobNDZIZtrcCGZsRQ8GwvRSRNxIiMuysODKG3alikl'. |
'ueOPlpKTLBaRmOZxQxaXlfb5ZWI9om4WntrXiDSJzp7SBkwMQa'. |
'FEy0VR/NAB2kNuj7rgAAAABJRU5ErkJggg==' ; |
//========================================================== |
//sq_orange.png |
//========================================================== |
$this->imgdata[7][0]= 321 ; |
$this->imgdata[7][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAUV'. |
'BMVEX/////8+n/8uf/8OP/59H/5Mv/zqH/zJ3/ypv/yJf/vYH/'. |
'u33/uXn/n0n/nUX/m0H/lzn/ljf/lDP/kS3/kCv/iR//hxv/fg'. |
'n/fAX/eQDYZgDW6ia5AAAAAWJLR0QAiAUdSAAAAAlwSFlzAAAL'. |
'EgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEJIgbx+cAAAB2SURBVH'. |
'jaVczRCoQwDETRbLAWLZSGUA35/w/dVI0283i4DODew3YESmWW'. |
'kg5gWkoQAe6TleUQI/66Sy7i56+kLk7cht2N0+hcnJgQu0SqiC'. |
'1SzSIbzWSi6gavqJ63wSduRi2f+kwyD5rEukwCdZ1kGAMGMfv9'. |
'AbWuGMOr5COSAAAAAElFTkSuQmCC' ; |
} |
} |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/jpgraph_canvtools.php |
---|
New file |
0,0 → 1,523 |
<?php |
/*======================================================================= |
// File: JPGRAPH_CANVTOOLS.PHP |
// Description: Some utilities for text and shape drawing on a canvas |
// Created: 2002-08-23 |
// Ver: $Id: jpgraph_canvtools.php 1857 2009-09-28 14:38:14Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
*/ |
define('CORNER_TOPLEFT',0); |
define('CORNER_TOPRIGHT',1); |
define('CORNER_BOTTOMRIGHT',2); |
define('CORNER_BOTTOMLEFT',3); |
//=================================================== |
// CLASS CanvasScale |
// Description: Define a scale for canvas so we |
// can abstract away with absolute pixels |
//=================================================== |
class CanvasScale { |
private $g; |
private $w,$h; |
private $ixmin=0,$ixmax=10,$iymin=0,$iymax=10; |
function __construct($graph,$xmin=0,$xmax=10,$ymin=0,$ymax=10) { |
$this->g = $graph; |
$this->w = $graph->img->width; |
$this->h = $graph->img->height; |
$this->ixmin = $xmin; |
$this->ixmax = $xmax; |
$this->iymin = $ymin; |
$this->iymax = $ymax; |
} |
function Set($xmin=0,$xmax=10,$ymin=0,$ymax=10) { |
$this->ixmin = $xmin; |
$this->ixmax = $xmax; |
$this->iymin = $ymin; |
$this->iymax = $ymax; |
} |
function Get() { |
return array($this->ixmin,$this->ixmax,$this->iymin,$this->iymax); |
} |
function Translate($x,$y) { |
$xp = round(($x-$this->ixmin)/($this->ixmax - $this->ixmin) * $this->w); |
$yp = round(($y-$this->iymin)/($this->iymax - $this->iymin) * $this->h); |
return array($xp,$yp); |
} |
function TranslateX($x) { |
$xp = round(($x-$this->ixmin)/($this->ixmax - $this->ixmin) * $this->w); |
return $xp; |
} |
function TranslateY($y) { |
$yp = round(($y-$this->iymin)/($this->iymax - $this->iymin) * $this->h); |
return $yp; |
} |
} |
//=================================================== |
// CLASS Shape |
// Description: Methods to draw shapes on canvas |
//=================================================== |
class Shape { |
private $img,$scale; |
function __construct($aGraph,$scale) { |
$this->img = $aGraph->img; |
$this->img->SetColor('black'); |
$this->scale = $scale; |
} |
function SetColor($aColor) { |
$this->img->SetColor($aColor); |
} |
function Line($x1,$y1,$x2,$y2) { |
list($x1,$y1) = $this->scale->Translate($x1,$y1); |
list($x2,$y2) = $this->scale->Translate($x2,$y2); |
$this->img->Line($x1,$y1,$x2,$y2); |
} |
function SetLineWeight($aWeight) { |
$this->img->SetLineWeight($aWeight); |
} |
function Polygon($p,$aClosed=false) { |
$n=count($p); |
for($i=0; $i < $n; $i+=2 ) { |
$p[$i] = $this->scale->TranslateX($p[$i]); |
$p[$i+1] = $this->scale->TranslateY($p[$i+1]); |
} |
$this->img->Polygon($p,$aClosed); |
} |
function FilledPolygon($p) { |
$n=count($p); |
for($i=0; $i < $n; $i+=2 ) { |
$p[$i] = $this->scale->TranslateX($p[$i]); |
$p[$i+1] = $this->scale->TranslateY($p[$i+1]); |
} |
$this->img->FilledPolygon($p); |
} |
// Draw a bezier curve with defining points in the $aPnts array |
// using $aSteps steps. |
// 0=x0, 1=y0 |
// 2=x1, 3=y1 |
// 4=x2, 5=y2 |
// 6=x3, 7=y3 |
function Bezier($p,$aSteps=40) { |
$x0 = $p[0]; |
$y0 = $p[1]; |
// Calculate coefficients |
$cx = 3*($p[2]-$p[0]); |
$bx = 3*($p[4]-$p[2])-$cx; |
$ax = $p[6]-$p[0]-$cx-$bx; |
$cy = 3*($p[3]-$p[1]); |
$by = 3*($p[5]-$p[3])-$cy; |
$ay = $p[7]-$p[1]-$cy-$by; |
// Step size |
$delta = 1.0/$aSteps; |
$x_old = $x0; |
$y_old = $y0; |
for($t=$delta; $t<=1.0; $t+=$delta) { |
$tt = $t*$t; $ttt=$tt*$t; |
$x = $ax*$ttt + $bx*$tt + $cx*$t + $x0; |
$y = $ay*$ttt + $by*$tt + $cy*$t + $y0; |
$this->Line($x_old,$y_old,$x,$y); |
$x_old = $x; |
$y_old = $y; |
} |
$this->Line($x_old,$y_old,$p[6],$p[7]); |
} |
function Rectangle($x1,$y1,$x2,$y2) { |
list($x1,$y1) = $this->scale->Translate($x1,$y1); |
list($x2,$y2) = $this->scale->Translate($x2,$y2); |
$this->img->Rectangle($x1,$y1,$x2,$y2); |
} |
function FilledRectangle($x1,$y1,$x2,$y2) { |
list($x1,$y1) = $this->scale->Translate($x1,$y1); |
list($x2,$y2) = $this->scale->Translate($x2,$y2); |
$this->img->FilledRectangle($x1,$y1,$x2,$y2); |
} |
function Circle($x1,$y1,$r) { |
list($x1,$y1) = $this->scale->Translate($x1,$y1); |
if( $r >= 0 ) |
$r = $this->scale->TranslateX($r); |
else |
$r = -$r; |
$this->img->Circle($x1,$y1,$r); |
} |
function FilledCircle($x1,$y1,$r) { |
list($x1,$y1) = $this->scale->Translate($x1,$y1); |
if( $r >= 0 ) |
$r = $this->scale->TranslateX($r); |
else |
$r = -$r; |
$this->img->FilledCircle($x1,$y1,$r); |
} |
function RoundedRectangle($x1,$y1,$x2,$y2,$r=null) { |
list($x1,$y1) = $this->scale->Translate($x1,$y1); |
list($x2,$y2) = $this->scale->Translate($x2,$y2); |
if( $r == null ) |
$r = 5; |
elseif( $r >= 0 ) |
$r = $this->scale->TranslateX($r); |
else |
$r = -$r; |
$this->img->RoundedRectangle($x1,$y1,$x2,$y2,$r); |
} |
function FilledRoundedRectangle($x1,$y1,$x2,$y2,$r=null) { |
list($x1,$y1) = $this->scale->Translate($x1,$y1); |
list($x2,$y2) = $this->scale->Translate($x2,$y2); |
if( $r == null ) |
$r = 5; |
elseif( $r > 0 ) |
$r = $this->scale->TranslateX($r); |
else |
$r = -$r; |
$this->img->FilledRoundedRectangle($x1,$y1,$x2,$y2,$r); |
} |
function ShadowRectangle($x1,$y1,$x2,$y2,$fcolor=false,$shadow_width=null,$shadow_color=array(102,102,102)) { |
list($x1,$y1) = $this->scale->Translate($x1,$y1); |
list($x2,$y2) = $this->scale->Translate($x2,$y2); |
if( $shadow_width == null ) |
$shadow_width=4; |
else |
$shadow_width=$this->scale->TranslateX($shadow_width); |
$this->img->ShadowRectangle($x1,$y1,$x2,$y2,$fcolor,$shadow_width,$shadow_color); |
} |
function SetTextAlign($halign,$valign="bottom") { |
$this->img->SetTextAlign($halign,$valign="bottom"); |
} |
function StrokeText($x1,$y1,$txt,$dir=0,$paragraph_align="left") { |
list($x1,$y1) = $this->scale->Translate($x1,$y1); |
$this->img->StrokeText($x1,$y1,$txt,$dir,$paragraph_align); |
} |
// A rounded rectangle where one of the corner has been moved "into" the |
// rectangle 'iw' width and 'ih' height. Corners: |
// 0=Top left, 1=top right, 2=bottom right, 3=bottom left |
function IndentedRectangle($xt,$yt,$w,$h,$iw=0,$ih=0,$aCorner=3,$aFillColor="",$r=4) { |
list($xt,$yt) = $this->scale->Translate($xt,$yt); |
list($w,$h) = $this->scale->Translate($w,$h); |
list($iw,$ih) = $this->scale->Translate($iw,$ih); |
$xr = $xt + $w - 0; |
$yl = $yt + $h - 0; |
switch( $aCorner ) { |
case 0: // Upper left |
// Bottom line, left & right arc |
$this->img->Line($xt+$r,$yl,$xr-$r,$yl); |
$this->img->Arc($xt+$r,$yl-$r,$r*2,$r*2,90,180); |
$this->img->Arc($xr-$r,$yl-$r,$r*2,$r*2,0,90); |
// Right line, Top right arc |
$this->img->Line($xr,$yt+$r,$xr,$yl-$r); |
$this->img->Arc($xr-$r,$yt+$r,$r*2,$r*2,270,360); |
// Top line, Top left arc |
$this->img->Line($xt+$iw+$r,$yt,$xr-$r,$yt); |
$this->img->Arc($xt+$iw+$r,$yt+$r,$r*2,$r*2,180,270); |
// Left line |
$this->img->Line($xt,$yt+$ih+$r,$xt,$yl-$r); |
// Indent horizontal, Lower left arc |
$this->img->Line($xt+$r,$yt+$ih,$xt+$iw-$r,$yt+$ih); |
$this->img->Arc($xt+$r,$yt+$ih+$r,$r*2,$r*2,180,270); |
// Indent vertical, Indent arc |
$this->img->Line($xt+$iw,$yt+$r,$xt+$iw,$yt+$ih-$r); |
$this->img->Arc($xt+$iw-$r,$yt+$ih-$r,$r*2,$r*2,0,90); |
if( $aFillColor != '' ) { |
$bc = $this->img->current_color_name; |
$this->img->PushColor($aFillColor); |
$this->img->FillToBorder($xr-$r,$yl-$r,$bc); |
$this->img->PopColor(); |
} |
break; |
case 1: // Upper right |
// Bottom line, left & right arc |
$this->img->Line($xt+$r,$yl,$xr-$r,$yl); |
$this->img->Arc($xt+$r,$yl-$r,$r*2,$r*2,90,180); |
$this->img->Arc($xr-$r,$yl-$r,$r*2,$r*2,0,90); |
// Left line, Top left arc |
$this->img->Line($xt,$yt+$r,$xt,$yl-$r); |
$this->img->Arc($xt+$r,$yt+$r,$r*2,$r*2,180,270); |
// Top line, Top right arc |
$this->img->Line($xt+$r,$yt,$xr-$iw-$r,$yt); |
$this->img->Arc($xr-$iw-$r,$yt+$r,$r*2,$r*2,270,360); |
// Right line |
$this->img->Line($xr,$yt+$ih+$r,$xr,$yl-$r); |
// Indent horizontal, Lower right arc |
$this->img->Line($xr-$iw+$r,$yt+$ih,$xr-$r,$yt+$ih); |
$this->img->Arc($xr-$r,$yt+$ih+$r,$r*2,$r*2,270,360); |
// Indent vertical, Indent arc |
$this->img->Line($xr-$iw,$yt+$r,$xr-$iw,$yt+$ih-$r); |
$this->img->Arc($xr-$iw+$r,$yt+$ih-$r,$r*2,$r*2,90,180); |
if( $aFillColor != '' ) { |
$bc = $this->img->current_color_name; |
$this->img->PushColor($aFillColor); |
$this->img->FillToBorder($xt+$r,$yl-$r,$bc); |
$this->img->PopColor(); |
} |
break; |
case 2: // Lower right |
// Top line, Top left & Top right arc |
$this->img->Line($xt+$r,$yt,$xr-$r,$yt); |
$this->img->Arc($xt+$r,$yt+$r,$r*2,$r*2,180,270); |
$this->img->Arc($xr-$r,$yt+$r,$r*2,$r*2,270,360); |
// Left line, Bottom left arc |
$this->img->Line($xt,$yt+$r,$xt,$yl-$r); |
$this->img->Arc($xt+$r,$yl-$r,$r*2,$r*2,90,180); |
// Bottom line, Bottom right arc |
$this->img->Line($xt+$r,$yl,$xr-$iw-$r,$yl); |
$this->img->Arc($xr-$iw-$r,$yl-$r,$r*2,$r*2,0,90); |
// Right line |
$this->img->Line($xr,$yt+$r,$xr,$yl-$ih-$r); |
// Indent horizontal, Lower right arc |
$this->img->Line($xr-$r,$yl-$ih,$xr-$iw+$r,$yl-$ih); |
$this->img->Arc($xr-$r,$yl-$ih-$r,$r*2,$r*2,0,90); |
// Indent vertical, Indent arc |
$this->img->Line($xr-$iw,$yl-$r,$xr-$iw,$yl-$ih+$r); |
$this->img->Arc($xr-$iw+$r,$yl-$ih+$r,$r*2,$r*2,180,270); |
if( $aFillColor != '' ) { |
$bc = $this->img->current_color_name; |
$this->img->PushColor($aFillColor); |
$this->img->FillToBorder($xt+$r,$yt+$r,$bc); |
$this->img->PopColor(); |
} |
break; |
case 3: // Lower left |
// Top line, Top left & Top right arc |
$this->img->Line($xt+$r,$yt,$xr-$r,$yt); |
$this->img->Arc($xt+$r,$yt+$r,$r*2,$r*2,180,270); |
$this->img->Arc($xr-$r,$yt+$r,$r*2,$r*2,270,360); |
// Right line, Bottom right arc |
$this->img->Line($xr,$yt+$r,$xr,$yl-$r); |
$this->img->Arc($xr-$r,$yl-$r,$r*2,$r*2,0,90); |
// Bottom line, Bottom left arc |
$this->img->Line($xt+$iw+$r,$yl,$xr-$r,$yl); |
$this->img->Arc($xt+$iw+$r,$yl-$r,$r*2,$r*2,90,180); |
// Left line |
$this->img->Line($xt,$yt+$r,$xt,$yl-$ih-$r); |
// Indent horizontal, Lower left arc |
$this->img->Line($xt+$r,$yl-$ih,$xt+$iw-$r,$yl-$ih); |
$this->img->Arc($xt+$r,$yl-$ih-$r,$r*2,$r*2,90,180); |
// Indent vertical, Indent arc |
$this->img->Line($xt+$iw,$yl-$ih+$r,$xt+$iw,$yl-$r); |
$this->img->Arc($xt+$iw-$r,$yl-$ih+$r,$r*2,$r*2,270,360); |
if( $aFillColor != '' ) { |
$bc = $this->img->current_color_name; |
$this->img->PushColor($aFillColor); |
$this->img->FillToBorder($xr-$r,$yt+$r,$bc); |
$this->img->PopColor(); |
} |
break; |
} |
} |
} |
//=================================================== |
// CLASS RectangleText |
// Description: Draws a text paragraph inside a |
// rounded, possible filled, rectangle. |
//=================================================== |
class CanvasRectangleText { |
private $ix,$iy,$iw,$ih,$ir=4; |
private $iTxt,$iColor='black',$iFillColor='',$iFontColor='black'; |
private $iParaAlign='center'; |
private $iAutoBoxMargin=5; |
private $iShadowWidth=3,$iShadowColor=''; |
function __construct($aTxt='',$xl=0,$yt=0,$w=0,$h=0) { |
$this->iTxt = new Text($aTxt); |
$this->ix = $xl; |
$this->iy = $yt; |
$this->iw = $w; |
$this->ih = $h; |
} |
function SetShadow($aColor='gray',$aWidth=3) { |
$this->iShadowColor = $aColor; |
$this->iShadowWidth = $aWidth; |
} |
function SetFont($FontFam,$aFontStyle,$aFontSize=12) { |
$this->iTxt->SetFont($FontFam,$aFontStyle,$aFontSize); |
} |
function SetTxt($aTxt) { |
$this->iTxt->Set($aTxt); |
} |
function ParagraphAlign($aParaAlign) { |
$this->iParaAlign = $aParaAlign; |
} |
function SetFillColor($aFillColor) { |
$this->iFillColor = $aFillColor; |
} |
function SetAutoMargin($aMargin) { |
$this->iAutoBoxMargin=$aMargin; |
} |
function SetColor($aColor) { |
$this->iColor = $aColor; |
} |
function SetFontColor($aColor) { |
$this->iFontColor = $aColor; |
} |
function SetPos($xl=0,$yt=0,$w=0,$h=0) { |
$this->ix = $xl; |
$this->iy = $yt; |
$this->iw = $w; |
$this->ih = $h; |
} |
function Pos($xl=0,$yt=0,$w=0,$h=0) { |
$this->ix = $xl; |
$this->iy = $yt; |
$this->iw = $w; |
$this->ih = $h; |
} |
function Set($aTxt,$xl,$yt,$w=0,$h=0) { |
$this->iTxt->Set($aTxt); |
$this->ix = $xl; |
$this->iy = $yt; |
$this->iw = $w; |
$this->ih = $h; |
} |
function SetCornerRadius($aRad=5) { |
$this->ir = $aRad; |
} |
function Stroke($aImg,$scale) { |
// If coordinates are specifed as negative this means we should |
// treat them as abolsute (pixels) coordinates |
if( $this->ix > 0 ) { |
$this->ix = $scale->TranslateX($this->ix) ; |
} |
else { |
$this->ix = -$this->ix; |
} |
if( $this->iy > 0 ) { |
$this->iy = $scale->TranslateY($this->iy) ; |
} |
else { |
$this->iy = -$this->iy; |
} |
list($this->iw,$this->ih) = $scale->Translate($this->iw,$this->ih) ; |
if( $this->iw == 0 ) |
$this->iw = round($this->iTxt->GetWidth($aImg) + $this->iAutoBoxMargin); |
if( $this->ih == 0 ) { |
$this->ih = round($this->iTxt->GetTextHeight($aImg) + $this->iAutoBoxMargin); |
} |
if( $this->iShadowColor != '' ) { |
$aImg->PushColor($this->iShadowColor); |
$aImg->FilledRoundedRectangle($this->ix+$this->iShadowWidth, |
$this->iy+$this->iShadowWidth, |
$this->ix+$this->iw-1+$this->iShadowWidth, |
$this->iy+$this->ih-1+$this->iShadowWidth, |
$this->ir); |
$aImg->PopColor(); |
} |
if( $this->iFillColor != '' ) { |
$aImg->PushColor($this->iFillColor); |
$aImg->FilledRoundedRectangle($this->ix,$this->iy, |
$this->ix+$this->iw-1, |
$this->iy+$this->ih-1, |
$this->ir); |
$aImg->PopColor(); |
} |
if( $this->iColor != '' ) { |
$aImg->PushColor($this->iColor); |
$aImg->RoundedRectangle($this->ix,$this->iy, |
$this->ix+$this->iw-1, |
$this->iy+$this->ih-1, |
$this->ir); |
$aImg->PopColor(); |
} |
$this->iTxt->Align('center','center'); |
$this->iTxt->ParagraphAlign($this->iParaAlign); |
$this->iTxt->SetColor($this->iFontColor); |
$this->iTxt->Stroke($aImg, $this->ix+$this->iw/2, $this->iy+$this->ih/2); |
return array($this->iw, $this->ih); |
} |
} |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/jpgraph_utils.inc.php |
---|
New file |
0,0 → 1,685 |
<?php |
/*======================================================================= |
// File: JPGRAPH_UTILS.INC |
// Description: Collection of non-essential "nice to have" utilities |
// Created: 2005-11-20 |
// Ver: $Id: jpgraph_utils.inc.php 1777 2009-08-23 17:34:36Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
*/ |
//=================================================== |
// CLASS FuncGenerator |
// Description: Utility class to help generate data for function plots. |
// The class supports both parametric and regular functions. |
//=================================================== |
class FuncGenerator { |
private $iFunc='',$iXFunc='',$iMin,$iMax,$iStepSize; |
function __construct($aFunc,$aXFunc='') { |
$this->iFunc = $aFunc; |
$this->iXFunc = $aXFunc; |
} |
function E($aXMin,$aXMax,$aSteps=50) { |
$this->iMin = $aXMin; |
$this->iMax = $aXMax; |
$this->iStepSize = ($aXMax-$aXMin)/$aSteps; |
if( $this->iXFunc != '' ) |
$t = 'for($i='.$aXMin.'; $i<='.$aXMax.'; $i += '.$this->iStepSize.') {$ya[]='.$this->iFunc.';$xa[]='.$this->iXFunc.';}'; |
elseif( $this->iFunc != '' ) |
$t = 'for($x='.$aXMin.'; $x<='.$aXMax.'; $x += '.$this->iStepSize.') {$ya[]='.$this->iFunc.';$xa[]=$x;} $x='.$aXMax.';$ya[]='.$this->iFunc.';$xa[]=$x;'; |
else |
JpGraphError::RaiseL(24001);//('FuncGenerator : No function specified. '); |
@eval($t); |
// If there is an error in the function specifcation this is the only |
// way we can discover that. |
if( empty($xa) || empty($ya) ) |
JpGraphError::RaiseL(24002);//('FuncGenerator : Syntax error in function specification '); |
return array($xa,$ya); |
} |
} |
//============================================================================= |
// CLASS DateScaleUtils |
// Description: Help to create a manual date scale |
//============================================================================= |
define('DSUTILS_MONTH',1); // Major and minor ticks on a monthly basis |
define('DSUTILS_MONTH1',1); // Major and minor ticks on a monthly basis |
define('DSUTILS_MONTH2',2); // Major ticks on a bi-monthly basis |
define('DSUTILS_MONTH3',3); // Major icks on a tri-monthly basis |
define('DSUTILS_MONTH6',4); // Major on a six-monthly basis |
define('DSUTILS_WEEK1',5); // Major ticks on a weekly basis |
define('DSUTILS_WEEK2',6); // Major ticks on a bi-weekly basis |
define('DSUTILS_WEEK4',7); // Major ticks on a quod-weekly basis |
define('DSUTILS_DAY1',8); // Major ticks on a daily basis |
define('DSUTILS_DAY2',9); // Major ticks on a bi-daily basis |
define('DSUTILS_DAY4',10); // Major ticks on a qoud-daily basis |
define('DSUTILS_YEAR1',11); // Major ticks on a yearly basis |
define('DSUTILS_YEAR2',12); // Major ticks on a bi-yearly basis |
define('DSUTILS_YEAR5',13); // Major ticks on a five-yearly basis |
class DateScaleUtils { |
public static $iMin=0, $iMax=0; |
private static $starthour,$startmonth, $startday, $startyear; |
private static $endmonth, $endyear, $endday; |
private static $tickPositions=array(),$minTickPositions=array(); |
private static $iUseWeeks = true; |
static function UseWeekFormat($aFlg) { |
self::$iUseWeeks = $aFlg; |
} |
static function doYearly($aType,$aMinor=false) { |
$i=0; $j=0; |
$m = self::$startmonth; |
$y = self::$startyear; |
if( self::$startday == 1 ) { |
self::$tickPositions[$i++] = mktime(0,0,0,$m,1,$y); |
} |
++$m; |
switch( $aType ) { |
case DSUTILS_YEAR1: |
for($y=self::$startyear; $y <= self::$endyear; ++$y ) { |
if( $aMinor ) { |
while( $m <= 12 ) { |
if( !($y == self::$endyear && $m > self::$endmonth) ) { |
self::$minTickPositions[$j++] = mktime(0,0,0,$m,1,$y); |
} |
++$m; |
} |
$m=1; |
} |
self::$tickPositions[$i++] = mktime(0,0,0,1,1,$y); |
} |
break; |
case DSUTILS_YEAR2: |
$y=self::$startyear; |
while( $y <= self::$endyear ) { |
self::$tickPositions[$i++] = mktime(0,0,0,1,1,$y); |
for($k=0; $k < 1; ++$k ) { |
++$y; |
if( $aMinor ) { |
self::$minTickPositions[$j++] = mktime(0,0,0,1,1,$y); |
} |
} |
++$y; |
} |
break; |
case DSUTILS_YEAR5: |
$y=self::$startyear; |
while( $y <= self::$endyear ) { |
self::$tickPositions[$i++] = mktime(0,0,0,1,1,$y); |
for($k=0; $k < 4; ++$k ) { |
++$y; |
if( $aMinor ) { |
self::$minTickPositions[$j++] = mktime(0,0,0,1,1,$y); |
} |
} |
++$y; |
} |
break; |
} |
} |
static function doDaily($aType,$aMinor=false) { |
$m = self::$startmonth; |
$y = self::$startyear; |
$d = self::$startday; |
$h = self::$starthour; |
$i=0;$j=0; |
if( $h == 0 ) { |
self::$tickPositions[$i++] = mktime(0,0,0,$m,$d,$y); |
} |
$t = mktime(0,0,0,$m,$d,$y); |
switch($aType) { |
case DSUTILS_DAY1: |
while( $t <= self::$iMax ) { |
$t = strtotime('+1 day',$t); |
self::$tickPositions[$i++] = $t; |
if( $aMinor ) { |
self::$minTickPositions[$j++] = strtotime('+12 hours',$t); |
} |
} |
break; |
case DSUTILS_DAY2: |
while( $t <= self::$iMax ) { |
$t = strtotime('+1 day',$t); |
if( $aMinor ) { |
self::$minTickPositions[$j++] = $t; |
} |
$t = strtotime('+1 day',$t); |
self::$tickPositions[$i++] = $t; |
} |
break; |
case DSUTILS_DAY4: |
while( $t <= self::$iMax ) { |
for($k=0; $k < 3; ++$k ) { |
$t = strtotime('+1 day',$t); |
if( $aMinor ) { |
self::$minTickPositions[$j++] = $t; |
} |
} |
$t = strtotime('+1 day',$t); |
self::$tickPositions[$i++] = $t; |
} |
break; |
} |
} |
static function doWeekly($aType,$aMinor=false) { |
$hpd = 3600*24; |
$hpw = 3600*24*7; |
// Find out week number of min date |
$thursday = self::$iMin + $hpd * (3 - (date('w', self::$iMin) + 6) % 7); |
$week = 1 + (date('z', $thursday) - (11 - date('w', mktime(0, 0, 0, 1, 1, date('Y', $thursday)))) % 7) / 7; |
$daynumber = date('w',self::$iMin); |
if( $daynumber == 0 ) $daynumber = 7; |
$m = self::$startmonth; |
$y = self::$startyear; |
$d = self::$startday; |
$i=0;$j=0; |
// The assumption is that the weeks start on Monday. If the first day |
// is later in the week then the first week tick has to be on the following |
// week. |
if( $daynumber == 1 ) { |
self::$tickPositions[$i++] = mktime(0,0,0,$m,$d,$y); |
$t = mktime(0,0,0,$m,$d,$y) + $hpw; |
} |
else { |
$t = mktime(0,0,0,$m,$d,$y) + $hpd*(8-$daynumber); |
} |
switch($aType) { |
case DSUTILS_WEEK1: |
$cnt=0; |
break; |
case DSUTILS_WEEK2: |
$cnt=1; |
break; |
case DSUTILS_WEEK4: |
$cnt=3; |
break; |
} |
while( $t <= self::$iMax ) { |
self::$tickPositions[$i++] = $t; |
for($k=0; $k < $cnt; ++$k ) { |
$t += $hpw; |
if( $aMinor ) { |
self::$minTickPositions[$j++] = $t; |
} |
} |
$t += $hpw; |
} |
} |
static function doMonthly($aType,$aMinor=false) { |
$monthcount=0; |
$m = self::$startmonth; |
$y = self::$startyear; |
$i=0; $j=0; |
// Skip the first month label if it is before the startdate |
if( self::$startday == 1 ) { |
self::$tickPositions[$i++] = mktime(0,0,0,$m,1,$y); |
$monthcount=1; |
} |
if( $aType == 1 ) { |
if( self::$startday < 15 ) { |
self::$minTickPositions[$j++] = mktime(0,0,0,$m,15,$y); |
} |
} |
++$m; |
// Loop through all the years included in the scale |
for($y=self::$startyear; $y <= self::$endyear; ++$y ) { |
// Loop through all the months. There are three cases to consider: |
// 1. We are in the first year and must start with the startmonth |
// 2. We are in the end year and we must stop at last month of the scale |
// 3. A year in between where we run through all the 12 months |
$stopmonth = $y == self::$endyear ? self::$endmonth : 12; |
while( $m <= $stopmonth ) { |
switch( $aType ) { |
case DSUTILS_MONTH1: |
// Set minor tick at the middle of the month |
if( $aMinor ) { |
if( $m <= $stopmonth ) { |
if( !($y==self::$endyear && $m==$stopmonth && self::$endday < 15) ) |
self::$minTickPositions[$j++] = mktime(0,0,0,$m,15,$y); |
} |
} |
// Major at month |
// Get timestamp of first hour of first day in each month |
self::$tickPositions[$i++] = mktime(0,0,0,$m,1,$y); |
break; |
case DSUTILS_MONTH2: |
if( $aMinor ) { |
// Set minor tick at start of each month |
self::$minTickPositions[$j++] = mktime(0,0,0,$m,1,$y); |
} |
// Major at every second month |
// Get timestamp of first hour of first day in each month |
if( $monthcount % 2 == 0 ) { |
self::$tickPositions[$i++] = mktime(0,0,0,$m,1,$y); |
} |
break; |
case DSUTILS_MONTH3: |
if( $aMinor ) { |
// Set minor tick at start of each month |
self::$minTickPositions[$j++] = mktime(0,0,0,$m,1,$y); |
} |
// Major at every third month |
// Get timestamp of first hour of first day in each month |
if( $monthcount % 3 == 0 ) { |
self::$tickPositions[$i++] = mktime(0,0,0,$m,1,$y); |
} |
break; |
case DSUTILS_MONTH6: |
if( $aMinor ) { |
// Set minor tick at start of each month |
self::$minTickPositions[$j++] = mktime(0,0,0,$m,1,$y); |
} |
// Major at every third month |
// Get timestamp of first hour of first day in each month |
if( $monthcount % 6 == 0 ) { |
self::$tickPositions[$i++] = mktime(0,0,0,$m,1,$y); |
} |
break; |
} |
++$m; |
++$monthcount; |
} |
$m=1; |
} |
// For the case where all dates are within the same month |
// we want to make sure we have at least two ticks on the scale |
// since the scale want work properly otherwise |
if(self::$startmonth == self::$endmonth && self::$startyear == self::$endyear && $aType==1 ) { |
self::$tickPositions[$i++] = mktime(0 ,0 ,0, self::$startmonth + 1, 1, self::$startyear); |
} |
return array(self::$tickPositions,self::$minTickPositions); |
} |
static function GetTicks($aData,$aType=1,$aMinor=false,$aEndPoints=false) { |
$n = count($aData); |
return self::GetTicksFromMinMax($aData[0],$aData[$n-1],$aType,$aMinor,$aEndPoints); |
} |
static function GetAutoTicks($aMin,$aMax,$aMaxTicks=10,$aMinor=false) { |
$diff = $aMax - $aMin; |
$spd = 3600*24; |
$spw = $spd*7; |
$spm = $spd*30; |
$spy = $spd*352; |
if( self::$iUseWeeks ) |
$w = 'W'; |
else |
$w = 'd M'; |
// Decision table for suitable scales |
// First value: Main decision point |
// Second value: Array of formatting depending on divisor for wanted max number of ticks. <divisor><formatting><format-string>,.. |
$tt = array( |
array($spw, array(1,DSUTILS_DAY1,'d M',2,DSUTILS_DAY2,'d M',-1,DSUTILS_DAY4,'d M')), |
array($spm, array(1,DSUTILS_DAY1,'d M',2,DSUTILS_DAY2,'d M',4,DSUTILS_DAY4,'d M',7,DSUTILS_WEEK1,$w,-1,DSUTILS_WEEK2,$w)), |
array($spy, array(1,DSUTILS_DAY1,'d M',2,DSUTILS_DAY2,'d M',4,DSUTILS_DAY4,'d M',7,DSUTILS_WEEK1,$w,14,DSUTILS_WEEK2,$w,30,DSUTILS_MONTH1,'M',60,DSUTILS_MONTH2,'M',-1,DSUTILS_MONTH3,'M')), |
array(-1, array(30,DSUTILS_MONTH1,'M-Y',60,DSUTILS_MONTH2,'M-Y',90,DSUTILS_MONTH3,'M-Y',180,DSUTILS_MONTH6,'M-Y',352,DSUTILS_YEAR1,'Y',704,DSUTILS_YEAR2,'Y',-1,DSUTILS_YEAR5,'Y'))); |
$ntt = count($tt); |
$nd = floor($diff/$spd); |
for($i=0; $i < $ntt; ++$i ) { |
if( $diff <= $tt[$i][0] || $i==$ntt-1) { |
$t = $tt[$i][1]; |
$n = count($t)/3; |
for( $j=0; $j < $n; ++$j ) { |
if( $nd/$t[3*$j] <= $aMaxTicks || $j==$n-1) { |
$type = $t[3*$j+1]; |
$fs = $t[3*$j+2]; |
list($tickPositions,$minTickPositions) = self::GetTicksFromMinMax($aMin,$aMax,$type,$aMinor); |
return array($fs,$tickPositions,$minTickPositions,$type); |
} |
} |
} |
} |
} |
static function GetTicksFromMinMax($aMin,$aMax,$aType,$aMinor=false,$aEndPoints=false) { |
self::$starthour = date('G',$aMin); |
self::$startmonth = date('n',$aMin); |
self::$startday = date('j',$aMin); |
self::$startyear = date('Y',$aMin); |
self::$endmonth = date('n',$aMax); |
self::$endyear = date('Y',$aMax); |
self::$endday = date('j',$aMax); |
self::$iMin = $aMin; |
self::$iMax = $aMax; |
if( $aType <= DSUTILS_MONTH6 ) { |
self::doMonthly($aType,$aMinor); |
} |
elseif( $aType <= DSUTILS_WEEK4 ) { |
self::doWeekly($aType,$aMinor); |
} |
elseif( $aType <= DSUTILS_DAY4 ) { |
self::doDaily($aType,$aMinor); |
} |
elseif( $aType <= DSUTILS_YEAR5 ) { |
self::doYearly($aType,$aMinor); |
} |
else { |
JpGraphError::RaiseL(24003); |
} |
// put a label at the very left data pos |
if( $aEndPoints ) { |
$tickPositions[$i++] = $aData[0]; |
} |
// put a label at the very right data pos |
if( $aEndPoints ) { |
$tickPositions[$i] = $aData[$n-1]; |
} |
return array(self::$tickPositions,self::$minTickPositions); |
} |
} |
//============================================================================= |
// Class ReadFileData |
//============================================================================= |
Class ReadFileData { |
//---------------------------------------------------------------------------- |
// Desciption: |
// Read numeric data from a file. |
// Each value should be separated by either a new line or by a specified |
// separator character (default is ','). |
// Before returning the data each value is converted to a proper float |
// value. The routine is robust in the sense that non numeric data in the |
// file will be discarded. |
// |
// Returns: |
// The number of data values read on success, FALSE on failure |
//---------------------------------------------------------------------------- |
static function FromCSV($aFile,&$aData,$aSepChar=',',$aMaxLineLength=1024) { |
$rh = @fopen($aFile,'r'); |
if( $rh === false ) { |
return false; |
} |
$tmp = array(); |
$lineofdata = fgetcsv($rh, 1000, ','); |
while ( $lineofdata !== FALSE) { |
$tmp = array_merge($tmp,$lineofdata); |
$lineofdata = fgetcsv($rh, $aMaxLineLength, $aSepChar); |
} |
fclose($rh); |
// Now make sure that all data is numeric. By default |
// all data is read as strings |
$n = count($tmp); |
$aData = array(); |
$cnt=0; |
for($i=0; $i < $n; ++$i) { |
if( $tmp[$i] !== "" ) { |
$aData[$cnt++] = floatval($tmp[$i]); |
} |
} |
return $cnt; |
} |
//---------------------------------------------------------------------------- |
// Desciption: |
// Read numeric data from a file. |
// Each value should be separated by either a new line or by a specified |
// separator character (default is ','). |
// Before returning the data each value is converted to a proper float |
// value. The routine is robust in the sense that non numeric data in the |
// file will be discarded. |
// |
// Options: |
// 'separator' => ',', |
// 'enclosure' => '"', |
// 'readlength' => 1024, |
// 'ignore_first' => false, |
// 'first_as_key' => false |
// 'escape' => '\', # PHP >= 5.3 only |
// |
// Returns: |
// The number of lines read on success, FALSE on failure |
//---------------------------------------------------------------------------- |
static function FromCSV2($aFile, &$aData, $aOptions = array()) { |
$aDefaults = array( |
'separator' => ',', |
'enclosure' => chr(34), |
'escape' => chr(92), |
'readlength' => 1024, |
'ignore_first' => false, |
'first_as_key' => false |
); |
$aOptions = array_merge( |
$aDefaults, is_array($aOptions) ? $aOptions : array()); |
if( $aOptions['first_as_key'] ) { |
$aOptions['ignore_first'] = true; |
} |
$rh = @fopen($aFile, 'r'); |
if( $rh === false ) { |
return false; |
} |
$aData = array(); |
$aLine = fgetcsv($rh, |
$aOptions['readlength'], |
$aOptions['separator'], |
$aOptions['enclosure'] |
/*, $aOptions['escape'] # PHP >= 5.3 only */ |
); |
// Use numeric array keys for the columns by default |
// If specified use first lines values as assoc keys instead |
$keys = array_keys($aLine); |
if( $aOptions['first_as_key'] ) { |
$keys = array_values($aLine); |
} |
$num_lines = 0; |
$num_cols = count($aLine); |
while ($aLine !== false) { |
if( is_array($aLine) && count($aLine) != $num_cols ) { |
JpGraphError::RaiseL(24004); |
// 'ReadCSV2: Column count mismatch in %s line %d' |
} |
// fgetcsv returns NULL for empty lines |
if( !is_null($aLine) ) { |
$num_lines++; |
if( !($aOptions['ignore_first'] && $num_lines == 1) && is_numeric($aLine[0]) ) { |
for( $i = 0; $i < $num_cols; $i++ ) { |
$aData[ $keys[$i] ][] = floatval($aLine[$i]); |
} |
} |
} |
$aLine = fgetcsv($rh, |
$aOptions['readlength'], |
$aOptions['separator'], |
$aOptions['enclosure'] |
/*, $aOptions['escape'] # PHP >= 5.3 only*/ |
); |
} |
fclose($rh); |
if( $aOptions['ignore_first'] ) { |
$num_lines--; |
} |
return $num_lines; |
} |
// Read data from two columns in a plain text file |
static function From2Col($aFile, $aCol1, $aCol2, $aSepChar=' ') { |
$lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); |
if( $lines === false ) { |
return false; |
} |
$s = '/[\s]+/'; |
if( $aSepChar == ',' ) { |
$s = '/[\s]*,[\s]*/'; |
} |
elseif( $aSepChar == ';' ) { |
$s = '/[\s]*;[\s]*/'; |
} |
foreach( $lines as $line => $datarow ) { |
$split = preg_split($s,$datarow); |
$aCol1[] = floatval(trim($split[0])); |
$aCol2[] = floatval(trim($split[1])); |
} |
return count($lines); |
} |
// Read data from one columns in a plain text file |
static function From1Col($aFile, $aCol1) { |
$lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); |
if( $lines === false ) { |
return false; |
} |
foreach( $lines as $line => $datarow ) { |
$aCol1[] = floatval(trim($datarow)); |
} |
return count($lines); |
} |
static function FromMatrix($aFile,$aSepChar=' ') { |
$lines = @file($aFile,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); |
if( $lines === false ) { |
return false; |
} |
$mat = array(); |
$reg = '/'.$aSepChar.'/'; |
foreach( $lines as $line => $datarow ) { |
$row = preg_split($reg,trim($datarow)); |
foreach ($row as $key => $cell ) { |
$row[$key] = floatval(trim($cell)); |
} |
$mat[] = $row; |
} |
return $mat; |
} |
} |
define('__LR_EPSILON', 1.0e-8); |
//============================================================================= |
// Class LinearRegression |
//============================================================================= |
class LinearRegression { |
private $ix=array(),$iy=array(); |
private $ib=0, $ia=0; |
private $icalculated=false; |
public $iDet=0, $iCorr=0, $iStdErr=0; |
public function __construct($aDataX,$aDataY) { |
if( count($aDataX) !== count($aDataY) ) { |
JpGraph::Raise('LinearRegression: X and Y data array must be of equal length.'); |
} |
$this->ix = $aDataX; |
$this->iy = $aDataY; |
} |
public function Calc() { |
$this->icalculated = true; |
$n = count($this->ix); |
$sx2 = 0 ; |
$sy2 = 0 ; |
$sxy = 0 ; |
$sx = 0 ; |
$sy = 0 ; |
for( $i=0; $i < $n; ++$i ) { |
$sx2 += $this->ix[$i] * $this->ix[$i]; |
$sy2 += $this->iy[$i] * $this->iy[$i]; |
$sxy += $this->ix[$i] * $this->iy[$i]; |
$sx += $this->ix[$i]; |
$sy += $this->iy[$i]; |
} |
if( $n*$sx2 - $sx*$sx > __LR_EPSILON ) { |
$this->ib = ($n*$sxy - $sx*$sy) / ( $n*$sx2 - $sx*$sx ); |
$this->ia = ( $sy - $this->ib*$sx ) / $n; |
$sx = $this->ib * ( $sxy - $sx*$sy/$n ); |
$sy2 = $sy2 - $sy*$sy/$n; |
$sy = $sy2 - $sx; |
$this->iDet = $sx / $sy2; |
$this->iCorr = sqrt($this->iDet); |
if( $n > 2 ) { |
$this->iStdErr = sqrt( $sy / ($n-2) ); |
} |
else { |
$this->iStdErr = NAN ; |
} |
} |
else { |
$this->ib = 0; |
$this->ia = 0; |
} |
} |
public function GetAB() { |
if( $this->icalculated == false ) |
$this->Calc(); |
return array($this->ia, $this->ib); |
} |
public function GetStat() { |
if( $this->icalculated == false ) |
$this->Calc(); |
return array($this->iStdErr, $this->iCorr, $this->iDet); |
} |
public function GetY($aMinX, $aMaxX, $aStep=1) { |
if( $this->icalculated == false ) |
$this->Calc(); |
$yy = array(); |
$i = 0; |
for( $x=$aMinX; $x <= $aMaxX; $x += $aStep ) { |
$xx[$i ] = $x; |
$yy[$i++] = $this->ia + $this->ib * $x; |
} |
return array($xx,$yy); |
} |
} |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/jpgraph_regstat.php |
---|
New file |
0,0 → 1,215 |
<?php |
/*======================================================================= |
// File: JPGRAPH_REGSTAT.PHP |
// Description: Regression and statistical analysis helper classes |
// Created: 2002-12-01 |
// Ver: $Id: jpgraph_regstat.php 1131 2009-03-11 20:08:24Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
*/ |
//------------------------------------------------------------------------ |
// CLASS Spline |
// Create a new data array from an existing data array but with more points. |
// The new points are interpolated using a cubic spline algorithm |
//------------------------------------------------------------------------ |
class Spline { |
// 3:rd degree polynom approximation |
private $xdata,$ydata; // Data vectors |
private $y2; // 2:nd derivate of ydata |
private $n=0; |
function __construct($xdata,$ydata) { |
$this->y2 = array(); |
$this->xdata = $xdata; |
$this->ydata = $ydata; |
$n = count($ydata); |
$this->n = $n; |
if( $this->n !== count($xdata) ) { |
JpGraphError::RaiseL(19001); |
//('Spline: Number of X and Y coordinates must be the same'); |
} |
// Natural spline 2:derivate == 0 at endpoints |
$this->y2[0] = 0.0; |
$this->y2[$n-1] = 0.0; |
$delta[0] = 0.0; |
// Calculate 2:nd derivate |
for($i=1; $i < $n-1; ++$i) { |
$d = ($xdata[$i+1]-$xdata[$i-1]); |
if( $d == 0 ) { |
JpGraphError::RaiseL(19002); |
//('Invalid input data for spline. Two or more consecutive input X-values are equal. Each input X-value must differ since from a mathematical point of view it must be a one-to-one mapping, i.e. each X-value must correspond to exactly one Y-value.'); |
} |
$s = ($xdata[$i]-$xdata[$i-1])/$d; |
$p = $s*$this->y2[$i-1]+2.0; |
$this->y2[$i] = ($s-1.0)/$p; |
$delta[$i] = ($ydata[$i+1]-$ydata[$i])/($xdata[$i+1]-$xdata[$i]) - |
($ydata[$i]-$ydata[$i-1])/($xdata[$i]-$xdata[$i-1]); |
$delta[$i] = (6.0*$delta[$i]/($xdata[$i+1]-$xdata[$i-1])-$s*$delta[$i-1])/$p; |
} |
// Backward substitution |
for( $j=$n-2; $j >= 0; --$j ) { |
$this->y2[$j] = $this->y2[$j]*$this->y2[$j+1] + $delta[$j]; |
} |
} |
// Return the two new data vectors |
function Get($num=50) { |
$n = $this->n ; |
$step = ($this->xdata[$n-1]-$this->xdata[0]) / ($num-1); |
$xnew=array(); |
$ynew=array(); |
$xnew[0] = $this->xdata[0]; |
$ynew[0] = $this->ydata[0]; |
for( $j=1; $j < $num; ++$j ) { |
$xnew[$j] = $xnew[0]+$j*$step; |
$ynew[$j] = $this->Interpolate($xnew[$j]); |
} |
return array($xnew,$ynew); |
} |
// Return a single interpolated Y-value from an x value |
function Interpolate($xpoint) { |
$max = $this->n-1; |
$min = 0; |
// Binary search to find interval |
while( $max-$min > 1 ) { |
$k = ($max+$min) / 2; |
if( $this->xdata[$k] > $xpoint ) |
$max=$k; |
else |
$min=$k; |
} |
// Each interval is interpolated by a 3:degree polynom function |
$h = $this->xdata[$max]-$this->xdata[$min]; |
if( $h == 0 ) { |
JpGraphError::RaiseL(19002); |
//('Invalid input data for spline. Two or more consecutive input X-values are equal. Each input X-value must differ since from a mathematical point of view it must be a one-to-one mapping, i.e. each X-value must correspond to exactly one Y-value.'); |
} |
$a = ($this->xdata[$max]-$xpoint)/$h; |
$b = ($xpoint-$this->xdata[$min])/$h; |
return $a*$this->ydata[$min]+$b*$this->ydata[$max]+ |
(($a*$a*$a-$a)*$this->y2[$min]+($b*$b*$b-$b)*$this->y2[$max])*($h*$h)/6.0; |
} |
} |
//------------------------------------------------------------------------ |
// CLASS Bezier |
// Create a new data array from a number of control points |
//------------------------------------------------------------------------ |
class Bezier { |
/** |
* @author Thomas Despoix, openXtrem company |
* @license released under QPL |
* @abstract Bezier interoplated point generation, |
* computed from control points data sets, based on Paul Bourke algorithm : |
* http://local.wasp.uwa.edu.au/~pbourke/geometry/bezier/index2.html |
*/ |
private $datax = array(); |
private $datay = array(); |
private $n=0; |
function __construct($datax, $datay, $attraction_factor = 1) { |
// Adding control point multiple time will raise their attraction power over the curve |
$this->n = count($datax); |
if( $this->n !== count($datay) ) { |
JpGraphError::RaiseL(19003); |
//('Bezier: Number of X and Y coordinates must be the same'); |
} |
$idx=0; |
foreach($datax as $datumx) { |
for ($i = 0; $i < $attraction_factor; $i++) { |
$this->datax[$idx++] = $datumx; |
} |
} |
$idx=0; |
foreach($datay as $datumy) { |
for ($i = 0; $i < $attraction_factor; $i++) { |
$this->datay[$idx++] = $datumy; |
} |
} |
$this->n *= $attraction_factor; |
} |
/** |
* Return a set of data points that specifies the bezier curve with $steps points |
* @param $steps Number of new points to return |
* @return array($datax, $datay) |
*/ |
function Get($steps) { |
$datax = array(); |
$datay = array(); |
for ($i = 0; $i < $steps; $i++) { |
list($datumx, $datumy) = $this->GetPoint((double) $i / (double) $steps); |
$datax[$i] = $datumx; |
$datay[$i] = $datumy; |
} |
$datax[] = end($this->datax); |
$datay[] = end($this->datay); |
return array($datax, $datay); |
} |
/** |
* Return one point on the bezier curve. $mu is the position on the curve where $mu is in the |
* range 0 $mu < 1 where 0 is tha start point and 1 is the end point. Note that every newly computed |
* point depends on all the existing points |
* |
* @param $mu Position on the bezier curve |
* @return array($x, $y) |
*/ |
function GetPoint($mu) { |
$n = $this->n - 1; |
$k = 0; |
$kn = 0; |
$nn = 0; |
$nkn = 0; |
$blend = 0.0; |
$newx = 0.0; |
$newy = 0.0; |
$muk = 1.0; |
$munk = (double) pow(1-$mu,(double) $n); |
for ($k = 0; $k <= $n; $k++) { |
$nn = $n; |
$kn = $k; |
$nkn = $n - $k; |
$blend = $muk * $munk; |
$muk *= $mu; |
$munk /= (1-$mu); |
while ($nn >= 1) { |
$blend *= $nn; |
$nn--; |
if ($kn > 1) { |
$blend /= (double) $kn; |
$kn--; |
} |
if ($nkn > 1) { |
$blend /= (double) $nkn; |
$nkn--; |
} |
} |
$newx += $this->datax[$k] * $blend; |
$newy += $this->datay[$k] * $blend; |
} |
return array($newx, $newy); |
} |
} |
// EOF |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/jpgraph_canvas.php |
---|
New file |
0,0 → 1,95 |
<?php |
/*======================================================================= |
// File: JPGRAPH_CANVAS.PHP |
// Description: Canvas drawing extension for JpGraph |
// Created: 2001-01-08 |
// Ver: $Id: jpgraph_canvas.php 1923 2010-01-11 13:48:49Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
*/ |
//=================================================== |
// CLASS CanvasGraph |
// Description: Creates a simple canvas graph which |
// might be used together with the basic Image drawing |
// primitives. Useful to auickoly produce some arbitrary |
// graphic which benefits from all the functionality in the |
// graph liek caching for example. |
//=================================================== |
class CanvasGraph extends Graph { |
//--------------- |
// CONSTRUCTOR |
function __construct($aWidth=300,$aHeight=200,$aCachedName="",$timeout=0,$inline=1) { |
parent::__construct($aWidth,$aHeight,$aCachedName,$timeout,$inline); |
} |
//--------------- |
// PUBLIC METHODS |
function InitFrame() { |
$this->StrokePlotArea(); |
} |
// Method description |
function Stroke($aStrokeFileName="") { |
if( $this->texts != null ) { |
for($i=0; $i < count($this->texts); ++$i) { |
$this->texts[$i]->Stroke($this->img); |
} |
} |
if( $this->iTables !== null ) { |
for($i=0; $i < count($this->iTables); ++$i) { |
$this->iTables[$i]->Stroke($this->img); |
} |
} |
$this->StrokeTitles(); |
// If the filename is the predefined value = '_csim_special_' |
// we assume that the call to stroke only needs to do enough |
// to correctly generate the CSIM maps. |
// We use this variable to skip things we don't strictly need |
// to do to generate the image map to improve performance |
// a best we can. Therefor you will see a lot of tests !$_csim in the |
// code below. |
$_csim = ($aStrokeFileName===_CSIM_SPECIALFILE); |
// We need to know if we have stroked the plot in the |
// GetCSIMareas. Otherwise the CSIM hasn't been generated |
// and in the case of GetCSIM called before stroke to generate |
// CSIM without storing an image to disk GetCSIM must call Stroke. |
$this->iHasStroked = true; |
if( !$_csim ) { |
// Should we do any final image transformation |
if( $this->iImgTrans ) { |
if( !class_exists('ImgTrans',false) ) { |
require_once('jpgraph_imgtrans.php'); |
} |
$tform = new ImgTrans($this->img->img); |
$this->img->img = $tform->Skew3D($this->iImgTransHorizon,$this->iImgTransSkewDist, |
$this->iImgTransDirection,$this->iImgTransHighQ, |
$this->iImgTransMinSize,$this->iImgTransFillColor, |
$this->iImgTransBorder); |
} |
// If the filename is given as the special _IMG_HANDLER |
// then the image handler is returned and the image is NOT |
// streamed back |
if( $aStrokeFileName == _IMG_HANDLER ) { |
return $this->img->img; |
} |
else { |
// Finally stream the generated picture |
$this->cache->PutAndStream($this->img,$this->cache_name,$this->inline,$aStrokeFileName); |
return true; |
} |
} |
} |
} // Class |
/* EOF */ |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/jpgraph_antispam.php |
---|
New file |
0,0 → 1,615 |
<?php |
//======================================================================= |
// File: JPGRAPH_ANTISPAM.PHP |
// Description: Genarate anti-spam challenge |
// Created: 2004-10-07 |
// Ver: $Id: jpgraph_antispam.php 1106 2009-02-22 20:16:35Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
class HandDigits { |
public $chars = array(); |
public $iHeight=30, $iWidth=30; |
function __construct() { |
//========================================================== |
// lj-small.jpg |
//========================================================== |
$this->chars['j'][0]= 658 ; |
$this->chars['j'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABUDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAUGBAf/xAAsEAACAQMDAwMBCQAAAAAAAAAB'. |
'AgMEBREAEjEGIUEUUXGBBxMVIiNSYWKC/8QAFgEBAQEAAAAAAAAAAAAAAAAAAwEC/8QAGhEAAwADAQAAAAAAAAAAAAAAAAECERIh'. |
'Mv/aAAwDAQACEQMRAD8A6veK2st8zRWSyV1dUBfvHaGVI4hknsS7AFv4AyM57ayWbqeS+11xtT2etttwo4YqhEqnQs5bcAfyk4AZ'. |
'SOeD441TKRTyingUBG4/ah8j684+dSFzh/BvtaslejMUu9DPQTDnLx4lQ/ONw1TGBm0jdRWqguEMghEisWilgDmNs4Ze+MEEEH40'. |
'aUVFTa7JeLjRXu4GjhmnNbSfqFQVlA3rkckOjH/Q99Glmkl0C/Q06pvsvT9vttXHDF6T1KrWbs5gRgQJM+FDlQxPhjpF1XcVq+qe'. |
'jEoKiOecXBqh2TDDYIXLKuP6549xk8auI6aJqV45oknWdNswkAIkGMYIxjGO2NR1F0LZY5qkWqkS1xrM0M8lMSJpY+TGrnJiQ577'. |
'cEgeNHhi7D3qC3UN69M8tIakRhgrh9o748+eNGtcCiKjjpkQKlMTEg3ZwoxtHHtgfTRpYXArvp//2Q==' ; |
//========================================================== |
// lf-small.jpg |
//========================================================== |
$this->chars['f'][0]= 633 ; |
$this->chars['f'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAQFBgcC/8QAKxAAAgEDAwMCBQUAAAAAAAAA'. |
'AQIDBBEhAAUGEjFBEyIHFFFhoRUzYnGS/8QAFQEBAQAAAAAAAAAAAAAAAAAAAQP/xAAaEQACAwEBAAAAAAAAAAAAAAAAAQIRMRIh'. |
'/9oADAMBAAIRAxEAPwDcnmLoIkiSYsouC3tA++O2lU9WkqVjJ+YdhZLsQI/4/YfQm50kZP0vbmaCSU0SRNIH6sghb9INs3t38dvp'. |
'akUuz8x5DwdN5peS1jV1dSipSiVUigIcdQjQ26lIB/c6r3F86SZpE/zCFJaqsihQNhRgdj3Jyfxo0jDSbXHt9Oph9RAoV3qJGltY'. |
'HDOxyb/nRpV0D3RXle21m48XraOk3IUSemUaV4g4Zc9ShcDtgff+tQfwvjq34Dtku7buamFqeJKemCCMxKFsEJU+/FrX8d76sEHG'. |
'aNItzr4usVNdG3S0rmRYAVwEUmyjyQLZ11x7aF4zs9DQOyzml29I2cLa/pixIHi99DFCtU9dFuLIaijo9qiYPmR2mZmB9thgAHOD'. |
'4+mjUrURyrUNMZFEkkIOFuFAbsP9d/OjVIQ6Vh4tP//Z' ; |
//========================================================== |
// lb-small.jpg |
//========================================================== |
$this->chars['b'][0]= 645 ; |
$this->chars['b'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABUDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAYCAwUH/8QAKxAAAQMDAwMDAwUAAAAAAAAA'. |
'AQIDBAAFEQYSIRMxUSJBYQcVI2JxgqHw/8QAFQEBAQAAAAAAAAAAAAAAAAAAAQL/xAAYEQEBAQEBAAAAAAAAAAAAAAAAATERYf/a'. |
'AAwDAQACEQMRAD8A6H95mxNYwLXcX+pCuilSLXJ6YSplaUELjqxwe4IJ5PIPamJ2V0bPcS7+NxCX1cHggAnIP+xSd9RyzHh2m7FQ'. |
'Q1CvMNQWTjCt+HFD+PB/Y1fI1PL1HFFt0zaGblFdJQ9cJjpZiqPJUlBAKnPcEpGB5NNRKdrOl1NlgiQol4R2w4Sc5VtGf7opZteo'. |
'LhdorjUSM5FnQnlR50NeHQysYxtVxlJHIPgjtRRD3xkaghs6juumdHz4+Y7RVPnt59K2mk7W+fcKWsZ7djTXMkW+xMP3GRJjwIEN'. |
'HTG/CWx5wPY8AADx2NYk3SL9wukvUjGobnBkORksIbjdMANozgEqSo8qJPGO/wAVO36IsjUmBIfZfuM7epZk3F9UhSSk5O0K9Kcq'. |
'8AcU3UzFuhUSBFud6nRXoz96mqmJZWg7m2dqUNhWBwdqQSP1UU5c/FFCn//Z' ; |
//========================================================== |
// d6-small.jpg |
//========================================================== |
$this->chars['6'][0]= 645 ; |
$this->chars['6'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. |
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAEBAAMBAAAAAAAAAAAAAAAABgMEBwX/xAAvEAABAwMC'. |
'BAQEBwAAAAAAAAABAgMEAAURBiESIjFRBxMUQRUWMmFTYnGRkrHC/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAFhEBAQEAAAAA'. |
'AAAAAAAAAAAAAAER/9oADAMBAAIRAxEAPwDslwiR3oDku8ONttsAvDiVyMcO/ET7ke5/aoOz6k1Vr5htNjW7a7M1yO3NTQU9JUDu'. |
'GgrlSn8xyf6p4gXaHJvNps9/mKZtSkGdMjRwpfqAFBLLACRlZUrJONsI2717No1lbZ10kx7XGnRpKWQ/6GVGMfzEJ5VFIVtsOH6e'. |
'wyKVhYsia0y22pLThSkJK1uniVgdThOM0ol+StIUhpopIyCFq3H8aUVCwnG3PGe4Rp6fLXJtMdyM0ojcIWvIz3HFnAPfrWTXb6GN'. |
'WaLXDwZjVz8pKEfhuIUFg/bAz9sVJ61nt61mxJFslLtq7e5yPqiBT4UDklKw4MDpt+u+9bFiu9riXNu83R+fcr6tohuQ5HQhmK37'. |
'paaC8DruScmg6X8KkjZEhbaB9KEyFYSOw26Uqd+e7Qerl5z74DY/1SomP//Z' ; |
//========================================================== |
// lx-small.jpg |
//========================================================== |
$this->chars['x'][0]= 650 ; |
$this->chars['x'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABMDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAUHBgj/xAApEAABAwMDAwQCAwAAAAAAAAAB'. |
'AgMEBQYRACFBBxIxFCJRgRNxkcHw/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/xAAWEQEBAQAAAAAAAAAAAAAAAAAAEQH/2gAMAwEA'. |
'AhEDEQA/AH9t3pKvO14UykVARa/HfAlxlDKXR24V2p3z7RlPwdtMep91uWdRGHWELjuTFFtLvcC4SNznnH+21O7ttiodOq1BvC0E'. |
'p9I0lSX2kgqCSklK+5PKCMAng6zV2XRO6u3lSIURtbDRShltlZHa0tW7q/0MeTwnjxq1Jiw2xc9xTLbhSVU5iaXUFfqFFILgJOCd'. |
'9Gt3SXabR6REpkL8yo0RpLCFNx1qBCRjOQMHxo0pEr6o3um2LVYpMEpTVqg25lHn08dfcB9kEgfZ1LIFDuawqZRb7aQlLTzqglsg'. |
'9wQdveOEqBIB425xqhQuk8qo9UKlPrlRblw2ZBeCSVKW6CcoSrI2AGOT41SKzT4dYtmdS5bIXDZhNoWgbZJ94x8AYT/GkM03oNUc'. |
'uKgwqtTZDTMOU0FttqRkoHggnPkEEHRrkJ6t1SlSHYUOc6zHaWrsbQrATk5/vRqK/9k=' ; |
//========================================================== |
// d2-small.jpg |
//========================================================== |
$this->chars['2'][0]= 606 ; |
$this->chars['2'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. |
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEQMBIgACEQEDEQH/xAAYAAEBAQEBAAAAAAAAAAAAAAAFAAQHAv/EACsQAAEDBAEC'. |
'BAYDAAAAAAAAAAIBAwQABQYRIRIxQVFhcQcTFSJSU5GU0f/EABcBAAMBAAAAAAAAAAAAAAAAAAECAwT/xAAZEQACAwEAAAAAAAAA'. |
'AAAAAAAAARESUUH/2gAMAwEAAhEDEQA/AOqXm/Q8dxmOL4PPSnCSNFixx6nXnkXgRT3Te17JWbGsveueSyLZdbPItNxOKLzTLjou'. |
'gYCSoSoY8ISKSbFeUrzkdlnTL1YshskiErkQnFEZaF8kkdBBVdjyi6RNL5+9F486eS/ECVkcBtDt1vZcho5viS8ZCp9C9tAIAm/F'. |
'VoPRU+HRtJ5JVRP1kP0PfwP+1VKrHBMliXG4Nw8VgE4xGkuqk2S1wTUNEVdIvgpL9iL6KtNxY7WOwo9tt0RCitj0sR2uCbFPPzH1'. |
'7+6rRuSRcljMBMsUy2tky045KOawZk5xtEFBJEROO3hx61kh2rPCIX3MhsyC4QmfTbC6lH8dq5212qwkiG5H6Y/9R2qm+ofxqqsL'. |
'DLZ6f//Z' ; |
//========================================================== |
// lm-small.jpg |
//========================================================== |
$this->chars['m'][0]= 649 ; |
$this->chars['m'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGgAAAgMBAQAAAAAAAAAAAAAAAAcDBAUCBv/EAC0QAAICAQMCBAMJAAAAAAAA'. |
'AAECAwQRAAUSBiETMVFhB2KhFSIyQVJxgZHB/8QAFgEBAQEAAAAAAAAAAAAAAAAAAgED/8QAGREBAQEAAwAAAAAAAAAAAAAAAQAR'. |
'EiEx/9oADAMBAAIRAxEAPwB0MI2lIdgI0Cly3kFXLEn2zx1FDdp7rbpbjUtRWKio3hyxOGQllJzkegX66rQ2qW87Zuk9S5FNVmru'. |
'iywyBhjDKTkeXfSr+GRfYtq2KAO32b1BGxAZu0dyJ2DKPTxY1wPddVszycUq2Golq8jRWbcnJWwCVGMjz+VQP50atxMtm2ZUOY4l'. |
'4qfUnBP0x/Z0amy4jJm10Tt2yddWasFmfaRfdrlG3UcgArnxKzJ+Fu4DqCMkcgNem2DoWav8PLfTm+FPEkuSNTnqueS5bnHIv6CG'. |
'LNjJwM99bm67NB1Ht89KSxNXnr2hNDbiUc47K4KyD2GQMfmMjUnS+7vuIktTqPCaaWCqAMMojPFyw8hyYMQBnAwNJHYGXPTsW9VN'. |
'jg2zf50W9zk524GAEihuz+xbIOD82jW5TkjtRPZkTkJ+4VgDhQfuj/f3OjUxl1f/2Q==' ; |
//========================================================== |
// lt-small.jpg |
//========================================================== |
$this->chars['t'][0]= 648 ; |
$this->chars['t'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAQDBQYH/8QAJxAAAQMDAgYDAQEAAAAAAAAA'. |
'AQIDBAUGEQASEyExQVFhIjJxFSP/xAAWAQEBAQAAAAAAAAAAAAAAAAABAAP/xAAZEQADAQEBAAAAAAAAAAAAAAAAAREhMUH/2gAM'. |
'AwEAAhEDEQA/AO4BLEiEy7uG4IGxxs5IOOx76wd2XYidSp1HoD70240gcNNPbDyI6wQQpaz8E9MczkdhqtbsKYLieDk6WLKmZmmL'. |
'Hk7AHVkbkLI+RQc7uRxgkfr1tx2rGu6VbToLVKkhU+kbugGf9WfaknCk5ycaX0zmaa+3JkqvW/CmzojsB9xoF6OoFK0r6HOcEDI0'. |
'aefTuKX5ScMdC14HYq8n12zo1DEUcKTGg1Z+hyBwoPBVIiA/VQyOIgedhUCB4WMfXSV3UufVLcTUIqVf26K6mXDbPVRRzKT54iMg'. |
'+zjtq6mtsyJjclxpKlUhSXEbkgkqWnBx4+J5e/zU0pZemPvJJQzEPDfQOrwwFY9AZ5eeYPLV6FwhoFYZuigxpkJeIjqAeIoAk9wA'. |
'D46EnuD+6Nc1smDNrTlRkxqtMo1vzKhIdYgU9YDqVpISrLhHxSSd21I0aYyqP//Z' ; |
//========================================================== |
// li-small.jpg |
//========================================================== |
$this->chars['i'][0]= 639 ; |
$this->chars['i'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABYDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAABwAGBP/EACcQAAEEAQMEAgIDAAAAAAAAAAEC'. |
'AwQRBQAGEiExQVEHExSBFWFx/8QAFgEBAQEAAAAAAAAAAAAAAAAAAgMB/8QAGBEBAQEBAQAAAAAAAAAAAAAAAAECMRH/2gAMAwEA'. |
'AhEDEQA/AE7c+5M9BeRG29t1WUfKFFYW+GvrI7WD3B9g140YD5T36rcErDjbUR6dCBdejsKUpxITXI2FUrooCh70yvxzHyIlMvuK'. |
'eVSH7IKEpJoKqu/ahddLryR/aMiO187bsmrWShhp1AZS2XHHrWhNJrzdf7f7GiVcHk3sptmHkJcJ2DIftS2FrKlJPXudWuLGYeQp'. |
't2fmEIckqIZaaKuSGG0lQ4gduRoFRHQ9AOgs2lOJbk9aSUlpjGvAWeSVH2VKq/2dFPw3IjyJe8s281ct3I9UoHJXGiQkD2STrSZ7'. |
'Yf8AOl7JTdw5eOCz0jw3+LbYCfA9nz71msb8KMxoTGTw+5srjsipAdDqFBQBIuiOl6KrdYyJMyTCshlw2G3Fr/HiNqNNAqJJUoGl'. |
'KND+h47km1bZwsvCbYYjycxIyK1qDv2yEi0hQviK8atKDcy9j//Z' ; |
//========================================================== |
// lp-small.jpg |
//========================================================== |
$this->chars['p'][0]= 700 ; |
$this->chars['p'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGgAAAQUBAAAAAAAAAAAAAAAAAAECBAUGB//EAC8QAAEDAwMCBAMJAAAAAAAA'. |
'AAECAwQFESEABhIiMRMVUWEHFEEWIzIzcYGRocH/xAAWAQEBAQAAAAAAAAAAAAAAAAADAgH/xAAcEQACAgIDAAAAAAAAAAAAAAAA'. |
'AQIxAxESIUH/2gAMAwEAAhEDEQA/AOh703xG21DMeOyqoVNDjSzERiwU6Ep5qtZNycA97HTF13d33KWtmlt9xwkLl1NkXVxIuQgK'. |
'wLj+hqBvel0qmbR8GnR22nJNZiLeeKr8nDIT1OLJucX+uPbWom7iocRpafOac5MX1ALltp/Cbi+cJH++utdh+WVNL3PNdNYpdWgx'. |
'Y0qmLZSrwJJcQoOJ5XKlJFu4HbJOjVbt+V5nu7eopNRivqcdhK+bFnWwA1Y2AOcgjvj9dGlxy0g5y0xd+hNXoG24C4obizq3HZUh'. |
'YHqtRHD06bG/8a0MbbG1mqekxaBSGmgkrcdcitlLfrckZIz7DUatbeFak0tyRLUwzT5vmiGm0cufEkFBJItfkD+59tKmiO12atFa'. |
'eQukO3ejUxgENqTcfnE5WbkHiOnJ76N2IqI1DibabptS+zkZhtp90F2Y0S026EkAFK/qL46cXv65NVZDfxHmVCK4DE2/RX/lRFbA'. |
'C5LwAyq2EtpHZI7mxPYDRqoctdESimz/2Q==' ; |
//========================================================== |
// le-small.jpg |
//========================================================== |
$this->chars['e'][0]= 700 ; |
$this->chars['e'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABgDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAYEBQcB/8QAKhAAAQMCBAUEAwEAAAAAAAAA'. |
'AgEDBAURAAYSIQciMTJBE0JRYRQVFoH/xAAXAQEBAQEAAAAAAAAAAAAAAAAAAgED/8QAGREAAwEBAQAAAAAAAAAAAAAAAAERAjFB'. |
'/9oADAMBAAIRAxEAPwDTszvhEYCoS80BTm2bCjQRwdAzVe2yopkpJtpRUVfjEIc4V2oMerByg5Ji30oMyS3GeMunK0upfnu09MdJ'. |
'p2scTmWnnGfx6HThktgLfKj7xEOqyr7QBbL41LhBzpxbcOru0LKDLdSnOHoaltNqSC4qWL0x9xbJYum69caczSaHmGmTmpDUYn4l'. |
'UiqjkynzAVtwV23Ud+X4Ibpa2DCPkjhfUaRO/p8yzpb+YHhUmhbev6ZEll1lvqK3jt2XrbBgp6HVwsK3THpfEubGSoOUyFMpbJmL'. |
'Deh6SgOGKti57EuY6l62JMWdJy7k3hg1LkOozEbVm7suQSkTiKtkEfP1pH664Za/QItccgI4bseTHdNxiXHLQ8yVl7V32XyioqL5'. |
'TGc1ng6eYs0idczXUZscBBABWgEhEtfKNuUezwPnBhEuj8X2M21z9BR6NUX211Kk/UKKAjuhkPhL7XVf8vtgw7UPJlEyrDWFSYLb'. |
'LBNF6qrzG6t0spEu6+fpL7YMXhUndp//2Q==' ; |
//========================================================== |
// la-small.jpg |
//========================================================== |
$this->chars['a'][0]= 730 ; |
$this->chars['a'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABoDASIAAhEBAxEB/8QAGAABAAMBAAAAAAAAAAAAAAAABgMEBwX/xAAvEAABAwIFAQcCBwAAAAAAAAAB'. |
'AgMEBREAEiExQQYHFBUiUXGBE2EyQkNSgpHh/8QAFwEBAQEBAAAAAAAAAAAAAAAAAAMBAv/EABkRAAMBAQEAAAAAAAAAAAAAAAAB'. |
'IQIRMf/aAAwDAQACEQMRAD8AfdQ1pxjqZMSn0mRUZRYDaklJCE3OawO2ttTxY4hl07qFMVs1Ku02kpPnRGhsAqz8W9T9wDjozq6o'. |
'Q1lDrcZLGVcmUoZg0obpufxK3Ftt9ccqB1GgBcmLSqtVEqOZcr6ARm/kbXHt7DEtc7WTJKTJqEWvRKfLqL9QplSjuPtGVYOJKBrm'. |
't+U+n94WGStZzNypmRWqckUKTbixy6jAfxPxHtCgKqFNlU5huK6pLMndSlegG4J45N8aKmTMKQRBsCNMzwB+RbHWHGEAZlPZX2hx'. |
'qZIC34ygZoYUbB50JSkFXFhZR9BrpheR4fIbQ6gvurJ7q02bIQTuAOAN8x40HAxRr3TrNRpBmSHVt1KMlTyJTCsqkKAPlSf28W+c'. |
'UGaD1c9HSR1HFUh9tJU45EBcAtcC9+P9wqbg8IAto9o81yputrVGpiUkgHKkqUTZI32+cKm1z1tIUgPBBAKQ4UBQH3uL3xmXSXep'. |
'HVDtXStE5K5jlPU7PF3Q41+okJFkjgC+3OuNSYiSzHaLtRcW4UDMpLYSCbakDW3thhum5p//2Q==' ; |
//========================================================== |
// d9-small.jpg |
//========================================================== |
$this->chars['9'][0]= 680 ; |
$this->chars['9'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. |
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABAUGBwP/xAArEAABAwMD'. |
'AgYBBQAAAAAAAAABAgMEBQYRABIhE1EUIjEzQUIHMlJhcdH/xAAWAQEBAQAAAAAAAAAAAAAAAAACAQD/xAAYEQEAAwEAAAAAAAAA'. |
'AAAAAAAAAREhQf/aAAwDAQACEQMRAD8AkK7brF6X7XpMeGoKhFMLEeT4ZUheEhanF4OcZ2pTgDykk92bZpdCsi7aezLjxkIPUZiV'. |
'RSCy8hah7EkZ27yM7V+iscal5bE22Lon1qNDmSKROd8Sl+Ix1lMOlIS4HGgQpbStoUCnlJz8HmsXtW3Lst2rmBAelLMRRekOwnYz'. |
'Edls9QKKnOVLyk7UgcbzzrdBthqEJJwZbAI4x1U/7o1TaFa9lG36aXaZTy54VrcXUgrzsGdx+T30aNydweqVw1GS87T6Lb86Q4ha'. |
'my/IAYjZBx+snKk99oOQMf1AViE65SY348hzFy6hPKnqtKz7DC1lbqyPrvJKUJ7H+M6Wrt3InP7o1brFNp4bCDGhxGAsqz69VSiQ'. |
'ORwBxrrQ7itm1ac7Hp0WoGTIc3PSn0pccdcP2WorycfA1RaRHjxosZqOyhtDTSAhCf2gDAGjVHTd9sKSCumynFEZK1tIJUe58/ro'. |
'1V1//9k=' ; |
//========================================================== |
// d5-small.jpg |
//========================================================== |
$this->chars['5'][0]= 632 ; |
$this->chars['5'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. |
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABgIFBwT/xAAoEAABAwME'. |
'AQQCAwAAAAAAAAABAgMEBQYRABIhIkEUMVFhBxNCgaH/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAv/EABcRAQEBAQAAAAAAAAAAAAAA'. |
'AAABEUH/2gAMAwEAAhEDEQA/ANGvW4YVOeiRX5b4mv5Sin05IdlupPKdo/j2SO3+6TbPNQvOsTVz33KRT4csR3YUF7Dsh5OSFvug'. |
'kqG4FPBxnjxpvvi4KZb1pTpU+QwxUi2Y7ZIAefUk5ATxnB9/gbtL/wCH1UpuhPUlZlMVaQ0mS8zJjqZOPfc2TwpIUonI9tw40R1r'. |
'WNGq/wBdJR1XT3lqHBUnGCfkfWjRWs1ve249erQqQYjOtN1FqPUpCXQ4WIzQSsJwT0UpRwQPG0nzqyuNHobjsl9kBuWqoOoXtT1/'. |
'WppZcA8lKRj64HxqU+3KpAr6plElRVKef3S4E0K9O8pLXVzKcqSsJAB9wSAca6bSoNXeuA1+5pEV+SGFNU1iKVFqI0Vdx2AJUeoz'. |
'8DGlTDwG3CAf3q/pI0ah6MDhLz6U+EpXwPoaNMU//9k=' ; |
//========================================================== |
// d1-small.jpg |
//========================================================== |
$this->chars['1'][0]= 646 ; |
$this->chars['1'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. |
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEwMBIgACEQEDEQH/xAAZAAADAAMAAAAAAAAAAAAAAAAABQYCBAf/xAApEAACAQMD'. |
'AwQBBQAAAAAAAAABAgMEBREABiESMUEHEyJRkSNCYXGB/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAFxEBAQEBAAAAAAAAAAAA'. |
'AAAAAAEREv/aAAwDAQACEQMRAD8A6jdd4WLbstILnc4Uq0VoWpkJknb6IjXLHJUePOlez923fcW4r1SxWlqC2UbdKirQif3Xw3yA'. |
'OFAGT09/kO3OmV3a20MFRf6lIYPcpy7yRRAzgxjIy2M8YwcdiBzpX6d22VNvUlTXsFkuwkrKqNSfnK7F8OTzwrAY+l5zoxKskudN'. |
'EgQPUT9PBkWF3DH+1GPxo1mLnRoAqF2VRgGOFmX/AAgY/GjRUP6hVMFv2FuFqUvUGrpDFJMBnpdyF5bsAQew7Hxzp6LZNT0yQ1DI'. |
'wp0QCFBhD0jCsfLZHxbx5xxpTuvb1+v9PV7Ztk9roLPLCjmSSN3mX5ZwqjCgZX7PfWxDQb2in96pv9qq46aTE0bW4x9ceAWAYPwS'. |
'PsYzoixgmheBGjIVcYCnjp/jHjHbRpe1JLn9OnopE/a0ykvjwDx47aNMXqP/2Q==' ; |
//========================================================== |
// ll-small.jpg |
//========================================================== |
$this->chars['l'][0]= 626 ; |
$this->chars['l'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAYEBQf/xAArEAACAQIFAwIGAwAAAAAAAAAB'. |
'AgMEEQAFBhIhFEFREzEHFSIyYcFxgZH/xAAXAQEAAwAAAAAAAAAAAAAAAAACAAED/8QAGhEAAwEAAwAAAAAAAAAAAAAAAAECMREh'. |
'Qf/aAAwDAQACEQMRAD8A15Zfm1VURj1Fp5AqLKv3OARcL4W5Nzx+MLWjdRz5hqXU6TSb6OCr6WghiQbrJ91gOTy1yT5xZ55myZFk'. |
'Gb5ozX6Ondm28XYqpQDwu7jEH4c5S2UaDy4xxrLmlUDWzk8XaQ3O49hbj+RiB85HNg8Ee3aqwIqhDuux7G/HHbvzgxEqaWOvy09R'. |
'O0o3hjdQoUji20g+fY3wYSM6pJ4Ylr7V+Zz5PSaezHTlTRNWzxySSxt6q1MSkH6AOT2Fu3Aw7RfF/T9DEkLUeawuF2mKSgdWQj2/'. |
'q3+fnDZDlqRZzQGaOGcpTOaeR1u8R+ncN3gj94so2jNWHeMNNKzorEX2qp9v3imNPoRE1zpjUtZ09HJmYq5lury0benZeTww23t3'. |
'Ivgw+T0yRRyyxIqNfkLcA8jt7YMKcBWn/9k=' ; |
//========================================================== |
// ls-small.jpg |
//========================================================== |
$this->chars['s'][0]= 701 ; |
$this->chars['s'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGgAAAgMBAQAAAAAAAAAAAAAAAAMCBAUGB//EACwQAAEEAQIFAgUFAAAAAAAA'. |
'AAECAwQFEQAGEhMUITEiYQcjQVFxFRZCUoH/xAAWAQEBAQAAAAAAAAAAAAAAAAADAgH/xAAZEQADAQEBAAAAAAAAAAAAAAAAAQIR'. |
'EiH/2gAMAwEAAhEDEQA/APWZMhmFXSJU+SGmWFiQtAWMJQAnJUr8Z+w/OuQk71uZnMsqnbjy9s8st9UMCQ6kZJdZaIHEkZ/JHceN'. |
'N3HtizuY1JLrG48yLBSC9UTFKQiY4nACir+wAOOMEe2rm2bTbzlqtE1MyBuZAPybpw85KSfDRJ4Cg+Pl/wC61hJeGjV31VuuKqwr'. |
'LGU+whZZK+Rw+oYJAyj3GjS4dZFpZVkqPLktdfMXNcaU2kBC1BIITkdx6c599GlnvPAa3TL2vNvU76n0063acr3YSLCEjpUpUQtW'. |
'Dhf14SMEnOc57aZ8Tegm7dbrEQGZt1PeTDgc1PEW3FeXAvyAkZVkeMDOm2G3f3O7Cl/qEuqkQg4lp6CRxraWfUlRUD24kZA741Ko'. |
'2k1HvlT3ri2sLOCgtsyJz6XEtBwZPAgJAGQMHUNPWKqWItsqh0UCFVyLeKhyLHQ2TMdHNVj+RKlAnJyfto1FW2ahgjrq6LYTFjjf'. |
'lymUOLdWfJyoHA+gA7AAAaNPE3ysJdLT/9k=' ; |
//========================================================== |
// lh-small.jpg |
//========================================================== |
$this->chars['h'][0]= 677 ; |
$this->chars['h'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABUDASIAAhEBAxEB/8QAGgAAAQUBAAAAAAAAAAAAAAAAAAIDBAUGB//EACwQAAIBAwMCBQIHAAAAAAAA'. |
'AAECAwQFEQAGEiExExQiQVEVggcyU2GRocH/xAAXAQADAQAAAAAAAAAAAAAAAAAAAwQB/8QAGhEBAQEAAwEAAAAAAAAAAAAAAQAC'. |
'AyEyMf/aAAwDAQACEQMRAD8A6DZb95q9bmpK6ieOCzNHJTxmE+NMhQ5fr1fLq3Ejvkak2e7ipiFsqb3R0m4qkPPJRiRXenU9VjKE'. |
'5JVcA9R7nWc3/BUbfoKTdO3VRXhpjbZ2D8Rwk6RyZH6chB+46m7i2hDYtgA2ePlV2VkuKysoLzzRnlIScZJZeeevvjtrX7LK2rp7'. |
'tTwwJ9WjhILDrTKnIdMEDl2+P80aVdJZb1QW+vgqENLPH4sBCDLIwUgnOf4GjVvDnLgUk79T81voqjb8NnuUx8pVRCiEaYUSuynl'. |
'jHU9mOfnOoOx6hqz8PrbNdfEkMUXg1LSM3rKOUywJ7YAJ1ZTWmSpvdvlaVTDSUzJAhH5ZJBgv0x2RSAPlz21WXqoet3ba9nuW8n4'. |
'Jr6qTPqnUNxSM/f6mPvxA9zqJnExTbR+h0nkhVu1uE8j0UBRQ9PGxBKFjnkAScdsDp10a0lc7z0tI7Y5YYN+5GAf7GjVXF4Icj3f'. |
'/9k=' ; |
//========================================================== |
// ld-small.jpg |
//========================================================== |
$this->chars['d'][0]= 681 ; |
$this->chars['d'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAQFBgH/xAAsEAABAwMEAAQFBQAAAAAAAAAB'. |
'AgMEBQYRABIhMQcTI0EUMlFhkRgicaGx/8QAFgEBAQEAAAAAAAAAAAAAAAAAAgEA/8QAGBEBAQEBAQAAAAAAAAAAAAAAAAECETH/'. |
'2gAMAwEAAhEDEQA/ALUhp6h3W/X63UlypbhCY0WMjLqGzwDtPCfv/WtealNpVInuVBBqCogcdbU36YUkAkJWVHG8YPXBxxzxqPcN'. |
'YtWyWnIlUeW05VEOAvrCnnSkftK1H5lKJPHsMDoDUWq+KdrSbIqsalVsImiEtLUZ2MU71bcYJWkhZ/36ayLHhi/IXZVOmzKqp5uU'. |
'688hTyjuGVEFJKvoQesD86NL2jGZp1EoLDSmk+ZAQ8d7oPzp3YGesFWMfxo1YGvSzLsT9QExVX8phTlMaFOExAJIBGQjJwCcL+/e'. |
'rd+W7GuO0Kw05CQ6+ww69Gfdb2kFIKk7DgEkjgnr86rXRa9HuyP8LV4SH0sIBbWFFDiFEgDaocgdkjo8ccay0qw7ut5nyrcviQqC'. |
'slsRKo0HwlODkBRzxj2AGoXTtpzIdQ8MbffUChz4NCPRaClAo9Mn6c7T3o13wytmo0K05VIqkiPJbizFiMWs4CTgnIIHOST796NL'. |
'Ia1JX//Z' ; |
//========================================================== |
// d8-small.jpg |
//========================================================== |
$this->chars['8'][0]= 694 ; |
$this->chars['8'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. |
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AFQMBIgACEQEDEQH/xAAYAAADAQEAAAAAAAAAAAAAAAAABgcEBf/EACsQAAEDAwMD'. |
'AwMFAAAAAAAAAAECAwQFBhEAEiEUMVEHE0EVYYEiIzJCsf/EABYBAQEBAAAAAAAAAAAAAAAAAAIAAf/EABcRAQEBAQAAAAAAAAAA'. |
'AAAAAAABERL/2gAMAwEAAhEDEQA/AKL6gVVUa0i1T5QjvTprUJMlxW4R9zgQXe/AH+kaWrntqlWjaq7gpcmotXAw82ht9yY4tch8'. |
'uAFC0k7VBXPGMY51ruiaue+bThIj+7NbWqS+7HDxajFf6AlB/k44o8ZOABk4xkL0X0tZiojKrlRuGRJjugqldSlKGf6t7BuUQe3J'. |
'44xxxrA1a4KVJipLidri8uLHgqOcfjOPxo0o2hdDvS1CmV2Yl6fS5ioipIQR1CAlKkLKR2UUqAI8g6NRSwuuyHab6s1ufLI/Zai7'. |
'UBJOxhTS0+6B32pWSFH4CidOdWU0ukLiN1BLr0zG5Sdm3GRvcPhIT858DvjXNrVsSLnm/VIdTXS6tTnFsxZTSN3jchaTwps+O/z9'. |
'tcBVq3hIX0tYqlIiQHdy5CqRHKHXEjAOMgBKjnvyRk4xrQa7OiGt1K5biYZL8SoVEpjOqkFsONtJCNwASeCQrn7aNUKnQYtLp7EC'. |
'EylmLHQltptPZKQOBo1FzH//2Q==' ; |
//========================================================== |
// lz-small.jpg |
//========================================================== |
$this->chars['z'][0]= 690 ; |
$this->chars['z'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABYDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAABgAHA//EACsQAAEDAwQBAwIHAAAAAAAAAAEC'. |
'AwQFESEABhIxBxMiQVFxCCM0UmGRof/EABYBAQEBAAAAAAAAAAAAAAAAAAECAP/EABgRAAMBAQAAAAAAAAAAAAAAAAABEVEC/9oA'. |
'DAMBAAIRAxEAPwBTWfLu1KXXZDbM4uewNvLajlwhaCbBAwDe5uehYd3xm6t6bi3jvulwqc7KgxXZZeYQLNLeF73WRg4HEdgfzrSa'. |
'P45pNEkznITDc9ypLShtyWhJDJyXC2qxJHZvjoZOjyVv1v8AESt6FFS4ijxvTLbawEApSccrYHJf0+OtJMQ2rNXk7GZMufJgJjTH'. |
'Un9M4qzxT7hyCiThIyRnPXWrRvyLElVBUF6vlhl0lwRYCFKcQhAtyWpVhyWTx+w++rUvp4EWjOvbniUOnVatcS43BYDbJSPZyIBw'. |
'ejclIx+3Wa+J63T6DQanuGszI0eZVJJV60p0Jum5GEi6le7l0PjvSjyRsaTvJqI1BqhhR46ksuMrQVJcUSEoUbHNr/7o7C8L7eiz'. |
'4lLlyJk2cEqW+6V+m0AE9ISLnsj5+O9UhsFK92bZZqb9SRu9p2c4A0OCEqDbYAJSlJwAVZv3fBvbFrg/462btlhuS1RG5nL8pYkq'. |
'KrnsKH06I/rVrQKkf//Z' ; |
//========================================================== |
// d4-small.jpg |
//========================================================== |
$this->chars['4'][0]= 643 ; |
$this->chars['4'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. |
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAYAAADAQEAAAAAAAAAAAAAAAAABAYHAv/EAC0QAAIBAwQA'. |
'BAMJAAAAAAAAAAECAwQFEQAGEiETFDFBUmGBByIjUVNxobHR/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAIB/8QAGBEBAAMBAAAAAAAA'. |
'AAAAAAAAAAERIVH/2gAMAwEAAhEDEQA/ANjM00Nxmt1xiWW31CZp5uJwoAAaOQ/n7qfcZHqO5my3q5XX7R6ijiqnNut9u4NyJ4yv'. |
'JJyjYr8Xhrn5g599J7x3ulBNU7Zo7dXXXcLQ8kURYi4epYtkALjOePv1nUvbLvV7P3BZm3DR3eh88Kp7pVzBZI6iUhGWRRGWwE44'. |
'HX3V+uiL1uHgt+vL/H+aNJQ3CSeCOaFqSaJ1DJKs/TqRkMOvQjvRorHE4pRDLNWLGlRHGUeYIORXs9e5B7OP31E0fmdyb/t0DJ4Q'. |
'27bfx3YZzPUIoAAz7IpOD6cuxq0uNumqLfVNDOqXBoZEjnZcqhIPXH4c46+WkdoWOltu3IDDLLLVVR83UVcuPEmmcZZ2/rHoAANG'. |
'GI7KIY1ijoLeEQBVCwIoAHpgY6Hy0aZe7mJ2jeHLKcEhusj6aNKgzr//2Q==' ; |
//========================================================== |
// lv-small.jpg |
//========================================================== |
$this->chars['v'][0]= 648 ; |
$this->chars['v'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAQDBQYH/8QAKBAAAQQBAwMEAgMAAAAAAAAA'. |
'AQIDBBEFAAYhEzFBEhQiYQdRFTKB/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAFxEBAQEBAAAAAAAAAAAAAAAAAAERIf/aAAwD'. |
'AQACEQMRAD8A6Ngt1SZ4yrYgrecgTFsFJA9aGwAUrUaF2D2Avjzq6CIjiBPkB9bwQVIkIYIDae/wq+P9N+dY4SGMf+Txlev7KBmY'. |
'PoadKRy4zxSgRxaTwO/x09u7KPYnasmHjlsyFZZXt4K23ezjvBpNGgLUrvXfVZyLLbWambiwEbKvvxYAkeotNlIJW2FEJWb7WBda'. |
'NSQI0fHYyJjkrjKRDZQwnpQ1vgBIr+w8+a+9GocZr8iKkuY1eXhsKH8U8iZE9BHz6ZHUc48UfSPqzqH3kfeO9kTTDQYGGietpTaO'. |
'shyW6AocpHNIrv8AvWzk9BUSdPdYS4BcRlomkhIV6KP0VE39V+tU2wdlRMHtZUB8NuTQ+51X27+Kr46ZPIAFV540D8zeLsJ5LMHa'. |
'ubmMBCVJdjx0pRyLoWR4I8aNIQ8BvZMNtMTeUcsptKfc4tC1gAkCyFC+K0aJtf/Z' ; |
//========================================================== |
// lk-small.jpg |
//========================================================== |
$this->chars['k'][0]= 680 ; |
$this->chars['k'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABUDASIAAhEBAxEB/8QAGQAAAwEBAQAAAAAAAAAAAAAAAAUGBAMH/8QALhAAAQMDAwIEBAcAAAAAAAAA'. |
'AQIDBAUREgAGITFBEyIyYQcVUYEUIzNicZHx/8QAFgEBAQEAAAAAAAAAAAAAAAAAAwEE/8QAGxEAAwACAwAAAAAAAAAAAAAAAAEC'. |
'AxESMeH/2gAMAwEAAhEDEQA/APVK/V36dU6NSJDTT8esPLiqfK8S2cCoeTkKvZQ6jm2ldSqKqbu+OgMOvSX3m4UBrLnDlbqiefKl'. |
'Nzz2x1m+IwNP27CkJQ7JkR6rCkMJbP5jp8S2CPfkgD6H+dJ6Ca0nerr+64rTNSqMYrg+C9mmOwhVpDfsuxSbi97DmybaoZeQ5jTl'. |
'PEp18JTIfeW3kq3ly4H26aNZqvTWZsjFcZTsVtSg0G8Rio+vr2vb7g6NLPRnuXy8F+8kl+obUh4KXJdqSJJQnohlkZqJPYBXh3P+'. |
'a4b5Hyp6k1bO7sOotPyXkj9NlwFl0ewstJA9ifrqkVSmET4csoS7UTHXFQ+6SQlskKUMb/tH9ddLVUmS7DqdBqD7U6OsqfS46jzl'. |
'hQ5bXb1K9Scuybdxo2OTu92dwSZkWn0Sb8viQWyn8Qq5D6ifSLd0BIv7q0arTBRSKPToMZbi2GWylsvLK148Wue/XRrRjxOpT2R2'. |
'k9aP/9k=' ; |
//========================================================== |
// lr-small.jpg |
//========================================================== |
$this->chars['r'][0]= 681 ; |
$this->chars['r'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABYDASIAAhEBAxEB/8QAGgAAAgIDAAAAAAAAAAAAAAAAAAYCBQMEB//EAC4QAAICAQIFAgMJAQAAAAAA'. |
'AAECAwQRBQYAEiExQQdRFGFxEyIyM0JSYoGC8P/EABYBAQEBAAAAAAAAAAAAAAAAAAEAAv/EABcRAQEBAQAAAAAAAAAAAAAAAAAB'. |
'EUH/2gAMAwEAAhEDEQA/AOs0ZdETU54Gt1INSmlPJEsyo7J+jlXPUYBPY9c+eE/dO9tY0a7ren6BVrW7VJTZtW5kZkjXkBSIKveQ'. |
'gHp0AAJ4w+q2hVdT2Md0h46+saS4mr3EUK0gWTAB+vQj2PboeL/ZVOqmhaZVjkFmxdC6tctt3tM2G5/7bAx4C4+qxiWwd3prWzKe'. |
'r3IBAth5OYxozKsgc8y4GTgnJB9uncdTi6tXq2140rRVM13JMEMAVAg7sMdBjJB/18uDgRO9R2Oo6FX2vShkFzURFUq1whIj+8DI'. |
'7EdAFjXv7MeNb0kuStsFEmIaajZaos2fy2Q4VGH7SGxn+Rzw9yMLOm/FzRhZazmOTkP4grYyD3B8j2PTyeFfZ+z7G3BeSS8lmprl'. |
'2K2qcnK0Z5S8gPjrgAY8cNEWmq7u23pEos6/Zji+Kd0rLLGWwseA3joeZj/w4OET1g0vlmrWV+ydFnkUxSgsvM4V+YYIwfHz6cHB'. |
'ZeKZ1//Z' ; |
//========================================================== |
// lg-small.jpg |
//========================================================== |
$this->chars['g'][0]= 655 ; |
$this->chars['g'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAQCBQYH/8QAJxAAAQQBAwQCAgMAAAAAAAAA'. |
'AQIDBBEFAAYhBxIxQRNhcYEiQlH/xAAYAQACAwAAAAAAAAAAAAAAAAACAwABBP/EABkRAAMBAQEAAAAAAAAAAAAAAAABAhEhIv/a'. |
'AAwDAQACEQMRAD8AayO4t6bq3hmMHtxyLi4OKeKH5jyASiiQCCQeTRNAeB61FrBb+jTGpLO+BMW24EFMhkhpQru8m7B/H70x09Yi'. |
'q3nv/vLfwpnJ7UNkqSRbngf2ofWkpXV7brymC2malLfagurjW0aHk89xPJ9cX9aprURHWbYEaMHHEBfwpv8AnXPk+/8AdGqGJOxO'. |
'4YbOSxK4y4boIStUWysgkEmxY54r60aOI8oTV9MHtjJwunPUbO46WWo0HLlD8KY4goboFVoquOVEVwLT963WdnxYfT6ZJyz0JvHm'. |
'KvtaSkW4tYNVSqKiTwB+fw5n9sY/cuOXCzDDcluyW3Ckd7V+0n0eNZTH9DdouFalHIOJBUhtDki0pNV3UALo81ehG6IdKjPZ6d47'. |
'4ywltanVJvuJI+RQs/sHRqy2r003JhsImEc/CUyhxRZBjKV2oJ8eRXNmufPnRo1WIz3DdNn/2Q==' ; |
//========================================================== |
// lc-small.jpg |
//========================================================== |
$this->chars['c'][0]= 629 ; |
$this->chars['c'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGQAAAwEBAQAAAAAAAAAAAAAAAAUGBwID/8QALRAAAgICAQIEBAYDAAAAAAAA'. |
'AQIDBAURACExBhIiQRMVUWEHMkJScYFykaH/xAAWAQEBAQAAAAAAAAAAAAAAAAABAgP/xAAXEQEBAQEAAAAAAAAAAAAAAAAAATER'. |
'/9oADAMBAAIRAxEAPwDcoGkmiT4Q8kWvzuPU38D2/v8A1zwrCFayq1qTaFk2H7aJHt05MeMvENzC4upDWkjW9kJXiricAJCigvJN'. |
'IB1IVQT5frrv24twPgunk6a288crbklUSJNNdnSTZ2STHHqOP/Eb17njdZtAoqwEvrEiGVyG117/AG6HhyV8H1sljMldoxXTksGC'. |
'zV7M0oaWGQOVeGQ92I6EMR22D11w4LmEPjaOL51iL8ssc9Z69zHtZkYCGGeQK0ez2UEoU39wCeX1S/LLiEt+mPSbMLxsGVv2kEjR'. |
'305xkaEV/GTULMUT1LD/AAGh8gIZS2jv+vpybb8NMIb0dVLWYWgiiU0vmMphOj6V0TvQI3rfsON1E6dYjGtisa0F1mAWR2NhG0WZ'. |
'3Ls3TqNs5Hc9h23w49NWL9K+Q/VD5T/zhwPH/9k=' ; |
//========================================================== |
// d7-small.jpg |
//========================================================== |
$this->chars['7'][0]= 658 ; |
$this->chars['7'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. |
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABgEFBwT/xAAuEAABAwIE'. |
'BAQGAwAAAAAAAAABAgMEBREABiExEhMiQSMyUXEHFBclVJFhk9L/xAAXAQADAQAAAAAAAAAAAAAAAAAAAQID/8QAGREBAQEAAwAA'. |
'AAAAAAAAAAAAAAEREiFR/9oADAMBAAIRAxEAPwDXq9mCjZeQ05VZ5ZST4bfEpa3VdglCbqUe+g9MZ5Uq7V8415WXoMSdQ6etgSps'. |
'19wpkCMDZKUpv0FZvbi1NzpYasMDLDUbMVXrtQdbeeU23xLWkj5RlLYK0J7anW9gbAjCzkOtsVSUJUdtc6dVZK51UeaFm4LKbhpC'. |
'l7EhIFkDW974GbRI2XorUVls1OTdKAOqUpR0Hc3198GITQ6k+hLwrEpoODiDenRfW23bBicg78JXxPpD0mgVOW5PAivNNpahsPW5'. |
'8xxQaSVkboQnhsnYm5OHqDGp1IpsalMKjMsMIC3+XZKbJFth62/QOEfMOZqZXp9JcKZTcGmTky3meSi7xQklI81vMR+sXIz/AEgp'. |
'Q0qPNu6ea8Q2jqtbp8+2w9h/OKORc/cpHjt1dDSHOtLZ4ekHW23bBjj+o9H/AB539aP94MG0+L//2Q==' ; |
//========================================================== |
// ly-small.jpg |
//========================================================== |
$this->chars['y'][0]= 672 ; |
$this->chars['y'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAQGBQf/xAArEAABAwMEAQIFBQAAAAAAAAAB'. |
'AgMEBREhAAYSEzEHIhQkQVGxQmFxgaH/xAAWAQEBAQAAAAAAAAAAAAAAAAADAQL/xAAeEQEAAgEEAwAAAAAAAAAAAAABABECAxIh'. |
'MUGR8P/aAAwDAQACEQMRAD8Ar3tys07dVHohemz5dWQ7fk91MsA3IIRY8rkKFySceTqw3JVV0KhyKw+0C1CQp9aUOFSiAk4AIAvn'. |
'76xtz0ioVvbcJ6msx2JtOfZmw1PKI5LQcJNh7UqBKcn6+NRfqPu6s1fYc6GxSJsRfWDUVSGA22ygEckJWSexRNgOP0udXzDKOJ0I'. |
'yo62mHm25Sy80l1Z4lSgpQvZRGLgWwPGjTjbchyLH+Ejx22EtJSgO8kki3kADA/nOjWjGzv73CyQZjUWNVp7bNSrj7qJDqflqUlQ'. |
'DMds24l3HvcNr3Pi9gME6T9WWVsemdYWswwC2lPta4m5WMA3OdUExCmozUJD6g84ntMjrHIFBTdQz5yLDx/WDNytpwW6nAkViqVe'. |
'uvmXdlme6n4dCwlRBKEgA2tj99QG7Ilncp5QqpU31PMsJ6x7A32f6SPxo0hPVCD45oVyKf0MtgeT97/nRrO7UOCFla3tn//Z' ; |
//========================================================== |
// d3-small.jpg |
//========================================================== |
$this->chars['3'][0]= 662 ; |
$this->chars['3'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'. |
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABAUGBwL/xAArEAABBAED'. |
'AwMDBQEAAAAAAAABAgMEBREABhIhMUEiMmETFZEHFkJDUdH/xAAWAQEBAQAAAAAAAAAAAAAAAAABAAL/xAAYEQEBAQEBAAAAAAAA'. |
'AAAAAAAAEQExQf/aAAwDAQACEQMRAD8A0vclruBdk3VVLLUNssGRJsZSCtqOjlgJAHvcOD6c4HnOdIbcttw1W5P29cFEhuawqTXS'. |
'VsJjnCMBxKkJJx7goAde+ceJfdNxU0UNlyymyXHi6kxWUNl1S3EnkAEIHX2nv86qtTuZr9Q9+1VhRsOoYpYcgSVyAE/TdewkJxnK'. |
'sBCjkdPGpnOtFMd3PqsXgfOAgD8Y0aX+11H9rDDjn8lr9yj5J+dGqsqxaw6Cc9cQZU4Sp7zTJsIrKlcUEKwhSin1JABI45GUjqOu'. |
'lbOvjbc3Ts9ynjGCy445UuFLYRzbWgrT6fhSCQSMDke+pew2zYVly/d7YchNqkMJZnQpgV9J8IzwWFJyUrAJHYgjvpLbu37G5nR7'. |
'vck5C3YRKYEOEVJZj8kjKypXqWvirjk9h+dB9i4faa89TDZUfKlIyT8k+To10a6KTkpcJ/0vL/7o0TS//9k=' ; |
//========================================================== |
// ln-small.jpg |
//========================================================== |
$this->chars['n'][0]= 643 ; |
$this->chars['n'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGwAAAgEFAAAAAAAAAAAAAAAAAAYCAQMEBQf/xAAtEAACAQMCBAUCBwAAAAAA'. |
'AAABAgMEBREAIQYSE0EHIjFRcWGRIzIzQoGCwf/EABYBAQEBAAAAAAAAAAAAAAAAAAMEAP/EABkRAQEBAQEBAAAAAAAAAAAAAAEA'. |
'AhEhUf/aAAwDAQACEQMRAD8A6FR3p7v4oV9rlkMQsjL00RyOss0KkFxnDcrc2PbI1NOJKyTjW+W5OmKeA0UEJx5meRZS2/8AUfbS'. |
'LVGS1+K16vCzfiR3GmoqqXGyxz06hWPsFlVMfOmq1iNvE69KjBYo3oJMZ3GKeYYPxg/fW+xzZX1FLQyxwSTcpWNceu4G3+aNSmpY'. |
'qmQzzwh2k8yhv2r2H23/AJ0aoy+EWh7I1ntacR3PxDtEzhjWy0wkkIwYmanU5GO6sNh7rrU8AVdTceNbhDXxNHUQvS0tZ3DzwxVA'. |
'fB7hj59/XJ08cPWaKj4gvlwSQiG7dCboqvLy9NOmQT9SM7ayJrBa6K5V91hjlWorp4JGUOAglRSiMMDb82/vgaBGTpVvtNUVtyJg'. |
'5+WNAh5ZCu/r2+dGrgq0pi0DhmlRsSSAfqMd+b6ZyNu3po1Rk1yNBe3/2Q==' ; |
//========================================================== |
// lu-small.jpg |
//========================================================== |
$this->chars['u'][0]= 671 ; |
$this->chars['u'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAYDBAUH/8QAJRAAAQQBAwQDAQEAAAAAAAAA'. |
'AQIDBBEFAAYhBxMxYRJBURSB/8QAFgEBAQEAAAAAAAAAAAAAAAAAAQAD/8QAGhEBAQEAAwEAAAAAAAAAAAAAAQARITFBAv/aAAwD'. |
'AQACEQMRAD8A6dLkQmJzu3WVtHIqjf0duKFNuBr5UTQ45F1R8/XI1PMmsYoJyjhS9iI7BKHeKjkXZVXqhyLHP+rrHeR1pZlx1W1M'. |
'wTiW0ukkrS28nn5fV2SPPFfurHUKQhzYG7pLYKEfyBhaSOS7dG/YCki/uvWn3LPDOJrwa4kyEzOYeakqkpC3Hk0bNePQHgDRpchY'. |
'leIZwzUWauKtuPctTSUlCAUmrBHIKuAPV/ujQsmHdm7hya43UbbD3ZVElOQJsdTS6IQaQUqBHCk8E2Pocgam6oYwObHy0Zm0oi45'. |
'T1KBPdpV2f0pom/1Ws7cmPazu98Ltvcq3VzRHfehz8a4pirFEKRZo8eQT+eCdWYfS/b+WYnxpbuVcDRMdHcyTqg2fiAfiLoi+Rf+'. |
'jT7Xc74HtOYnHyUOh8yWUvKeHhy0CiPVUAPoDRrm+OeznTva6lzsyMjCYbbaiNJjJSWElagD5tRpNUSALFeNGoOCH7Bv/9k=' ; |
//========================================================== |
// lw-small.jpg |
//========================================================== |
$this->chars['w'][0]= 673 ; |
$this->chars['w'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAYDBAX/xAAtEAACAQMDAgMHBQAAAAAAAAAB'. |
'AgMEBREABhIhMRMUQRUiIzJRYZEWNIGx0f/EABYBAQEBAAAAAAAAAAAAAAAAAAABA//EABoRAAICAwAAAAAAAAAAAAAAAAABERIh'. |
'MVH/2gAMAwEAAhEDEQA/AHXbV13ZLu6t2/uaa1JijWopVp4XUTKSAXRyc+6ehBGeoPbTSlwpql0K3GneqpZViqUhI5JzGMEZJGeh'. |
'GlXfaFILDf7FQzXC426rDLTojs8sLqVkXBGcfKf40twWbdWzZY75R0s90ul3jPtKjVMJDNn4DDp8iEhW+wJ1WZG2KWt3Lv26U1tv'. |
'92o7PaYkgYUbqVepYlmUBlIwqnB++O2jTDt/bBtth9jcpvEWNGqalZQryTlmeR8jPct6+mNGmRC4a1U13htzVFItB5nA/cyOUVfp'. |
'7oz/ALqitJulYJKuqvFsppHALLFb3cp9FBaXr+O51bq0q6i38KK5PDVAAxSzU6SIpz3Kjjn8jUFoS7uFmut1gq17xLFQ+DxOccj8'. |
'Rsn+tVpiyJnqv09YfOXu5AycgZZQEhBZjgDBOOgwO/po0sttWHdNzqLruioa4UwmdaC3kYp4IwSvJlBHKQ4OSe3po0qxM6P/2Q==' ; |
//========================================================== |
// lq-small.jpg |
//========================================================== |
$this->chars['q'][0]= 671 ; |
$this->chars['q'][1]= |
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'. |
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'. |
'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAcDBAUG/8QAKRAAAQQBBAICAQQDAAAAAAAA'. |
'AQIDBBEFAAYSIQcxIlETCBQVgSNBYf/EABUBAQEAAAAAAAAAAAAAAAAAAAAB/8QAFhEBAQEAAAAAAAAAAAAAAAAAAAER/9oADAMB'. |
'AAIRAxEAPwDT3H5Qz+O3LN2vtrF/y86NYLzzVlAABJITQPv2a/17vXMboz3lDEYWPuafNx7CFrS03+2jpK2bs0CUkUa7pRvrUu63'. |
'sr438yv7pLEo4XIK5Kcji0uJUkckm+uQUOVH6GsnyJv7A5vaJwuFdkONLmolgONFH4vioKRXYqyCADXvRMh0yspmZ4jyIEtDTK47'. |
'aiA0lQUopBJBI/7X9aNT7amRo228e3a31iO3yUzCcdSPiKAIFdCho0TIswZ7GQlO/hlRxBooih1YXzAoKUkX0LPEBX110dJ7zbuv'. |
'AORpO04cIpmxH23FSEIRwKuNnsdk0o31702XhFMKbuRUZJWP8LTQ6HBCuIB+iVWSR2BXuqK93/hDlvGzEphmG3Ml5JpDi1I7TzNA'. |
'BYFlPafY+/7LBiv1CYDH4iFDOGySlMR22lFP4wCUpANfL11o1r4bxXlWMNEaE/bqlIbCFl/ANPK5Do/M0VDr2Rf3o0TX/9k=' ; |
} |
} |
class AntiSpam { |
private $iData=''; |
private $iDD=null; |
function __construct($aData='') { |
$this->iData = $aData; |
$this->iDD = new HandDigits(); |
} |
function Set($aData) { |
$this->iData = $aData; |
} |
function Rand($aLen) { |
$d=''; |
for($i=0; $i < $aLen; ++$i) { |
if( rand(0,9) < 6 ) { |
// Digits |
$d .= chr( ord('1') + rand(0,8) ); |
} |
else { |
// Letters |
do { |
$offset = rand(0,25); |
} while ( $offset==14 ); |
$d .= chr( ord('a') + $offset ); |
} |
} |
$this->iData = $d; |
return $d; |
} |
function Stroke() { |
$n=strlen($this->iData); |
if( $n==0 ) { |
return false; |
} |
for($i=0; $i < $n; ++$i ) { |
if( $this->iData[$i]==='0' || strtolower($this->iData[$i])==='o') { |
return false; |
} |
} |
$img = @imagecreatetruecolor($n*$this->iDD->iWidth, $this->iDD->iHeight); |
if( $img < 1 ) { |
return false; |
} |
$start=0; |
for($i=0; $i < $n; ++$i ) { |
$dimg = imagecreatefromstring(base64_decode($this->iDD->chars[strtolower($this->iData[$i])][1])); |
imagecopy($img,$dimg,$start,0,0,0,imagesx($dimg), $this->iDD->iHeight); |
$start += imagesx($dimg); |
} |
$resimg = @imagecreatetruecolor($start+4, $this->iDD->iHeight+4); |
if( $resimg < 1 ) { |
return false; |
} |
imagecopy($resimg,$img,2,2,0,0,$start, $this->iDD->iHeight); |
header("Content-type: image/jpeg"); |
imagejpeg($resimg); |
return true; |
} |
} |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/jpgraph_pie.php |
---|
New file |
0,0 → 1,1462 |
<?php |
/*======================================================================= |
// File: JPGRAPH_PIE.PHP |
// Description: Pie plot extension for JpGraph |
// Created: 2001-02-14 |
// Ver: $Id: jpgraph_pie.php 1926 2010-01-11 16:33:07Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
*/ |
// Defines for PiePlot::SetLabelType() |
define("PIE_VALUE_ABS",1); |
define("PIE_VALUE_PER",0); |
define("PIE_VALUE_PERCENTAGE",0); |
define("PIE_VALUE_ADJPERCENTAGE",2); |
define("PIE_VALUE_ADJPER",2); |
//=================================================== |
// CLASS PiePlot |
// Description: Draws a pie plot |
//=================================================== |
class PiePlot { |
public $posx=0.5,$posy=0.5; |
protected $radius=0.3; |
protected $explode_radius=array(),$explode_all=false,$explode_r=20; |
protected $labels=null, $legends=null; |
protected $csimtargets=null,$csimwintargets=null; // Array of targets for CSIM |
protected $csimareas=''; // Generated CSIM text |
protected $csimalts=null; // ALT tags for corresponding target |
protected $data=null; |
public $title; |
protected $startangle=0; |
protected $weight=1, $color="black"; |
protected $legend_margin=6,$show_labels=true; |
protected $themearr = array( |
"earth" => array(136,34,40,45,46,62,63,134,74,10,120,136,141,168,180,77,209,218,346,395,89,430), |
"pastel" => array(27,415,128,59,66,79,105,110,42,147,152,230,236,240,331,337,405,38), |
"water" => array(8,370,24,40,335,56,213,237,268,14,326,387,10,388), |
"sand" => array(27,168,34,170,19,50,65,72,131,209,46,393)); |
protected $theme="earth"; |
protected $setslicecolors=array(); |
protected $labeltype=0; // Default to percentage |
protected $pie_border=true,$pie_interior_border=true; |
public $value; |
protected $ishadowcolor='',$ishadowdrop=4; |
protected $ilabelposadj=1; |
protected $legendcsimtargets = array(),$legendcsimwintargets = array(); |
protected $legendcsimalts = array(); |
protected $adjusted_data = array(); |
public $guideline = null; |
protected $guidelinemargin=10,$iShowGuideLineForSingle = false; |
protected $iGuideLineCurve = false,$iGuideVFactor=1.4,$iGuideLineRFactor=0.8; |
protected $la = array(); // Holds the exact angle for each label |
//--------------- |
// CONSTRUCTOR |
function __construct($data) { |
$this->data = array_reverse($data); |
$this->title = new Text(""); |
$this->title->SetFont(FF_FONT1,FS_BOLD); |
$this->value = new DisplayValue(); |
$this->value->Show(); |
$this->value->SetFormat('%.1f%%'); |
$this->guideline = new LineProperty(); |
} |
//--------------- |
// PUBLIC METHODS |
function SetCenter($x,$y=0.5) { |
$this->posx = $x; |
$this->posy = $y; |
} |
// Enable guideline and set drwaing policy |
function SetGuideLines($aFlg=true,$aCurved=true,$aAlways=false) { |
$this->guideline->Show($aFlg); |
$this->iShowGuideLineForSingle = $aAlways; |
$this->iGuideLineCurve = $aCurved; |
} |
// Adjuste the distance between labels and labels and pie |
function SetGuideLinesAdjust($aVFactor,$aRFactor=0.8) { |
$this->iGuideVFactor=$aVFactor; |
$this->iGuideLineRFactor=$aRFactor; |
} |
function SetColor($aColor) { |
$this->color = $aColor; |
} |
function SetSliceColors($aColors) { |
$this->setslicecolors = $aColors; |
} |
function SetShadow($aColor='darkgray',$aDropWidth=4) { |
$this->ishadowcolor = $aColor; |
$this->ishadowdrop = $aDropWidth; |
} |
function SetCSIMTargets($aTargets,$aAlts='',$aWinTargets='') { |
$this->csimtargets=array_reverse($aTargets); |
if( is_array($aWinTargets) ) |
$this->csimwintargets=array_reverse($aWinTargets); |
if( is_array($aAlts) ) |
$this->csimalts=array_reverse($aAlts); |
} |
function GetCSIMareas() { |
return $this->csimareas; |
} |
function AddSliceToCSIM($i,$xc,$yc,$radius,$sa,$ea) { |
//Slice number, ellipse centre (x,y), height, width, start angle, end angle |
while( $sa > 2*M_PI ) $sa = $sa - 2*M_PI; |
while( $ea > 2*M_PI ) $ea = $ea - 2*M_PI; |
$sa = 2*M_PI - $sa; |
$ea = 2*M_PI - $ea; |
// Special case when we have only one slice since then both start and end |
// angle will be == 0 |
if( abs($sa - $ea) < 0.0001 ) { |
$sa=2*M_PI; $ea=0; |
} |
//add coordinates of the centre to the map |
$xc = floor($xc);$yc=floor($yc); |
$coords = "$xc, $yc"; |
//add coordinates of the first point on the arc to the map |
$xp = floor(($radius*cos($ea))+$xc); |
$yp = floor($yc-$radius*sin($ea)); |
$coords.= ", $xp, $yp"; |
//add coordinates every 0.2 radians |
$a=$ea+0.2; |
// If we cross the 360-limit with a slice we need to handle |
// the fact that end angle is smaller than start |
if( $sa < $ea ) { |
while ($a <= 2*M_PI) { |
$xp = floor($radius*cos($a)+$xc); |
$yp = floor($yc-$radius*sin($a)); |
$coords.= ", $xp, $yp"; |
$a += 0.2; |
} |
$a -= 2*M_PI; |
} |
while ($a < $sa) { |
$xp = floor($radius*cos($a)+$xc); |
$yp = floor($yc-$radius*sin($a)); |
$coords.= ", $xp, $yp"; |
$a += 0.2; |
} |
//Add the last point on the arc |
$xp = floor($radius*cos($sa)+$xc); |
$yp = floor($yc-$radius*sin($sa)); |
$coords.= ", $xp, $yp"; |
if( !empty($this->csimtargets[$i]) ) { |
$this->csimareas .= "<area shape=\"poly\" coords=\"$coords\" href=\"".$this->csimtargets[$i]."\""; |
$tmp=""; |
if( !empty($this->csimwintargets[$i]) ) { |
$this->csimareas .= " target=\"".$this->csimwintargets[$i]."\" "; |
} |
if( !empty($this->csimalts[$i]) ) { |
$tmp=sprintf($this->csimalts[$i],$this->data[$i]); |
$this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" "; |
} |
$this->csimareas .= " />\n"; |
} |
} |
function SetTheme($aTheme) { |
if( in_array($aTheme,array_keys($this->themearr)) ) |
$this->theme = $aTheme; |
else |
JpGraphError::RaiseL(15001,$aTheme);//("PiePLot::SetTheme() Unknown theme: $aTheme"); |
} |
function ExplodeSlice($e,$radius=20) { |
if( ! is_integer($e) ) |
JpGraphError::RaiseL(15002);//('Argument to PiePlot::ExplodeSlice() must be an integer'); |
$this->explode_radius[$e]=$radius; |
} |
function ExplodeAll($radius=20) { |
$this->explode_all=true; |
$this->explode_r = $radius; |
} |
function Explode($aExplodeArr) { |
if( !is_array($aExplodeArr) ) { |
JpGraphError::RaiseL(15003); |
//("Argument to PiePlot::Explode() must be an array with integer distances."); |
} |
$this->explode_radius = $aExplodeArr; |
} |
function SetStartAngle($aStart) { |
if( $aStart < 0 || $aStart > 360 ) { |
JpGraphError::RaiseL(15004);//('Slice start angle must be between 0 and 360 degrees.'); |
} |
if( $aStart == 0 ) { |
$this->startangle = 0; |
} |
else { |
$this->startangle = 360-$aStart; |
$this->startangle *= M_PI/180; |
} |
} |
// Size in percentage |
function SetSize($aSize) { |
if( ($aSize>0 && $aSize<=0.5) || ($aSize>10 && $aSize<1000) ) |
$this->radius = $aSize; |
else |
JpGraphError::RaiseL(15006); |
//("PiePlot::SetSize() Radius for pie must either be specified as a fraction [0, 0.5] of the size of the image or as an absolute size in pixels in the range [10, 1000]"); |
} |
// Set label arrays |
function SetLegends($aLegend) { |
$this->legends = $aLegend; |
} |
// Set text labels for slices |
function SetLabels($aLabels,$aLblPosAdj="auto") { |
$this->labels = array_reverse($aLabels); |
$this->ilabelposadj=$aLblPosAdj; |
} |
function SetLabelPos($aLblPosAdj) { |
$this->ilabelposadj=$aLblPosAdj; |
} |
// Should we display actual value or percentage? |
function SetLabelType($aType) { |
if( $aType < 0 || $aType > 2 ) |
JpGraphError::RaiseL(15008,$aType); |
//("PiePlot::SetLabelType() Type for pie plots must be 0 or 1 (not $t)."); |
$this->labeltype = $aType; |
} |
// Deprecated. |
function SetValueType($aType) { |
$this->SetLabelType($aType); |
} |
// Should the circle around a pie plot be displayed |
function ShowBorder($exterior=true,$interior=true) { |
$this->pie_border = $exterior; |
$this->pie_interior_border = $interior; |
} |
// Setup the legends |
function Legend($graph) { |
$colors = array_keys($graph->img->rgb->rgb_table); |
sort($colors); |
$ta=$this->themearr[$this->theme]; |
$n = count($this->data); |
if( $this->setslicecolors==null ) { |
$numcolors=count($ta); |
if( class_exists('PiePlot3D',false) && ($this instanceof PiePlot3D) ) { |
$ta = array_reverse(array_slice($ta,0,$n)); |
} |
} |
else { |
$this->setslicecolors = array_slice($this->setslicecolors,0,$n); |
$numcolors=count($this->setslicecolors); |
if( $graph->pieaa && !($this instanceof PiePlot3D) ) { |
$this->setslicecolors = array_reverse($this->setslicecolors); |
} |
} |
$sum=0; |
for($i=0; $i < $n; ++$i) |
$sum += $this->data[$i]; |
// Bail out with error if the sum is 0 |
if( $sum==0 ) |
JpGraphError::RaiseL(15009);//("Illegal pie plot. Sum of all data is zero for Pie!"); |
// Make sure we don't plot more values than data points |
// (in case the user added more legends than data points) |
$n = min(count($this->legends),count($this->data)); |
if( $this->legends != "" ) { |
$this->legends = array_reverse(array_slice($this->legends,0,$n)); |
} |
for( $i=$n-1; $i >= 0; --$i ) { |
$l = $this->legends[$i]; |
// Replace possible format with actual values |
if( count($this->csimalts) > $i ) { |
$fmt = $this->csimalts[$i]; |
} |
else { |
$fmt = "%d"; // Deafult Alt if no other has been specified |
} |
if( $this->labeltype==0 ) { |
$l = sprintf($l,100*$this->data[$i]/$sum); |
$alt = sprintf($fmt,$this->data[$i]); |
} |
elseif( $this->labeltype == 1) { |
$l = sprintf($l,$this->data[$i]); |
$alt = sprintf($fmt,$this->data[$i]); |
} |
else { |
$l = sprintf($l,$this->adjusted_data[$i]); |
$alt = sprintf($fmt,$this->adjusted_data[$i]); |
} |
if( empty($this->csimwintargets[$i]) ) { |
$wintarg = ''; |
} |
else { |
$wintarg = $this->csimwintargets[$i]; |
} |
if( $this->setslicecolors==null ) { |
$graph->legend->Add($l,$colors[$ta[$i%$numcolors]],"",0,$this->csimtargets[$i],$alt,$wintarg); |
} |
else { |
$graph->legend->Add($l,$this->setslicecolors[$i%$numcolors],"",0,$this->csimtargets[$i],$alt,$wintarg); |
} |
} |
} |
// Adjust the rounded percetage value so that the sum of |
// of the pie slices are always 100% |
// Using the Hare/Niemeyer method |
function AdjPercentage($aData,$aPrec=0) { |
$mul=100; |
if( $aPrec > 0 && $aPrec < 3 ) { |
if( $aPrec == 1 ) |
$mul=1000; |
else |
$mul=10000; |
} |
$tmp = array(); |
$result = array(); |
$quote_sum=0; |
$n = count($aData) ; |
for( $i=0, $sum=0; $i < $n; ++$i ) |
$sum+=$aData[$i]; |
foreach($aData as $index => $value) { |
$tmp_percentage=$value/$sum*$mul; |
$result[$index]=floor($tmp_percentage); |
$tmp[$index]=$tmp_percentage-$result[$index]; |
$quote_sum+=$result[$index]; |
} |
if( $quote_sum == $mul) { |
if( $mul > 100 ) { |
$tmp = $mul / 100; |
for( $i=0; $i < $n; ++$i ) { |
$result[$i] /= $tmp ; |
} |
} |
return $result; |
} |
arsort($tmp,SORT_NUMERIC); |
reset($tmp); |
for($i=0; $i < $mul-$quote_sum; $i++) |
{ |
$result[key($tmp)]++; |
next($tmp); |
} |
if( $mul > 100 ) { |
$tmp = $mul / 100; |
for( $i=0; $i < $n; ++$i ) { |
$result[$i] /= $tmp ; |
} |
} |
return $result; |
} |
function Stroke($img,$aaoption=0) { |
// aaoption is used to handle antialias |
// aaoption == 0 a normal pie |
// aaoption == 1 just the body |
// aaoption == 2 just the values |
// Explode scaling. If anti alias we scale the image |
// twice and we also need to scale the exploding distance |
$expscale = $aaoption === 1 ? 2 : 1; |
if( $this->labeltype == 2 ) { |
// Adjust the data so that it will add up to 100% |
$this->adjusted_data = $this->AdjPercentage($this->data); |
} |
$colors = array_keys($img->rgb->rgb_table); |
sort($colors); |
$ta=$this->themearr[$this->theme]; |
$n = count($this->data); |
if( $this->setslicecolors==null ) { |
$numcolors=count($ta); |
} |
else { |
// We need to create an array of colors as long as the data |
// since we need to reverse it to get the colors in the right order |
$numcolors=count($this->setslicecolors); |
$i = 2*$numcolors; |
while( $n > $i ) { |
$this->setslicecolors = array_merge($this->setslicecolors,$this->setslicecolors); |
$i += $n; |
} |
$tt = array_slice($this->setslicecolors,0,$n % $numcolors); |
$this->setslicecolors = array_merge($this->setslicecolors,$tt); |
$this->setslicecolors = array_reverse($this->setslicecolors); |
} |
// Draw the slices |
$sum=0; |
for($i=0; $i < $n; ++$i) |
$sum += $this->data[$i]; |
// Bail out with error if the sum is 0 |
if( $sum==0 ) { |
JpGraphError::RaiseL(15009);//("Sum of all data is 0 for Pie."); |
} |
// Set up the pie-circle |
if( $this->radius <= 1 ) { |
$radius = floor($this->radius*min($img->width,$img->height)); |
} |
else { |
$radius = $aaoption === 1 ? $this->radius*2 : $this->radius; |
} |
if( $this->posx <= 1 && $this->posx > 0 ) { |
$xc = round($this->posx*$img->width); |
} |
else { |
$xc = $this->posx ; |
} |
if( $this->posy <= 1 && $this->posy > 0 ) { |
$yc = round($this->posy*$img->height); |
} |
else { |
$yc = $this->posy ; |
} |
$n = count($this->data); |
if( $this->explode_all ) { |
for($i=0; $i < $n; ++$i) { |
$this->explode_radius[$i]=$this->explode_r; |
} |
} |
// If we have a shadow and not just drawing the labels |
if( $this->ishadowcolor != "" && $aaoption !== 2) { |
$accsum=0; |
$angle2 = $this->startangle; |
$img->SetColor($this->ishadowcolor); |
for($i=0; $sum > 0 && $i < $n; ++$i) { |
$j = $n-$i-1; |
$d = $this->data[$i]; |
$angle1 = $angle2; |
$accsum += $d; |
$angle2 = $this->startangle+2*M_PI*$accsum/$sum; |
if( empty($this->explode_radius[$j]) ) { |
$this->explode_radius[$j]=0; |
} |
if( $d < 0.00001 ) continue; |
$la = 2*M_PI - (abs($angle2-$angle1)/2.0+$angle1); |
$xcm = $xc + $this->explode_radius[$j]*cos($la)*$expscale; |
$ycm = $yc - $this->explode_radius[$j]*sin($la)*$expscale; |
$xcm += $this->ishadowdrop*$expscale; |
$ycm += $this->ishadowdrop*$expscale; |
$_sa = round($angle1*180/M_PI); |
$_ea = round($angle2*180/M_PI); |
// The CakeSlice method draws a full circle in case of start angle = end angle |
// for pie slices we don't want this behaviour unless we only have one |
// slice in the pie in case it is the wanted behaviour |
if( $_ea-$_sa > 0.1 || $n==1 ) { |
$img->CakeSlice($xcm,$ycm,$radius-1,$radius-1, |
$angle1*180/M_PI,$angle2*180/M_PI,$this->ishadowcolor); |
} |
} |
} |
//-------------------------------------------------------------------------------- |
// This is the main loop to draw each cake slice |
//-------------------------------------------------------------------------------- |
// Set up the accumulated sum, start angle for first slice and border color |
$accsum=0; |
$angle2 = $this->startangle; |
$img->SetColor($this->color); |
// Loop though all the slices if there is a pie to draw (sum>0) |
// There are n slices in total |
for($i=0; $sum>0 && $i < $n; ++$i) { |
// $j is the actual index used for the slice |
$j = $n-$i-1; |
// Make sure we havea valid distance to explode the slice |
if( empty($this->explode_radius[$j]) ) { |
$this->explode_radius[$j]=0; |
} |
// The actual numeric value for the slice |
$d = $this->data[$i]; |
$angle1 = $angle2; |
// Accumlate the sum |
$accsum += $d; |
// The new angle when we add the "size" of this slice |
// angle1 is then the start and angle2 the end of this slice |
$angle2 = $this->NormAngle($this->startangle+2*M_PI*$accsum/$sum); |
// We avoid some trouble by not allowing end angle to be 0, in that case |
// we translate to 360 |
// la is used to hold the label angle, which is centered on the slice |
if( $angle2 < 0.0001 && $angle1 > 0.0001 ) { |
$this->la[$i] = 2*M_PI - (abs(2*M_PI-$angle1)/2.0+$angle1); |
} |
elseif( $angle1 > $angle2 ) { |
// The case where the slice crosses the 3 a'clock line |
// Remember that the slices are counted clockwise and |
// labels are counted counter clockwise so we need to revert with 2 PI |
$this->la[$i] = 2*M_PI-$this->NormAngle($angle1 + ((2*M_PI - $angle1)+$angle2)/2); |
} |
else { |
$this->la[$i] = 2*M_PI - (abs($angle2-$angle1)/2.0+$angle1); |
} |
// Too avoid rounding problems we skip the slice if it is too small |
if( $d < 0.00001 ) continue; |
// If the user has specified an array of colors for each slice then use |
// that a color otherwise use the theme array (ta) of colors |
if( $this->setslicecolors==null ) { |
$slicecolor=$colors[$ta[$i%$numcolors]]; |
} |
else { |
$slicecolor=$this->setslicecolors[$i%$numcolors]; |
} |
// $_sa = round($angle1*180/M_PI); |
// $_ea = round($angle2*180/M_PI); |
// $_la = round($this->la[$i]*180/M_PI); |
// echo "Slice#$i: ang1=$_sa , ang2=$_ea, la=$_la, color=$slicecolor<br>"; |
// If we have enabled antialias then we don't draw any border so |
// make the bordedr color the same as the slice color |
if( $this->pie_interior_border && $aaoption===0 ) { |
$img->SetColor($this->color); |
} |
else { |
$img->SetColor($slicecolor); |
} |
$arccolor = $this->pie_border && $aaoption===0 ? $this->color : ""; |
// Calculate the x,y coordinates for the base of this slice taking |
// the exploded distance into account. Here we use the mid angle as the |
// ray of extension and we have the mid angle handy as it is also the |
// label angle |
$xcm = $xc + $this->explode_radius[$j]*cos($this->la[$i])*$expscale; |
$ycm = $yc - $this->explode_radius[$j]*sin($this->la[$i])*$expscale; |
// If we are not just drawing the labels then draw this cake slice |
if( $aaoption !== 2 ) { |
$_sa = round($angle1*180/M_PI); |
$_ea = round($angle2*180/M_PI); |
$_la = round($this->la[$i]*180/M_PI); |
//echo "[$i] sa=$_sa, ea=$_ea, la[$i]=$_la, (color=$slicecolor)<br>"; |
// The CakeSlice method draws a full circle in case of start angle = end angle |
// for pie slices we want this in case the slice have a value larger than 99% of the |
// total sum |
if( abs($_ea-$_sa) >= 1 || $d == $sum ) { |
$img->CakeSlice($xcm,$ycm,$radius-1,$radius-1,$_sa,$_ea,$slicecolor,$arccolor); |
} |
} |
// If the CSIM is used then make sure we register a CSIM area for this slice as well |
if( $this->csimtargets && $aaoption !== 1 ) { |
$this->AddSliceToCSIM($i,$xcm,$ycm,$radius,$angle1,$angle2); |
} |
} |
// Format the titles for each slice |
if( $aaoption !== 2 ) { |
for( $i=0; $i < $n; ++$i) { |
if( $this->labeltype==0 ) { |
if( $sum != 0 ) |
$l = 100.0*$this->data[$i]/$sum; |
else |
$l = 0.0; |
} |
elseif( $this->labeltype==1 ) { |
$l = $this->data[$i]*1.0; |
} |
else { |
$l = $this->adjusted_data[$i]; |
} |
if( isset($this->labels[$i]) && is_string($this->labels[$i]) ) |
$this->labels[$i]=sprintf($this->labels[$i],$l); |
else |
$this->labels[$i]=$l; |
} |
} |
if( $this->value->show && $aaoption !== 1 ) { |
$this->StrokeAllLabels($img,$xc,$yc,$radius); |
} |
// Adjust title position |
if( $aaoption !== 1 ) { |
$this->title->SetPos($xc, |
$yc-$this->title->GetFontHeight($img)-$radius-$this->title->margin, |
"center","bottom"); |
$this->title->Stroke($img); |
} |
} |
//--------------- |
// PRIVATE METHODS |
function NormAngle($a) { |
while( $a < 0 ) $a += 2*M_PI; |
while( $a > 2*M_PI ) $a -= 2*M_PI; |
return $a; |
} |
function Quadrant($a) { |
$a=$this->NormAngle($a); |
if( $a > 0 && $a <= M_PI/2 ) |
return 0; |
if( $a > M_PI/2 && $a <= M_PI ) |
return 1; |
if( $a > M_PI && $a <= 1.5*M_PI ) |
return 2; |
if( $a > 1.5*M_PI ) |
return 3; |
} |
function StrokeGuideLabels($img,$xc,$yc,$radius) { |
$n = count($this->labels); |
//----------------------------------------------------------------------- |
// Step 1 of the algorithm is to construct a number of clusters |
// a cluster is defined as all slices within the same quadrant (almost) |
// that has an angular distance less than the treshold |
//----------------------------------------------------------------------- |
$tresh_hold=25 * M_PI/180; // 25 degrees difference to be in a cluster |
$incluster=false; // flag if we are currently in a cluster or not |
$clusters = array(); // array of clusters |
$cidx=-1; // running cluster index |
// Go through all the labels and construct a number of clusters |
for($i=0; $i < $n-1; ++$i) { |
// Calc the angle distance between two consecutive slices |
$a1=$this->la[$i]; |
$a2=$this->la[$i+1]; |
$q1 = $this->Quadrant($a1); |
$q2 = $this->Quadrant($a2); |
$diff = abs($a1-$a2); |
if( $diff < $tresh_hold ) { |
if( $incluster ) { |
$clusters[$cidx][1]++; |
// Each cluster can only cover one quadrant |
// Do we cross a quadrant ( and must break the cluster) |
if( $q1 != $q2 ) { |
// If we cross a quadrant boundary we normally start a |
// new cluster. However we need to take the 12'a clock |
// and 6'a clock positions into a special consideration. |
// Case 1: WE go from q=1 to q=2 if the last slice on |
// the cluster for q=1 is close to 12'a clock and the |
// first slice in q=0 is small we extend the previous |
// cluster |
if( $q1 == 1 && $q2 == 0 && $a2 > (90-15)*M_PI/180 ) { |
if( $i < $n-2 ) { |
$a3 = $this->la[$i+2]; |
// If there isn't a cluster coming up with the next-next slice |
// we extend the previous cluster to cover this slice as well |
if( abs($a3-$a2) >= $tresh_hold ) { |
$clusters[$cidx][1]++; |
$i++; |
} |
} |
} |
elseif( $q1 == 3 && $q2 == 2 && $a2 > (270-15)*M_PI/180 ) { |
if( $i < $n-2 ) { |
$a3 = $this->la[$i+2]; |
// If there isn't a cluster coming up with the next-next slice |
// we extend the previous cluster to cover this slice as well |
if( abs($a3-$a2) >= $tresh_hold ) { |
$clusters[$cidx][1]++; |
$i++; |
} |
} |
} |
if( $q1==2 && $q2==1 && $a2 > (180-15)*M_PI/180 ) { |
$clusters[$cidx][1]++; |
$i++; |
} |
$incluster = false; |
} |
} |
elseif( $q1 == $q2) { |
$incluster = true; |
// Now we have a special case for quadrant 0. If we previously |
// have a cluster of one in quadrant 0 we just extend that |
// cluster. If we don't do this then we risk that the label |
// for the cluster of one will cross the guide-line |
if( $q1 == 0 && $cidx > -1 && |
$clusters[$cidx][1] == 1 && |
$this->Quadrant($this->la[$clusters[$cidx][0]]) == 0 ) { |
$clusters[$cidx][1]++; |
} |
else { |
$cidx++; |
$clusters[$cidx][0] = $i; |
$clusters[$cidx][1] = 1; |
} |
} |
else { |
// Create a "cluster" of one since we are just crossing |
// a quadrant |
$cidx++; |
$clusters[$cidx][0] = $i; |
$clusters[$cidx][1] = 1; |
} |
} |
else { |
if( $incluster ) { |
// Add the last slice |
$clusters[$cidx][1]++; |
$incluster = false; |
} |
else { // Create a "cluster" of one |
$cidx++; |
$clusters[$cidx][0] = $i; |
$clusters[$cidx][1] = 1; |
} |
} |
} |
// Handle the very last slice |
if( $incluster ) { |
$clusters[$cidx][1]++; |
} |
else { // Create a "cluster" of one |
$cidx++; |
$clusters[$cidx][0] = $i; |
$clusters[$cidx][1] = 1; |
} |
/* |
if( true ) { |
// Debug printout in labels |
for( $i=0; $i <= $cidx; ++$i ) { |
for( $j=0; $j < $clusters[$i][1]; ++$j ) { |
$a = $this->la[$clusters[$i][0]+$j]; |
$aa = round($a*180/M_PI); |
$q = $this->Quadrant($a); |
$this->labels[$clusters[$i][0]+$j]="[$q:$aa] $i:$j"; |
} |
} |
} |
*/ |
//----------------------------------------------------------------------- |
// Step 2 of the algorithm is use the clusters and draw the labels |
// and guidelines |
//----------------------------------------------------------------------- |
// We use the font height as the base factor for how far we need to |
// spread the labels in the Y-direction. |
$this->value->ApplyFont($img); |
$fh = $img->GetFontHeight(); |
$origvstep=$fh*$this->iGuideVFactor; |
$this->value->SetMargin(0); |
// Number of clusters found |
$nc = count($clusters); |
// Walk through all the clusters |
for($i=0; $i < $nc; ++$i) { |
// Start angle and number of slices in this cluster |
$csize = $clusters[$i][1]; |
$a = $this->la[$clusters[$i][0]]; |
$q = $this->Quadrant($a); |
// Now set up the start and end conditions to make sure that |
// in each cluster we walk through the all the slices starting with the slice |
// closest to the equator. Since all slices are numbered clockwise from "3'a clock" |
// we have different conditions depending on in which quadrant the slice lies within. |
if( $q == 0 ) { |
$start = $csize-1; $idx = $start; $step = -1; $vstep = -$origvstep; |
} |
elseif( $q == 1 ) { |
$start = 0; $idx = $start; $step = 1; $vstep = -$origvstep; |
} |
elseif( $q == 2 ) { |
$start = $csize-1; $idx = $start; $step = -1; $vstep = $origvstep; |
} |
elseif( $q == 3 ) { |
$start = 0; $idx = $start; $step = 1; $vstep = $origvstep; |
} |
// Walk through all slices within this cluster |
for($j=0; $j < $csize; ++$j) { |
// Now adjust the position of the labels in each cluster starting |
// with the slice that is closest to the equator of the pie |
$a = $this->la[$clusters[$i][0]+$idx]; |
// Guide line start in the center of the arc of the slice |
$r = $radius+$this->explode_radius[$n-1-($clusters[$i][0]+$idx)]; |
$x = round($r*cos($a)+$xc); |
$y = round($yc-$r*sin($a)); |
// The distance from the arc depends on chosen font and the "R-Factor" |
$r += $fh*$this->iGuideLineRFactor; |
// Should the labels be placed curved along the pie or in straight columns |
// outside the pie? |
if( $this->iGuideLineCurve ) |
$xt=round($r*cos($a)+$xc); |
// If this is the first slice in the cluster we need some first time |
// proessing |
if( $idx == $start ) { |
if( ! $this->iGuideLineCurve ) |
$xt=round($r*cos($a)+$xc); |
$yt=round($yc-$r*sin($a)); |
// Some special consideration in case this cluster starts |
// in quadrant 1 or 3 very close to the "equator" (< 20 degrees) |
// and the previous clusters last slice is within the tolerance. |
// In that case we add a font height to this labels Y-position |
// so it doesn't collide with |
// the slice in the previous cluster |
$prevcluster = ($i + ($nc-1) ) % $nc; |
$previdx=$clusters[$prevcluster][0]+$clusters[$prevcluster][1]-1; |
if( $q == 1 && $a > 160*M_PI/180 ) { |
// Get the angle for the previous clusters last slice |
$diff = abs($a-$this->la[$previdx]); |
if( $diff < $tresh_hold ) { |
$yt -= $fh; |
} |
} |
elseif( $q == 3 && $a > 340*M_PI/180 ) { |
// We need to subtract 360 to compare angle distance between |
// q=0 and q=3 |
$diff = abs($a-$this->la[$previdx]-360*M_PI/180); |
if( $diff < $tresh_hold ) { |
$yt += $fh; |
} |
} |
} |
else { |
// The step is at minimum $vstep but if the slices are relatively large |
// we make sure that we add at least a step that corresponds to the vertical |
// distance between the centers at the arc on the slice |
$prev_a = $this->la[$clusters[$i][0]+($idx-$step)]; |
$dy = abs($radius*(sin($a)-sin($prev_a))*1.2); |
if( $vstep > 0 ) |
$yt += max($vstep,$dy); |
else |
$yt += min($vstep,-$dy); |
} |
$label = $this->labels[$clusters[$i][0]+$idx]; |
if( $csize == 1 ) { |
// A "meta" cluster with only one slice |
$r = $radius+$this->explode_radius[$n-1-($clusters[$i][0]+$idx)]; |
$rr = $r+$img->GetFontHeight()/2; |
$xt=round($rr*cos($a)+$xc); |
$yt=round($yc-$rr*sin($a)); |
$this->StrokeLabel($label,$img,$xc,$yc,$a,$r); |
if( $this->iShowGuideLineForSingle ) |
$this->guideline->Stroke($img,$x,$y,$xt,$yt); |
} |
else { |
$this->guideline->Stroke($img,$x,$y,$xt,$yt); |
if( $q==1 || $q==2 ) { |
// Left side of Pie |
$this->guideline->Stroke($img,$xt,$yt,$xt-$this->guidelinemargin,$yt); |
$lbladj = -$this->guidelinemargin-5; |
$this->value->halign = "right"; |
$this->value->valign = "center"; |
} |
else { |
// Right side of pie |
$this->guideline->Stroke($img,$xt,$yt,$xt+$this->guidelinemargin,$yt); |
$lbladj = $this->guidelinemargin+5; |
$this->value->halign = "left"; |
$this->value->valign = "center"; |
} |
$this->value->Stroke($img,$label,$xt+$lbladj,$yt); |
} |
// Udate idx to point to next slice in the cluster to process |
$idx += $step; |
} |
} |
} |
function StrokeAllLabels($img,$xc,$yc,$radius) { |
// First normalize all angles for labels |
$n = count($this->la); |
for($i=0; $i < $n; ++$i) { |
$this->la[$i] = $this->NormAngle($this->la[$i]); |
} |
if( $this->guideline->iShow ) { |
$this->StrokeGuideLabels($img,$xc,$yc,$radius); |
} |
else { |
$n = count($this->labels); |
for($i=0; $i < $n; ++$i) { |
$this->StrokeLabel($this->labels[$i],$img,$xc,$yc, |
$this->la[$i], |
$radius + $this->explode_radius[$n-1-$i]); |
} |
} |
} |
// Position the labels of each slice |
function StrokeLabel($label,$img,$xc,$yc,$a,$r) { |
// Default value |
if( $this->ilabelposadj === 'auto' ) |
$this->ilabelposadj = 0.65; |
// We position the values diferently depending on if they are inside |
// or outside the pie |
if( $this->ilabelposadj < 1.0 ) { |
$this->value->SetAlign('center','center'); |
$this->value->margin = 0; |
$xt=round($this->ilabelposadj*$r*cos($a)+$xc); |
$yt=round($yc-$this->ilabelposadj*$r*sin($a)); |
$this->value->Stroke($img,$label,$xt,$yt); |
} |
else { |
$this->value->halign = "left"; |
$this->value->valign = "top"; |
$this->value->margin = 0; |
// Position the axis title. |
// dx, dy is the offset from the top left corner of the bounding box that sorrounds the text |
// that intersects with the extension of the corresponding axis. The code looks a little |
// bit messy but this is really the only way of having a reasonable position of the |
// axis titles. |
$this->value->ApplyFont($img); |
$h=$img->GetTextHeight($label); |
// For numeric values the format of the display value |
// must be taken into account |
if( is_numeric($label) ) { |
if( $label > 0 ) |
$w=$img->GetTextWidth(sprintf($this->value->format,$label)); |
else |
$w=$img->GetTextWidth(sprintf($this->value->negformat,$label)); |
} |
else |
$w=$img->GetTextWidth($label); |
if( $this->ilabelposadj > 1.0 && $this->ilabelposadj < 5.0) { |
$r *= $this->ilabelposadj; |
} |
$r += $img->GetFontHeight()/1.5; |
$xt=round($r*cos($a)+$xc); |
$yt=round($yc-$r*sin($a)); |
// Normalize angle |
while( $a < 0 ) $a += 2*M_PI; |
while( $a > 2*M_PI ) $a -= 2*M_PI; |
if( $a>=7*M_PI/4 || $a <= M_PI/4 ) $dx=0; |
if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dx=($a-M_PI/4)*2/M_PI; |
if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dx=1; |
if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dx=(1-($a-M_PI*5/4)*2/M_PI); |
if( $a>=7*M_PI/4 ) $dy=(($a-M_PI)-3*M_PI/4)*2/M_PI; |
if( $a<=M_PI/4 ) $dy=(1-$a*2/M_PI); |
if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dy=1; |
if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dy=(1-($a-3*M_PI/4)*2/M_PI); |
if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dy=0; |
$this->value->Stroke($img,$label,$xt-$dx*$w,$yt-$dy*$h); |
} |
} |
} // Class |
//=================================================== |
// CLASS PiePlotC |
// Description: Same as a normal pie plot but with a |
// filled circle in the center |
//=================================================== |
class PiePlotC extends PiePlot { |
private $imidsize=0.5; // Fraction of total width |
private $imidcolor='white'; |
public $midtitle=''; |
private $middlecsimtarget='',$middlecsimwintarget='',$middlecsimalt=''; |
function __construct($data,$aCenterTitle='') { |
parent::__construct($data); |
$this->midtitle = new Text(); |
$this->midtitle->ParagraphAlign('center'); |
} |
function SetMid($aTitle,$aColor='white',$aSize=0.5) { |
$this->midtitle->Set($aTitle); |
$this->imidsize = $aSize ; |
$this->imidcolor = $aColor ; |
} |
function SetMidTitle($aTitle) { |
$this->midtitle->Set($aTitle); |
} |
function SetMidSize($aSize) { |
$this->imidsize = $aSize ; |
} |
function SetMidColor($aColor) { |
$this->imidcolor = $aColor ; |
} |
function SetMidCSIM($aTarget,$aAlt='',$aWinTarget='') { |
$this->middlecsimtarget = $aTarget; |
$this->middlecsimwintarget = $aWinTarget; |
$this->middlecsimalt = $aAlt; |
} |
function AddSliceToCSIM($i,$xc,$yc,$radius,$sa,$ea) { |
//Slice number, ellipse centre (x,y), radius, start angle, end angle |
while( $sa > 2*M_PI ) $sa = $sa - 2*M_PI; |
while( $ea > 2*M_PI ) $ea = $ea - 2*M_PI; |
$sa = 2*M_PI - $sa; |
$ea = 2*M_PI - $ea; |
// Special case when we have only one slice since then both start and end |
// angle will be == 0 |
if( abs($sa - $ea) < 0.0001 ) { |
$sa=2*M_PI; $ea=0; |
} |
// Add inner circle first point |
$xp = floor(($this->imidsize*$radius*cos($ea))+$xc); |
$yp = floor($yc-($this->imidsize*$radius*sin($ea))); |
$coords = "$xp, $yp"; |
//add coordinates every 0.25 radians |
$a=$ea+0.25; |
// If we cross the 360-limit with a slice we need to handle |
// the fact that end angle is smaller than start |
if( $sa < $ea ) { |
while ($a <= 2*M_PI) { |
$xp = floor($radius*cos($a)+$xc); |
$yp = floor($yc-$radius*sin($a)); |
$coords.= ", $xp, $yp"; |
$a += 0.25; |
} |
$a -= 2*M_PI; |
} |
while ($a < $sa) { |
$xp = floor(($this->imidsize*$radius*cos($a)+$xc)); |
$yp = floor($yc-($this->imidsize*$radius*sin($a))); |
$coords.= ", $xp, $yp"; |
$a += 0.25; |
} |
// Make sure we end at the last point |
$xp = floor(($this->imidsize*$radius*cos($sa)+$xc)); |
$yp = floor($yc-($this->imidsize*$radius*sin($sa))); |
$coords.= ", $xp, $yp"; |
// Straight line to outer circle |
$xp = floor($radius*cos($sa)+$xc); |
$yp = floor($yc-$radius*sin($sa)); |
$coords.= ", $xp, $yp"; |
//add coordinates every 0.25 radians |
$a=$sa - 0.25; |
while ($a > $ea) { |
$xp = floor($radius*cos($a)+$xc); |
$yp = floor($yc-$radius*sin($a)); |
$coords.= ", $xp, $yp"; |
$a -= 0.25; |
} |
//Add the last point on the arc |
$xp = floor($radius*cos($ea)+$xc); |
$yp = floor($yc-$radius*sin($ea)); |
$coords.= ", $xp, $yp"; |
// Close the arc |
$xp = floor(($this->imidsize*$radius*cos($ea))+$xc); |
$yp = floor($yc-($this->imidsize*$radius*sin($ea))); |
$coords .= ", $xp, $yp"; |
if( !empty($this->csimtargets[$i]) ) { |
$this->csimareas .= "<area shape=\"poly\" coords=\"$coords\" href=\"". |
$this->csimtargets[$i]."\""; |
if( !empty($this->csimwintargets[$i]) ) { |
$this->csimareas .= " target=\"".$this->csimwintargets[$i]."\" "; |
} |
if( !empty($this->csimalts[$i]) ) { |
$tmp=sprintf($this->csimalts[$i],$this->data[$i]); |
$this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" "; |
} |
$this->csimareas .= " />\n"; |
} |
} |
function Stroke($img,$aaoption=0) { |
// Stroke the pie but don't stroke values |
$tmp = $this->value->show; |
$this->value->show = false; |
parent::Stroke($img,$aaoption); |
$this->value->show = $tmp; |
$xc = round($this->posx*$img->width); |
$yc = round($this->posy*$img->height); |
$radius = floor($this->radius * min($img->width,$img->height)) ; |
if( $this->imidsize > 0 && $aaoption !== 2 ) { |
if( $this->ishadowcolor != "" ) { |
$img->SetColor($this->ishadowcolor); |
$img->FilledCircle($xc+$this->ishadowdrop,$yc+$this->ishadowdrop, |
round($radius*$this->imidsize)); |
} |
$img->SetColor($this->imidcolor); |
$img->FilledCircle($xc,$yc,round($radius*$this->imidsize)); |
if( $this->pie_border && $aaoption === 0 ) { |
$img->SetColor($this->color); |
$img->Circle($xc,$yc,round($radius*$this->imidsize)); |
} |
if( !empty($this->middlecsimtarget) ) |
$this->AddMiddleCSIM($xc,$yc,round($radius*$this->imidsize)); |
} |
if( $this->value->show && $aaoption !== 1) { |
$this->StrokeAllLabels($img,$xc,$yc,$radius); |
$this->midtitle->SetPos($xc,$yc,'center','center'); |
$this->midtitle->Stroke($img); |
} |
} |
function AddMiddleCSIM($xc,$yc,$r) { |
$xc=round($xc);$yc=round($yc);$r=round($r); |
$this->csimareas .= "<area shape=\"circle\" coords=\"$xc,$yc,$r\" href=\"". |
$this->middlecsimtarget."\""; |
if( !empty($this->middlecsimwintarget) ) { |
$this->csimareas .= " target=\"".$this->middlecsimwintarget."\""; |
} |
if( !empty($this->middlecsimalt) ) { |
$tmp = $this->middlecsimalt; |
$this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" "; |
} |
$this->csimareas .= " />\n"; |
} |
function StrokeLabel($label,$img,$xc,$yc,$a,$r) { |
if( $this->ilabelposadj === 'auto' ) |
$this->ilabelposadj = (1-$this->imidsize)/2+$this->imidsize; |
parent::StrokeLabel($label,$img,$xc,$yc,$a,$r); |
} |
} |
//=================================================== |
// CLASS PieGraph |
// Description: |
//=================================================== |
class PieGraph extends Graph { |
private $posx, $posy, $radius; |
private $legends=array(); |
public $plots=array(); |
public $pieaa = false ; |
//--------------- |
// CONSTRUCTOR |
function __construct($width=300,$height=200,$cachedName="",$timeout=0,$inline=1) { |
parent::__construct($width,$height,$cachedName,$timeout,$inline); |
$this->posx=$width/2; |
$this->posy=$height/2; |
$this->SetColor(array(255,255,255)); |
} |
//--------------- |
// PUBLIC METHODS |
function Add($aObj) { |
if( is_array($aObj) && count($aObj) > 0 ) |
$cl = $aObj[0]; |
else |
$cl = $aObj; |
if( $cl instanceof Text ) |
$this->AddText($aObj); |
elseif( class_exists('IconPlot',false) && ($cl instanceof IconPlot) ) |
$this->AddIcon($aObj); |
else { |
if( is_array($aObj) ) { |
$n = count($aObj); |
for($i=0; $i < $n; ++$i ) { |
$this->plots[] = $aObj[$i]; |
} |
} |
else { |
$this->plots[] = $aObj; |
} |
} |
} |
function SetAntiAliasing($aFlg=true) { |
$this->pieaa = $aFlg; |
} |
function SetColor($c) { |
$this->SetMarginColor($c); |
} |
function DisplayCSIMAreas() { |
$csim=""; |
foreach($this->plots as $p ) { |
$csim .= $p->GetCSIMareas(); |
} |
$csim.= $this->legend->GetCSIMareas(); |
if (preg_match_all("/area shape=\"(\w+)\" coords=\"([0-9\, ]+)\"/", $csim, $coords)) { |
$this->img->SetColor($this->csimcolor); |
$n = count($coords[0]); |
for ($i=0; $i < $n; $i++) { |
if ($coords[1][$i]=="poly") { |
preg_match_all('/\s*([0-9]+)\s*,\s*([0-9]+)\s*,*/',$coords[2][$i],$pts); |
$this->img->SetStartPoint($pts[1][count($pts[0])-1],$pts[2][count($pts[0])-1]); |
$m = count($pts[0]); |
for ($j=0; $j < $m; $j++) { |
$this->img->LineTo($pts[1][$j],$pts[2][$j]); |
} |
} else if ($coords[1][$i]=="rect") { |
$pts = preg_split('/,/', $coords[2][$i]); |
$this->img->SetStartPoint($pts[0],$pts[1]); |
$this->img->LineTo($pts[2],$pts[1]); |
$this->img->LineTo($pts[2],$pts[3]); |
$this->img->LineTo($pts[0],$pts[3]); |
$this->img->LineTo($pts[0],$pts[1]); |
} |
} |
} |
} |
// Method description |
function Stroke($aStrokeFileName="") { |
// If the filename is the predefined value = '_csim_special_' |
// we assume that the call to stroke only needs to do enough |
// to correctly generate the CSIM maps. |
// We use this variable to skip things we don't strictly need |
// to do to generate the image map to improve performance |
// a best we can. Therefor you will see a lot of tests !$_csim in the |
// code below. |
$_csim = ($aStrokeFileName===_CSIM_SPECIALFILE); |
// If we are called the second time (perhaps the user has called GetHTMLImageMap() |
// himself then the legends have alsready been populated once in order to get the |
// CSIM coordinats. Since we do not want the legends to be populated a second time |
// we clear the legends |
$this->legend->Clear(); |
// We need to know if we have stroked the plot in the |
// GetCSIMareas. Otherwise the CSIM hasn't been generated |
// and in the case of GetCSIM called before stroke to generate |
// CSIM without storing an image to disk GetCSIM must call Stroke. |
$this->iHasStroked = true; |
$n = count($this->plots); |
if( $this->pieaa ) { |
if( !$_csim ) { |
if( $this->background_image != "" ) { |
$this->StrokeFrameBackground(); |
} |
else { |
$this->StrokeFrame(); |
$this->StrokeBackgroundGrad(); |
} |
} |
$w = $this->img->width; |
$h = $this->img->height; |
$oldimg = $this->img->img; |
$this->img->CreateImgCanvas(2*$w,2*$h); |
$this->img->SetColor( $this->margin_color ); |
$this->img->FilledRectangle(0,0,2*$w-1,2*$h-1); |
// Make all icons *2 i size since we will be scaling down the |
// imahe to do the anti aliasing |
$ni = count($this->iIcons); |
for($i=0; $i < $ni; ++$i) { |
$this->iIcons[$i]->iScale *= 2 ; |
if( $this->iIcons[$i]->iX > 1 ) |
$this->iIcons[$i]->iX *= 2 ; |
if( $this->iIcons[$i]->iY > 1 ) |
$this->iIcons[$i]->iY *= 2 ; |
} |
$this->StrokeIcons(); |
for($i=0; $i < $n; ++$i) { |
if( $this->plots[$i]->posx > 1 ) |
$this->plots[$i]->posx *= 2 ; |
if( $this->plots[$i]->posy > 1 ) |
$this->plots[$i]->posy *= 2 ; |
$this->plots[$i]->Stroke($this->img,1); |
if( $this->plots[$i]->posx > 1 ) |
$this->plots[$i]->posx /= 2 ; |
if( $this->plots[$i]->posy > 1 ) |
$this->plots[$i]->posy /= 2 ; |
} |
$indent = $this->doframe ? ($this->frame_weight + ($this->doshadow ? $this->shadow_width : 0 )) : 0 ; |
$indent += $this->framebevel ? $this->framebeveldepth + 1 : 0 ; |
$this->img->CopyCanvasH($oldimg,$this->img->img,$indent,$indent,$indent,$indent, |
$w-2*$indent,$h-2*$indent,2*($w-$indent),2*($h-$indent)); |
$this->img->img = $oldimg ; |
$this->img->width = $w ; |
$this->img->height = $h ; |
for($i=0; $i < $n; ++$i) { |
$this->plots[$i]->Stroke($this->img,2); // Stroke labels |
$this->plots[$i]->Legend($this); |
} |
} |
else { |
if( !$_csim ) { |
if( $this->background_image != "" ) { |
$this->StrokeFrameBackground(); |
} |
else { |
$this->StrokeFrame(); |
$this->StrokeBackgroundGrad(); |
} |
} |
$this->StrokeIcons(); |
for($i=0; $i < $n; ++$i) { |
$this->plots[$i]->Stroke($this->img); |
$this->plots[$i]->Legend($this); |
} |
} |
$this->legend->Stroke($this->img); |
$this->footer->Stroke($this->img); |
$this->StrokeTitles(); |
if( !$_csim ) { |
// Stroke texts |
if( $this->texts != null ) { |
$n = count($this->texts); |
for($i=0; $i < $n; ++$i ) { |
$this->texts[$i]->Stroke($this->img); |
} |
} |
if( _JPG_DEBUG ) { |
$this->DisplayCSIMAreas(); |
} |
// Should we do any final image transformation |
if( $this->iImgTrans ) { |
if( !class_exists('ImgTrans',false) ) { |
require_once('jpgraph_imgtrans.php'); |
//JpGraphError::Raise('In order to use image transformation you must include the file jpgraph_imgtrans.php in your script.'); |
} |
$tform = new ImgTrans($this->img->img); |
$this->img->img = $tform->Skew3D($this->iImgTransHorizon,$this->iImgTransSkewDist, |
$this->iImgTransDirection,$this->iImgTransHighQ, |
$this->iImgTransMinSize,$this->iImgTransFillColor, |
$this->iImgTransBorder); |
} |
// If the filename is given as the special "__handle" |
// then the image handler is returned and the image is NOT |
// streamed back |
if( $aStrokeFileName == _IMG_HANDLER ) { |
return $this->img->img; |
} |
else { |
// Finally stream the generated picture |
$this->cache->PutAndStream($this->img,$this->cache_name,$this->inline, |
$aStrokeFileName); |
} |
} |
} |
} // Class |
/* EOF */ |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/jpgraph_polar.php |
---|
New file |
0,0 → 1,897 |
<?php |
/*======================================================================= |
// File: JPGRAPH_POLAR.PHP |
// Description: Polar plot extension for JpGraph |
// Created: 2003-02-02 |
// Ver: $Id: jpgraph_polar.php 1796 2009-09-07 09:37:19Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
*/ |
require_once ('jpgraph_plotmark.inc.php'); |
require_once "jpgraph_log.php"; |
define('POLAR_360',1); |
define('POLAR_180',2); |
// |
// Note. Don't attempt to make sense of this code. |
// In order not to have to be able to inherit the scaling code |
// from the main graph package we have had to make some "tricks" since |
// the original scaling and axis was not designed to do what is |
// required here. |
// There were two option. 1: Re-implement everything and get a clean design |
// and 2: do some "small" trickery and be able to inherit most of |
// the functionlity from the main graph package. |
// We choose 2: here in order to save some time. |
// |
//-------------------------------------------------------------------------- |
// class PolarPlot |
//-------------------------------------------------------------------------- |
class PolarPlot { |
public $line_style='solid',$mark; |
public $legendcsimtarget=''; |
public $legendcsimalt=''; |
public $legend=""; |
public $csimtargets=array(); // Array of targets for CSIM |
public $csimareas=""; // Resultant CSIM area tags |
public $csimalts=null; // ALT:s for corresponding target |
public $scale=null; |
private $numpoints=0; |
private $iColor='navy',$iFillColor=''; |
private $iLineWeight=1; |
private $coord=null; |
function __construct($aData) { |
$n = count($aData); |
if( $n & 1 ) { |
JpGraphError::RaiseL(17001); |
//('Polar plots must have an even number of data point. Each data point is a tuple (angle,radius).'); |
} |
$this->numpoints = $n/2; |
$this->coord = $aData; |
$this->mark = new PlotMark(); |
} |
function SetWeight($aWeight) { |
$this->iLineWeight = $aWeight; |
} |
function SetColor($aColor){ |
$this->iColor = $aColor; |
} |
function SetFillColor($aColor){ |
$this->iFillColor = $aColor; |
} |
function Max() { |
$m = $this->coord[1]; |
$i=1; |
while( $i < $this->numpoints ) { |
$m = max($m,$this->coord[2*$i+1]); |
++$i; |
} |
return $m; |
} |
// Set href targets for CSIM |
function SetCSIMTargets($aTargets,$aAlts=null) { |
$this->csimtargets=$aTargets; |
$this->csimalts=$aAlts; |
} |
// Get all created areas |
function GetCSIMareas() { |
return $this->csimareas; |
} |
function SetLegend($aLegend,$aCSIM="",$aCSIMAlt="") { |
$this->legend = $aLegend; |
$this->legendcsimtarget = $aCSIM; |
$this->legendcsimalt = $aCSIMAlt; |
} |
// Private methods |
function Legend($aGraph) { |
$color = $this->iColor ; |
if( $this->legend != "" ) { |
if( $this->iFillColor!='' ) { |
$color = $this->iFillColor; |
$aGraph->legend->Add($this->legend,$color,$this->mark,0, |
$this->legendcsimtarget,$this->legendcsimalt); |
} |
else { |
$aGraph->legend->Add($this->legend,$color,$this->mark,$this->line_style, |
$this->legendcsimtarget,$this->legendcsimalt); |
} |
} |
} |
function Stroke($img,$scale) { |
$i=0; |
$p=array(); |
$this->csimareas=''; |
while($i < $this->numpoints) { |
list($x1,$y1) = $scale->PTranslate($this->coord[2*$i],$this->coord[2*$i+1]); |
$p[2*$i] = $x1; |
$p[2*$i+1] = $y1; |
if( isset($this->csimtargets[$i]) ) { |
$this->mark->SetCSIMTarget($this->csimtargets[$i]); |
$this->mark->SetCSIMAlt($this->csimalts[$i]); |
$this->mark->SetCSIMAltVal($this->coord[2*$i], $this->coord[2*$i+1]); |
$this->mark->Stroke($img,$x1,$y1); |
$this->csimareas .= $this->mark->GetCSIMAreas(); |
} |
else { |
$this->mark->Stroke($img,$x1,$y1); |
} |
++$i; |
} |
if( $this->iFillColor != '' ) { |
$img->SetColor($this->iFillColor); |
$img->FilledPolygon($p); |
} |
$img->SetLineWeight($this->iLineWeight); |
$img->SetColor($this->iColor); |
$img->Polygon($p,$this->iFillColor!=''); |
} |
} |
//-------------------------------------------------------------------------- |
// class PolarAxis |
//-------------------------------------------------------------------------- |
class PolarAxis extends Axis { |
private $angle_step=15,$angle_color='lightgray',$angle_label_color='black'; |
private $angle_fontfam=FF_FONT1,$angle_fontstyle=FS_NORMAL,$angle_fontsize=10; |
private $angle_fontcolor = 'navy'; |
private $gridminor_color='lightgray',$gridmajor_color='lightgray'; |
private $show_minor_grid = false, $show_major_grid = true ; |
private $show_angle_mark=true, $show_angle_grid=true, $show_angle_label=true; |
private $angle_tick_len=3, $angle_tick_len2=3, $angle_tick_color='black'; |
private $show_angle_tick=true; |
private $radius_tick_color='black'; |
function __construct($img,$aScale) { |
parent::__construct($img,$aScale); |
} |
function ShowAngleDegreeMark($aFlg=true) { |
$this->show_angle_mark = $aFlg; |
} |
function SetAngleStep($aStep) { |
$this->angle_step=$aStep; |
} |
function HideTicks($aFlg=true,$aAngleFlg=true) { |
parent::HideTicks($aFlg,$aFlg); |
$this->show_angle_tick = !$aAngleFlg; |
} |
function ShowAngleLabel($aFlg=true) { |
$this->show_angle_label = $aFlg; |
} |
function ShowGrid($aMajor=true,$aMinor=false,$aAngle=true) { |
$this->show_minor_grid = $aMinor; |
$this->show_major_grid = $aMajor; |
$this->show_angle_grid = $aAngle ; |
} |
function SetAngleFont($aFontFam,$aFontStyle=FS_NORMAL,$aFontSize=10) { |
$this->angle_fontfam = $aFontFam; |
$this->angle_fontstyle = $aFontStyle; |
$this->angle_fontsize = $aFontSize; |
} |
function SetColor($aColor,$aRadColor='',$aAngleColor='') { |
if( $aAngleColor == '' ) |
$aAngleColor=$aColor; |
parent::SetColor($aColor,$aRadColor); |
$this->angle_fontcolor = $aAngleColor; |
} |
function SetGridColor($aMajorColor,$aMinorColor='',$aAngleColor='') { |
if( $aMinorColor == '' ) |
$aMinorColor = $aMajorColor; |
if( $aAngleColor == '' ) |
$aAngleColor = $aMajorColor; |
$this->gridminor_color = $aMinorColor; |
$this->gridmajor_color = $aMajorColor; |
$this->angle_color = $aAngleColor; |
} |
function SetTickColors($aRadColor,$aAngleColor='') { |
$this->radius_tick_color = $aRadColor; |
$this->angle_tick_color = $aAngleColor; |
} |
// Private methods |
function StrokeGrid($pos) { |
$x = round($this->img->left_margin + $this->img->plotwidth/2); |
$this->scale->ticks->Stroke($this->img,$this->scale,$pos); |
// Stroke the minor arcs |
$pmin = array(); |
$p = $this->scale->ticks->ticks_pos; |
$n = count($p); |
$i = 0; |
$this->img->SetColor($this->gridminor_color); |
while( $i < $n ) { |
$r = $p[$i]-$x+1; |
$pmin[]=$r; |
if( $this->show_minor_grid ) { |
$this->img->Circle($x,$pos,$r); |
} |
$i++; |
} |
$limit = max($this->img->plotwidth,$this->img->plotheight)*1.4 ; |
while( $r < $limit ) { |
$off = $r; |
$i=1; |
$r = $off + round($p[$i]-$x+1); |
while( $r < $limit && $i < $n ) { |
$r = $off+$p[$i]-$x; |
$pmin[]=$r; |
if( $this->show_minor_grid ) { |
$this->img->Circle($x,$pos,$r); |
} |
$i++; |
} |
} |
// Stroke the major arcs |
if( $this->show_major_grid ) { |
// First determine how many minor step on |
// every major step. We have recorded the minor radius |
// in pmin and use these values. This is done in order |
// to avoid rounding errors if we were to recalculate the |
// different major radius. |
$pmaj = $this->scale->ticks->maj_ticks_pos; |
$p = $this->scale->ticks->ticks_pos; |
if( $this->scale->name == 'lin' ) { |
$step=round(($pmaj[1] - $pmaj[0])/($p[1] - $p[0])); |
} |
else { |
$step=9; |
} |
$n = round(count($pmin)/$step); |
$i = 0; |
$this->img->SetColor($this->gridmajor_color); |
$limit = max($this->img->plotwidth,$this->img->plotheight)*1.4 ; |
$off = $r; |
$i=0; |
$r = $pmin[$i*$step]; |
while( $r < $limit && $i < $n ) { |
$r = $pmin[$i*$step]; |
$this->img->Circle($x,$pos,$r); |
$i++; |
} |
} |
// Draw angles |
if( $this->show_angle_grid ) { |
$this->img->SetColor($this->angle_color); |
$d = max($this->img->plotheight,$this->img->plotwidth)*1.4 ; |
$a = 0; |
$p = $this->scale->ticks->ticks_pos; |
$start_radius = $p[1]-$x; |
while( $a < 360 ) { |
if( $a == 90 || $a == 270 ) { |
// Make sure there are no rounding problem with |
// exactly vertical lines |
$this->img->Line($x+$start_radius*cos($a/180*M_PI)+1, |
$pos-$start_radius*sin($a/180*M_PI), |
$x+$start_radius*cos($a/180*M_PI)+1, |
$pos-$d*sin($a/180*M_PI)); |
} |
else { |
$this->img->Line($x+$start_radius*cos($a/180*M_PI)+1, |
$pos-$start_radius*sin($a/180*M_PI), |
$x+$d*cos($a/180*M_PI), |
$pos-$d*sin($a/180*M_PI)); |
} |
$a += $this->angle_step; |
} |
} |
} |
function StrokeAngleLabels($pos,$type) { |
if( !$this->show_angle_label ) |
return; |
$x0 = round($this->img->left_margin+$this->img->plotwidth/2)+1; |
$d = max($this->img->plotwidth,$this->img->plotheight)*1.42; |
$a = $this->angle_step; |
$t = new Text(); |
$t->SetColor($this->angle_fontcolor); |
$t->SetFont($this->angle_fontfam,$this->angle_fontstyle,$this->angle_fontsize); |
$xright = $this->img->width - $this->img->right_margin; |
$ytop = $this->img->top_margin; |
$xleft = $this->img->left_margin; |
$ybottom = $this->img->height - $this->img->bottom_margin; |
$ha = 'left'; |
$va = 'center'; |
$w = $this->img->plotwidth/2; |
$h = $this->img->plotheight/2; |
$xt = $x0; $yt = $pos; |
$margin=5; |
$tl = $this->angle_tick_len ; // Outer len |
$tl2 = $this->angle_tick_len2 ; // Interior len |
$this->img->SetColor($this->angle_tick_color); |
$rot90 = $this->img->a == 90 ; |
if( $type == POLAR_360 ) { |
// Corner angles of the four corners |
$ca1 = atan($h/$w)/M_PI*180; |
$ca2 = 180-$ca1; |
$ca3 = $ca1+180; |
$ca4 = 360-$ca1; |
$end = 360; |
while( $a < $end ) { |
$ca = cos($a/180*M_PI); |
$sa = sin($a/180*M_PI); |
$x = $d*$ca; |
$y = $d*$sa; |
$xt=1000;$yt=1000; |
if( $a <= $ca1 || $a >= $ca4 ) { |
$yt = $pos - $w * $y/$x; |
$xt = $xright + $margin; |
if( $rot90 ) { |
$ha = 'center'; |
$va = 'top'; |
} |
else { |
$ha = 'left'; |
$va = 'center'; |
} |
$x1=$xright-$tl2; $x2=$xright+$tl; |
$y1=$y2=$yt; |
} |
elseif( $a > $ca1 && $a < $ca2 ) { |
$xt = $x0 + $h * $x/$y; |
$yt = $ytop - $margin; |
if( $rot90 ) { |
$ha = 'left'; |
$va = 'center'; |
} |
else { |
$ha = 'center'; |
$va = 'bottom'; |
} |
$y1=$ytop+$tl2;$y2=$ytop-$tl; |
$x1=$x2=$xt; |
} |
elseif( $a >= $ca2 && $a <= $ca3 ) { |
$yt = $pos + $w * $y/$x; |
$xt = $xleft - $margin; |
if( $rot90 ) { |
$ha = 'center'; |
$va = 'bottom'; |
} |
else { |
$ha = 'right'; |
$va = 'center'; |
} |
$x1=$xleft+$tl2;$x2=$xleft-$tl; |
$y1=$y2=$yt; |
} |
else { |
$xt = $x0 - $h * $x/$y; |
$yt = $ybottom + $margin; |
if( $rot90 ) { |
$ha = 'right'; |
$va = 'center'; |
} |
else { |
$ha = 'center'; |
$va = 'top'; |
} |
$y1=$ybottom-$tl2;$y2=$ybottom+$tl; |
$x1=$x2=$xt; |
} |
if( $a != 0 && $a != 180 ) { |
$t->Align($ha,$va); |
if( $this->scale->clockwise ) { |
$t->Set(360-$a); |
} |
else { |
$t->Set($a); |
} |
if( $this->show_angle_mark && $t->font_family > 4 ) { |
$a .= SymChar::Get('degree'); |
} |
$t->Stroke($this->img,$xt,$yt); |
if( $this->show_angle_tick ) { |
$this->img->Line($x1,$y1,$x2,$y2); |
} |
} |
$a += $this->angle_step; |
} |
} |
else { |
// POLAR_HALF |
$ca1 = atan($h/$w*2)/M_PI*180; |
$ca2 = 180-$ca1; |
$end = 180; |
while( $a < $end ) { |
$ca = cos($a/180*M_PI); |
$sa = sin($a/180*M_PI); |
$x = $d*$ca; |
$y = $d*$sa; |
if( $a <= $ca1 ) { |
$yt = $pos - $w * $y/$x; |
$xt = $xright + $margin; |
if( $rot90 ) { |
$ha = 'center'; |
$va = 'top'; |
} |
else { |
$ha = 'left'; |
$va = 'center'; |
} |
$x1=$xright-$tl2; $x2=$xright+$tl; |
$y1=$y2=$yt; |
} |
elseif( $a > $ca1 && $a < $ca2 ) { |
$xt = $x0 + 2*$h * $x/$y; |
$yt = $ytop - $margin; |
if( $rot90 ) { |
$ha = 'left'; |
$va = 'center'; |
} |
else { |
$ha = 'center'; |
$va = 'bottom'; |
} |
$y1=$ytop+$tl2;$y2=$ytop-$tl; |
$x1=$x2=$xt; |
} |
elseif( $a >= $ca2 ) { |
$yt = $pos + $w * $y/$x; |
$xt = $xleft - $margin; |
if( $rot90 ) { |
$ha = 'center'; |
$va = 'bottom'; |
} |
else { |
$ha = 'right'; |
$va = 'center'; |
} |
$x1=$xleft+$tl2;$x2=$xleft-$tl; |
$y1=$y2=$yt; |
} |
$t->Align($ha,$va); |
if( $this->show_angle_mark && $t->font_family > 4 ) { |
$a .= SymChar::Get('degree'); |
} |
$t->Set($a); |
$t->Stroke($this->img,$xt,$yt); |
if( $this->show_angle_tick ) { |
$this->img->Line($x1,$y1,$x2,$y2); |
} |
$a += $this->angle_step; |
} |
} |
} |
function Stroke($pos,$dummy=true) { |
$this->img->SetLineWeight($this->weight); |
$this->img->SetColor($this->color); |
$this->img->SetFont($this->font_family,$this->font_style,$this->font_size); |
if( !$this->hide_line ) { |
$this->img->FilledRectangle($this->img->left_margin,$pos, |
$this->img->width-$this->img->right_margin, |
$pos+$this->weight-1); |
} |
$y=$pos+$this->img->GetFontHeight()+$this->title_margin+$this->title->margin; |
if( $this->title_adjust=="high" ) { |
$this->title->SetPos($this->img->width-$this->img->right_margin,$y,"right","top"); |
} |
elseif( $this->title_adjust=="middle" || $this->title_adjust=="center" ) { |
$this->title->SetPos(($this->img->width-$this->img->left_margin-$this->img->right_margin)/2+$this->img->left_margin, |
$y,"center","top"); |
} |
elseif($this->title_adjust=="low") { |
$this->title->SetPos($this->img->left_margin,$y,"left","top"); |
} |
else { |
JpGraphError::RaiseL(17002,$this->title_adjust); |
//('Unknown alignment specified for X-axis title. ('.$this->title_adjust.')'); |
} |
if (!$this->hide_labels) { |
$this->StrokeLabels($pos,false); |
} |
$this->img->SetColor($this->radius_tick_color); |
$this->scale->ticks->Stroke($this->img,$this->scale,$pos); |
// |
// Mirror the positions for the left side of the scale |
// |
$mid = 2*($this->img->left_margin+$this->img->plotwidth/2); |
$n = count($this->scale->ticks->ticks_pos); |
$i=0; |
while( $i < $n ) { |
$this->scale->ticks->ticks_pos[$i] = |
$mid-$this->scale->ticks->ticks_pos[$i] ; |
++$i; |
} |
$n = count($this->scale->ticks->maj_ticks_pos); |
$i=0; |
while( $i < $n ) { |
$this->scale->ticks->maj_ticks_pos[$i] = |
$mid-$this->scale->ticks->maj_ticks_pos[$i] ; |
++$i; |
} |
$n = count($this->scale->ticks->maj_ticklabels_pos); |
$i=1; |
while( $i < $n ) { |
$this->scale->ticks->maj_ticklabels_pos[$i] = |
$mid-$this->scale->ticks->maj_ticklabels_pos[$i] ; |
++$i; |
} |
// Draw the left side of the scale |
$n = count($this->scale->ticks->ticks_pos); |
$yu = $pos - $this->scale->ticks->direction*$this->scale->ticks->GetMinTickAbsSize(); |
// Minor ticks |
if( ! $this->scale->ticks->supress_minor_tickmarks ) { |
$i=1; |
while( $i < $n/2 ) { |
$x = round($this->scale->ticks->ticks_pos[$i]) ; |
$this->img->Line($x,$pos,$x,$yu); |
++$i; |
} |
} |
$n = count($this->scale->ticks->maj_ticks_pos); |
$yu = $pos - $this->scale->ticks->direction*$this->scale->ticks->GetMajTickAbsSize(); |
// Major ticks |
if( ! $this->scale->ticks->supress_tickmarks ) { |
$i=1; |
while( $i < $n/2 ) { |
$x = round($this->scale->ticks->maj_ticks_pos[$i]) ; |
$this->img->Line($x,$pos,$x,$yu); |
++$i; |
} |
} |
if (!$this->hide_labels) { |
$this->StrokeLabels($pos,false); |
} |
$this->title->Stroke($this->img); |
} |
} |
class PolarScale extends LinearScale { |
private $graph; |
public $clockwise=false; |
function __construct($aMax,$graph,$aClockwise) { |
parent::__construct(0,$aMax,'x'); |
$this->graph = $graph; |
$this->clockwise = $aClockwise; |
} |
function SetClockwise($aFlg) { |
$this->clockwise = $aFlg; |
} |
function _Translate($v) { |
return parent::Translate($v); |
} |
function PTranslate($aAngle,$aRad) { |
$m = $this->scale[1]; |
$w = $this->graph->img->plotwidth/2; |
$aRad = $aRad/$m*$w; |
$a = $aAngle/180 * M_PI; |
if( $this->clockwise ) { |
$a = 2*M_PI-$a; |
} |
$x = cos($a) * $aRad; |
$y = sin($a) * $aRad; |
$x += $this->_Translate(0); |
if( $this->graph->iType == POLAR_360 ) { |
$y = ($this->graph->img->top_margin + $this->graph->img->plotheight/2) - $y; |
} |
else { |
$y = ($this->graph->img->top_margin + $this->graph->img->plotheight) - $y; |
} |
return array($x,$y); |
} |
} |
class PolarLogScale extends LogScale { |
private $graph; |
public $clockwise=false; |
function __construct($aMax,$graph,$aClockwise=false) { |
parent::__construct(0,$aMax,'x'); |
$this->graph = $graph; |
$this->ticks->SetLabelLogType(LOGLABELS_MAGNITUDE); |
$this->clockwise = $aClockwise; |
} |
function SetClockwise($aFlg) { |
$this->clockwise = $aFlg; |
} |
function PTranslate($aAngle,$aRad) { |
if( $aRad == 0 ) |
$aRad = 1; |
$aRad = log10($aRad); |
$m = $this->scale[1]; |
$w = $this->graph->img->plotwidth/2; |
$aRad = $aRad/$m*$w; |
$a = $aAngle/180 * M_PI; |
if( $this->clockwise ) { |
$a = 2*M_PI-$a; |
} |
$x = cos( $a ) * $aRad; |
$y = sin( $a ) * $aRad; |
$x += $w+$this->graph->img->left_margin;//$this->_Translate(0); |
if( $this->graph->iType == POLAR_360 ) { |
$y = ($this->graph->img->top_margin + $this->graph->img->plotheight/2) - $y; |
} |
else { |
$y = ($this->graph->img->top_margin + $this->graph->img->plotheight) - $y; |
} |
return array($x,$y); |
} |
} |
class PolarGraph extends Graph { |
public $scale; |
public $axis; |
public $iType=POLAR_360; |
private $iClockwise=false; |
function __construct($aWidth=300,$aHeight=200,$aCachedName="",$aTimeOut=0,$aInline=true) { |
parent::__construct($aWidth,$aHeight,$aCachedName,$aTimeOut,$aInline) ; |
$this->SetDensity(TICKD_DENSE); |
$this->SetBox(); |
$this->SetMarginColor('white'); |
} |
function SetDensity($aDense) { |
$this->SetTickDensity(TICKD_NORMAL,$aDense); |
} |
function SetClockwise($aFlg) { |
$this->scale->SetClockwise($aFlg); |
} |
function Set90AndMargin($lm=0,$rm=0,$tm=0,$bm=0) { |
$adj = ($this->img->height - $this->img->width)/2; |
$this->SetAngle(90); |
$lm2 = -$adj + ($lm-$rm+$tm+$bm)/2; |
$rm2 = -$adj + (-$lm+$rm+$tm+$bm)/2; |
$tm2 = $adj + ($tm-$bm+$lm+$rm)/2; |
$bm2 = $adj + (-$tm+$bm+$lm+$rm)/2; |
$this->SetMargin($lm2, $rm2, $tm2, $bm2); |
$this->axis->SetLabelAlign('right','center'); |
} |
function SetScale($aScale,$rmax=0,$dummy1=1,$dummy2=1,$dummy3=1) { |
if( $aScale == 'lin' ) { |
$this->scale = new PolarScale($rmax,$this,$this->iClockwise); |
} |
elseif( $aScale == 'log' ) { |
$this->scale = new PolarLogScale($rmax,$this,$this->iClockwise); |
} |
else { |
JpGraphError::RaiseL(17004);//('Unknown scale type for polar graph. Must be "lin" or "log"'); |
} |
$this->axis = new PolarAxis($this->img,$this->scale); |
$this->SetMargin(40,40,50,40); |
} |
function SetType($aType) { |
$this->iType = $aType; |
} |
function SetPlotSize($w,$h) { |
$this->SetMargin(($this->img->width-$w)/2,($this->img->width-$w)/2, |
($this->img->height-$h)/2,($this->img->height-$h)/2); |
} |
// Private methods |
function GetPlotsMax() { |
$n = count($this->plots); |
$m = $this->plots[0]->Max(); |
$i=1; |
while($i < $n) { |
$m = max($this->plots[$i]->Max(),$m); |
++$i; |
} |
return $m; |
} |
function Stroke($aStrokeFileName="") { |
// Start by adjusting the margin so that potential titles will fit. |
$this->AdjustMarginsForTitles(); |
// If the filename is the predefined value = '_csim_special_' |
// we assume that the call to stroke only needs to do enough |
// to correctly generate the CSIM maps. |
// We use this variable to skip things we don't strictly need |
// to do to generate the image map to improve performance |
// a best we can. Therefor you will see a lot of tests !$_csim in the |
// code below. |
$_csim = ($aStrokeFileName===_CSIM_SPECIALFILE); |
// We need to know if we have stroked the plot in the |
// GetCSIMareas. Otherwise the CSIM hasn't been generated |
// and in the case of GetCSIM called before stroke to generate |
// CSIM without storing an image to disk GetCSIM must call Stroke. |
$this->iHasStroked = true; |
//Check if we should autoscale axis |
if( !$this->scale->IsSpecified() && count($this->plots)>0 ) { |
$max = $this->GetPlotsMax(); |
$t1 = $this->img->plotwidth; |
$this->img->plotwidth /= 2; |
$t2 = $this->img->left_margin; |
$this->img->left_margin += $this->img->plotwidth+1; |
$this->scale->AutoScale($this->img,0,$max, |
$this->img->plotwidth/$this->xtick_factor/2); |
$this->img->plotwidth = $t1; |
$this->img->left_margin = $t2; |
} |
else { |
// The tick calculation will use the user suplied min/max values to determine |
// the ticks. If auto_ticks is false the exact user specifed min and max |
// values will be used for the scale. |
// If auto_ticks is true then the scale might be slightly adjusted |
// so that the min and max values falls on an even major step. |
//$min = 0; |
$max = $this->scale->scale[1]; |
$t1 = $this->img->plotwidth; |
$this->img->plotwidth /= 2; |
$t2 = $this->img->left_margin; |
$this->img->left_margin += $this->img->plotwidth+1; |
$this->scale->AutoScale($this->img,0,$max, |
$this->img->plotwidth/$this->xtick_factor/2); |
$this->img->plotwidth = $t1; |
$this->img->left_margin = $t2; |
} |
if( $this->iType == POLAR_180 ) { |
$pos = $this->img->height - $this->img->bottom_margin; |
} |
else { |
$pos = $this->img->plotheight/2 + $this->img->top_margin; |
} |
if( !$_csim ) { |
$this->StrokePlotArea(); |
} |
$this->iDoClipping = true; |
if( $this->iDoClipping ) { |
$oldimage = $this->img->CloneCanvasH(); |
} |
if( !$_csim ) { |
$this->axis->StrokeGrid($pos); |
} |
// Stroke all plots for Y1 axis |
for($i=0; $i < count($this->plots); ++$i) { |
$this->plots[$i]->Stroke($this->img,$this->scale); |
} |
if( $this->iDoClipping ) { |
// Clipping only supports graphs at 0 and 90 degrees |
if( $this->img->a == 0 ) { |
$this->img->CopyCanvasH($oldimage,$this->img->img, |
$this->img->left_margin,$this->img->top_margin, |
$this->img->left_margin,$this->img->top_margin, |
$this->img->plotwidth+1,$this->img->plotheight+1); |
} |
elseif( $this->img->a == 90 ) { |
$adj1 = round(($this->img->height - $this->img->width)/2); |
$adj2 = round(($this->img->width - $this->img->height)/2); |
$lm = $this->img->left_margin; |
$rm = $this->img->right_margin; |
$tm = $this->img->top_margin; |
$bm = $this->img->bottom_margin; |
$this->img->CopyCanvasH($oldimage,$this->img->img, |
$adj2 + round(($lm-$rm+$tm+$bm)/2), |
$adj1 + round(($tm-$bm+$lm+$rm)/2), |
$adj2 + round(($lm-$rm+$tm+$bm)/2), |
$adj1 + round(($tm-$bm+$lm+$rm)/2), |
$this->img->plotheight+1, |
$this->img->plotwidth+1); |
} |
$this->img->Destroy(); |
$this->img->SetCanvasH($oldimage); |
} |
if( !$_csim ) { |
$this->axis->Stroke($pos); |
$this->axis->StrokeAngleLabels($pos,$this->iType); |
} |
if( !$_csim ) { |
$this->StrokePlotBox(); |
$this->footer->Stroke($this->img); |
// The titles and legends never gets rotated so make sure |
// that the angle is 0 before stroking them |
$aa = $this->img->SetAngle(0); |
$this->StrokeTitles(); |
} |
for($i=0; $i < count($this->plots) ; ++$i ) { |
$this->plots[$i]->Legend($this); |
} |
$this->legend->Stroke($this->img); |
if( !$_csim ) { |
$this->StrokeTexts(); |
$this->img->SetAngle($aa); |
// Draw an outline around the image map |
if(_JPG_DEBUG) |
$this->DisplayClientSideaImageMapAreas(); |
// If the filename is given as the special "__handle" |
// then the image handler is returned and the image is NOT |
// streamed back |
if( $aStrokeFileName == _IMG_HANDLER ) { |
return $this->img->img; |
} |
else { |
// Finally stream the generated picture |
$this->cache->PutAndStream($this->img,$this->cache_name,$this->inline,$aStrokeFileName); |
} |
} |
} |
} |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/imgdata_stars.inc.php |
---|
New file |
0,0 → 1,144 |
<?php |
//======================================================================= |
// File: IMGDATA_STARS.INC |
// Description: Base64 encoded images for stars |
// Created: 2003-03-20 |
// Ver: $Id: imgdata_stars.inc.php 1106 2009-02-22 20:16:35Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
class ImgData_Stars extends ImgData { |
protected $name = 'Stars'; |
protected $an = array(MARK_IMG_STAR => 'imgdata'); |
protected $colors = array('bluegreen','lightblue','purple','blue','green','pink','red','yellow'); |
protected $index = array('bluegreen'=>3,'lightblue'=>4,'purple'=>1, |
'blue'=>5,'green'=>0,'pink'=>7,'red'=>2,'yellow'=>6); |
protected $maxidx = 7 ; |
protected $imgdata ; |
function __construct() { |
//========================================================== |
// File: bstar_green_001.png |
//========================================================== |
$this->imgdata[0][0]= 329 ; |
$this->imgdata[0][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAAUV'. |
'BMVEX///////+/v7+83rqcyY2Q/4R7/15y/1tp/05p/0lg/zdX'. |
'/zdX/zVV/zdO/zFJ9TFJvDFD4yg+8Bw+3iU68hwurhYotxYosx'. |
'YokBoTfwANgQFUp7DWAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgF'. |
'HUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJj'. |
'CRyxgTAAAAcUlEQVR4nH3MSw6AIAwEUBL/IKBWwXL/g0pLojUS'. |
'ZzGLl8ko9Zumhr5iy66/GH0dp49llNPB5sTotDY5PVuLG6tnM9'. |
'CVKSIe1joSgPsAKSuANNaENFQvTAGzmheSkUpMBWeJZwqBT8wo'. |
'hmysD4bnnPsC/x8ItUdGPfAAAAAASUVORK5CYII=' ; |
//========================================================== |
// File: bstar_blred.png |
//========================================================== |
$this->imgdata[1][0]= 325 ; |
$this->imgdata[1][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. |
'BMVEX///+/v79uRJ6jWPOSUtKrb+ejWO+gWPaGTruJTr6rZvF2'. |
'RqC2ocqdVuCeV+egV/GsnLuIXL66rMSpcOyATbipY/OdWOp+VK'. |
'aTU9WhV+yJKBoLAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. |
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJwynv1'. |
'XVAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. |
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. |
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. |
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; |
//========================================================== |
// File: bstar_red_001.png |
//========================================================== |
$this->imgdata[2][0]= 325 ; |
$this->imgdata[2][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. |
'BMVEX///+/v7+eRFHzWG3SUmHnb37vWGr2WHG7Tlm+TljxZneg'. |
'Rk3KoaXgVmXnV2nxV227nJ++XGzErK3scIS4TVzzY3fqWG2mVF'. |
'zVU2PsV2rJFw9VAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. |
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJzCI0C'. |
'lSAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. |
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. |
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. |
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; |
//========================================================== |
// File: bstar_blgr_001.png |
//========================================================== |
$this->imgdata[3][0]= 325 ; |
$this->imgdata[3][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. |
'BMVEX///+/v79Ehp5Yx/NSq9Jvw+dYwu9YzfZOmbtOmb5myPFG'. |
'gqChvcpWteBXvedXxvGcsbtcpb6su8RwzOxNmrhjyvNYwupUjK'. |
'ZTr9VXwOyJhmWNAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. |
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJTC65k'. |
'vQAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. |
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. |
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. |
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; |
//========================================================== |
// File: bstar_blgr_002.png |
//========================================================== |
$this->imgdata[4][0]= 325 ; |
$this->imgdata[4][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. |
'BMVEX///+/v79EnpxY8/FS0dJv5+dY7+9Y9vBOubtOur5m8fFG'. |
'nKChycpW3uBX5+ZX8e2curtcvrqswsRw7OdNuLZj8/BY6udUpK'. |
'ZT1dRX7OtNkrW5AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. |
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJgXHeN'. |
'wwAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. |
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. |
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. |
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; |
//========================================================== |
// File: bstar_blue_001.png |
//========================================================== |
$this->imgdata[5][0]= 325 ; |
$this->imgdata[5][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. |
'BMVEX///+/v79EY55Yi/NSetJvledYiO9YkPZOb7tObr5mkvFG'. |
'X6ChrcpWgOBXhedXi/Gcpbtcf76sssRwnOxNcbhjk/NYiepUbK'. |
'ZTfdVXh+ynNEzzAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. |
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJhStyP'. |
'zCAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. |
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. |
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. |
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; |
//========================================================== |
// File: bstar_oy_007.png |
//========================================================== |
$this->imgdata[6][0]= 325 ; |
$this->imgdata[6][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. |
'BMVEX///+/v7+ejUTz11jSvVLn02/v1lj21li7q06+r07x2mag'. |
'lUbKxKHgy1bnz1fx1Ve7t5y+qlzEwqzs03C4pE3z2WPqz1imml'. |
'TVv1Ps01dGRjeyAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. |
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJjsGGc'. |
'GbAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. |
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. |
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. |
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; |
//========================================================== |
// File: bstar_lred.png |
//========================================================== |
$this->imgdata[7][0]= 325 ; |
$this->imgdata[7][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'. |
'BMVEX///+/v7+eRJPzWN3SUr7nb9TvWNj2WOS7Tqi+TqnxZtyg'. |
'Ro/KocPgVsjnV9LxV927nLa+XLTErL7scN24TarzY9/qWNemVJ'. |
'jVU8LsV9VCwcc9AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. |
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJxi9ZY'. |
'GoAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'. |
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'. |
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'. |
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ; |
} |
} |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/imgdata_balls.inc.php |
---|
New file |
0,0 → 1,1061 |
<?php |
//======================================================================= |
// File: IMGDATA_ROUNDBALLS.INC |
// Description: Base64 encoded images for small round markers |
// Created: 2003-03-20 |
// Ver: $Id: imgdata_balls.inc.php 1106 2009-02-22 20:16:35Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
class ImgData_Balls extends ImgData { |
protected $name = 'Round Balls'; |
protected $an = array(MARK_IMG_LBALL => 'imgdata_large', |
MARK_IMG_MBALL => 'imgdata_small', |
MARK_IMG_SBALL => 'imgdata_xsmall', |
MARK_IMG_BALL => 'imgdata_xsmall'); |
protected $colors,$index,$maxidx; |
private $colors_1 = array('blue','lightblue','brown','darkgreen', |
'green','purple','red','gray','yellow','silver','gray'); |
private $index_1 = array('blue'=>9,'lightblue'=>1,'brown'=>6,'darkgreen'=>7, |
'green'=>8,'purple'=>4,'red'=>0,'gray'=>5,'silver'=>3,'yellow'=>2); |
private $maxidx_1 = 9 ; |
private $colors_2 = array('blue','bluegreen','brown','cyan', |
'darkgray','greengray','gray','green', |
'greenblue','lightblue','lightred', |
'purple','red','white','yellow'); |
private $index_2 = array('blue'=>9,'bluegreen'=>13,'brown'=>8,'cyan'=>12, |
'darkgray'=>5,'greengray'=>6,'gray'=>2,'green'=>10, |
'greenblue'=>3,'lightblue'=>1,'lightred'=>14, |
'purple'=>7,'red'=>0,'white'=>11,'yellow'=>4); |
private $maxidx_2 = 14 ; |
private $colors_3 = array('bluegreen','cyan','darkgray','greengray', |
'gray','graypurple','green','greenblue','lightblue', |
'lightred','navy','orange','purple','red','yellow'); |
private $index_3 = array('bluegreen'=>1,'cyan'=>11,'darkgray'=>14,'greengray'=>10, |
'gray'=>3,'graypurple'=>4,'green'=>9,'greenblue'=>7, |
'lightblue'=>13,'lightred'=>0,'navy'=>2,'orange'=>12, |
'purple'=>8,'red'=>5,'yellow'=>6); |
private $maxidx_3 = 14 ; |
protected $imgdata_large, $imgdata_small, $imgdata_xsmall ; |
function GetImg($aMark,$aIdx) { |
switch( $aMark ) { |
case MARK_IMG_SBALL: |
case MARK_IMG_BALL: |
$this->colors = $this->colors_3; |
$this->index = $this->index_3 ; |
$this->maxidx = $this->maxidx_3 ; |
break; |
case MARK_IMG_MBALL: |
$this->colors = $this->colors_2; |
$this->index = $this->index_2 ; |
$this->maxidx = $this->maxidx_2 ; |
break; |
default: |
$this->colors = $this->colors_1; |
$this->index = $this->index_1 ; |
$this->maxidx = $this->maxidx_1 ; |
break; |
} |
return parent::GetImg($aMark,$aIdx); |
} |
function __construct() { |
//========================================================== |
// File: bl_red.png |
//========================================================== |
$this->imgdata_large[0][0]= 1072 ; |
$this->imgdata_large[0][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAAByF'. |
'BMVEX/////////xsb/vb3/lIz/hIT/e3v/c3P/c2v/a2v/Y2P/'. |
'UlL/Skr/SkL/Qjn/MTH/MSn/KSn/ISH/IRj/GBj/GBD/EBD/EA'. |
'j/CAj/CAD/AAD3QkL3MTH3KSn3KSH3GBj3EBD3CAj3AAD1zMzv'. |
'QkLvISHvIRjvGBjvEBDvEAjvAADnUlLnSkrnMTnnKSnnIRjnGB'. |
'DnEBDnCAjnAADec3PeSkreISHeGBjeGBDeEAjWhITWa2vWUlLW'. |
'SkrWISnWGBjWEBDWEAjWCAjWAADOnp7Oa2vOGCHOGBjOGBDOEB'. |
'DOCAjOAADJrq7Gt7fGGBjGEBDGCAjGAADEpKS/v7+9QkK9GBC9'. |
'EBC9CAi9AAC1e3u1a2u1Skq1KSm1EBC1CAi1AACtEBCtCBCtCA'. |
'itAACngYGlCAilAACghIScOTmcCAicAACYgYGUGAiUCAiUAAiU'. |
'AACMKSmMEACMAACEa2uEGAiEAAB7GBh7CAB7AABzOTlzGBBzCA'. |
'BzAABrSkprOTlrGBhrAABjOTljAABaQkJaOTlaCABaAABSKSlS'. |
'GBhSAABKKSlKGBhKAABCGBhCCABCAAA5CAA5AAAxCAAxAAApCA'. |
'ApAAAhAAAYAACc9eRyAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgF'. |
'HUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkRFD'. |
'UHLytKAAAB4UlEQVR4nGNgIAK4mGjrmNq6BmFIWMmISUpKSmk5'. |
'B8ZEokj4qoiLiQCBgqald3xaBpKMj6y4sLCQkJCIvIaFV0RaUR'. |
'lCSk5cWEiAn19ASN7QwisuraihHiajKyEixM/NwckjoKrvEACU'. |
'qumpg7pAUlREiJdNmZmLT9/cMzwps7Smc3I2WEpGUkxYkJuFiY'. |
'lTxszePzY1v7Shc2oX2D+K4iLCgjzsrOw8embuYUmZeTVtPVOn'. |
'gqSslYAOF+Ln4ZHWtXMPTcjMrWno7J82rRgoZWOsqaCgrqaqqm'. |
'fn5peQmlsK1DR52vRaoFSIs5GRoYG5ub27n19CYm5pdVPnxKnT'. |
'pjWDpLydnZwcHTz8QxMSEnJLgDL9U6dNnQ6Sio4PDAgICA+PTU'. |
'zNzSkph8hADIxKS46Pj0tKTc3MLSksqWrtmQySAjuDIT8rKy0r'. |
'Kz+vtLSmur6jb9JUIJgGdjxDQUVRUVFpaUVNQ1NrZ9+kKVOmTZ'. |
'k6vR0sldJUAwQNTU2dnX0TgOJTQLrSIYFY2dPW1NbW2TNxwtQp'. |
'U6ZMmjJt2rRGWNB3TO7vnzh5MsgSoB6gy7sREdY7bRrQEDAGOb'. |
'wXOQW0TJsOEpwClmxBTTbZ7UDVIPkp7dkYaYqhuLa5trYYUxwL'. |
'AADzm6uekAAcXAAAAABJRU5ErkJggg==' ; |
//========================================================== |
// File: bl_bluegreen.png |
//========================================================== |
$this->imgdata_large[1][0]= 1368 ; |
$this->imgdata_large[1][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABm'. |
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. |
'B3RJTUUH0wMMFi8hE9b2uAAABOVJREFUeNq9lk2sJFUVx3+3qv'. |
'tW95t57zFvhiFxmCFRUJRoNCQiJARMhiFx/Igxii5goTG6ZDAu'. |
'/EhcSCIrTAgLEiKsJ8ywABNZEMJXEDYCukAmjgjzBkK/j35V1d'. |
'333FtV97io97pfzwxfG86qcu/N+Z3zP+fcW/Apmfk4hx57+R/6'. |
'Rqmc9ykhsWjlsUngAA1fXIQ7b73pI/186IGHnn9dH/8frC8v4I'. |
'PiG53uaerR4GmKkv31mB8cyfjd946ZTwR66qVX9OTWIi8UKUv9'. |
'BOrZXpYZvFeiBvzI0fgSUSFKwbVG+Pl1V3HH0VvNR4KeeukV/f'. |
'PmMmdHhst76aXD64AbeVQ9bjNHaiGOC2o3wLrAb2/4LL/84ffn'. |
'fCdzkOdayKpLppBemrBsU5Y1Zdmm9LJdGU6E/t4M24Q26jRDRL'. |
'j3mdc49cSTekFsMzs5XuTsyLDUNSDQ25NwKOly9YIl22MYhJr/'. |
'uoDtBBoT0CxBRGYOAhibIaOCe//2MpfM6KHnX9cXipSlbkKWmS'. |
'nk9iv38J0jixw7vJfrTMYBOvhSoQHJBS09ANELloAGDxW8tfoW'. |
'J+5/UC8CPS0LU7r3SpYarr7M8rmFjMPLXT6/33L4si7Z2GCrQC'. |
'+0ctlOaNs9DReV8vSLr85ndPLpZ/WNvHW+01kAVFBOGvJx0wYg'. |
'Sp47RIQ4Emwa8FGJXlDxSCFo5YlVgAo2hwPue/hRndboTV3EW2'. |
'Wp3k6wBp8q56QiWzecW6vwQfnPRkAWhFgILnq08jQ+R2nlUzzN'. |
'uES9Q7Vd+9fba7NmWJW61db2247qACmcjxXr45psYphsFGSLBu'. |
'kIajxqtjNwHkvAjQt0sg3crhPA2+fPz0CuyNFOghsGsr19mnFg'. |
'DGwrRm8UoAtNmQPQtRXDgdC4HImCFEKcCE0oieUWUYq2LtbiGp'. |
'mBQmppfIkjw45DK0QNNkvQ0jMBtPL0UnDRM1rN+cxKwzvOo2NP'. |
'tykR9a1kfpZNDLMG6QDYJqCTBvUe1+uxs+YKyPoGrTwY2HhvC4'. |
'CDWQd5d4xNApNQEEMgjgLdUCLBQ5cprL/trwNwKG2IUmDqDFd5'. |
'sr5BWrlxuSdLDFEFlqAzXGc4zFjupqh6uqYihpxJcEgp026l2w'. |
'7wFUv7Z6AvrfRo/n0OYzPwIKE3HUKAJg2otMBiElnsF7wngis9'. |
'3ZDjNnLi7huCWUZfueZKTu/M0V3HvmkOFDVxVKDG04ScejSgW5'. |
'V0q5JYFEghuDLHlTmToqDeGOCKIVtrW9hsdmXufEcNLPSXuPHa'. |
'a+bvuh9df5AH/v5PDFmbWQC3Mx+TVvfGVTRB2CodNgT2JBX003'. |
'aANZAYS/BxCv32TV/l2C03G7jgmfjGiT/qmeEmibEYm7XzAO2k'. |
'A+pbgHhBgydqu54YO5eRiLCy7yDvPP6Xqf+5Z+Lu277OYuOpiw'. |
'H15oBmlNOMcmK5RbP+PrEscGU+DSAxdg4CICIkxnLP8aNz63Og'. |
'H3/rdvOb795GVhuaYo0oBc3GGrEsUPVTwO6a7LYd+X51x3Hu/t'. |
'lP5tS65FN+6okn9U+n/sqb596dTvhOF+02myXTmkQNrOw7yD3H'. |
'j14E+UDQjp24/0E9/eKrbA4HH3aMK1b2ccvXvswjv//1J/s5ud'. |
'Due/hRPfP+OmfOrk7vrn7a48ihA3zh8CH+8Iuffiw/n4r9H1ZZ'. |
'0zz7G56hAAAAAElFTkSuQmCC' ; |
//========================================================== |
// File: bl_yellow.png |
//========================================================== |
$this->imgdata_large[2][0]= 1101 ; |
$this->imgdata_large[2][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAAB2l'. |
'BMVEX//////////+///+f//9b//8b//73//7X//63//6X//5T/'. |
'/4z//4T//3P//2v//1r//0r//0L//zH//yn//yH//xj//xD//w'. |
'j//wD/90L/9zn/9zH/9xj/9xD/9wj/9wD39yn37zn37zH37yH3'. |
'7xD37wj37wDv70Lv50rv50Lv5znv5yHv5xjv5wjv5wDn51Ln5x'. |
'Dn3jHn3iHn3hjn3hDn3gje3oze3nPe3lLe1oze1nPe1lLe1ine'. |
'1iHe1hje1hDe1gje1gDW1qXW1mvWzqXWzkLWzhjWzhDWzgjWzg'. |
'DOzrXOzq3OzpzOzgDOxkrOxinOxhjOxhDOxgjOxgDGxqXGxnvG'. |
'xmvGvRjGvRDGvQjGvQDFxbnAvr6/v7+9vaW9vZS9vQi9vQC9tR'. |
'C9tQi9tQC7u7W1tZS1tXu1tTG1tQi1rRC1rQi1rQCtrYytrSGt'. |
'rQitrQCtpYStpSGtpQitpQClpYSlpXulpQClnBClnAilnACcnG'. |
'ucnAicnACclAiclACUlFqUlCmUlAiUlACUjFKUjAiUjACMjFKM'. |
'jEqMjACMhACEhACEewB7ezF7exB7ewB7cwBzcylzcwBzaxBzaw'. |
'BraxhrawhrawBrYxBrYwBjYwBjWgBaWgBaUgCXBwRMAAAAAXRS'. |
'TlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAd'. |
'LdfvwAAAAHdElNRQfTAwkRFBKiJZ4hAAAB7ElEQVR4nI3S+1vS'. |
'UBgHcB67WJmIMWAVdDHEDLBC6Go0slj3Ft0m9RRBWQEmFZFDEM'. |
'Qgt0EMFBY7p/+198hj1kM/9N1+++x73rOd6XT/kStnTx4fPzd9'. |
'uwfOjFhomj7smAhwj/6Cm2O0xUwy6g7cCL99uCW3jtBmE7lsdr'. |
'fvejgpzP7uEDFRRoqy2k8xQPnypo2BUMP6waF9Vpf3ciiSzErL'. |
'XTkPc0zDe3bsHDAcc00yoVgqL3UWN2iENpspff+2vn6D0+NnZ9'. |
'6lC5K6RuSqBTZn1O/a3rd7v/MSez+WyIpVFX8GuuCA9SjD4N6B'. |
'oRNTfo5PCAVR0fBXoIuOQzab1XjwwNHx00GOj8/nKtV1DdeArk'. |
'24R+0ul9PjmbrHPYl+EipyU0OoQSjg8/m83kl/MMhx0fjCkqio'. |
'SMOE7t4JMAzDsizH81AqSdW2hroLPg4/CEF4PhKNx98vlevrbY'. |
'QQXgV6kXwVfjkTiSXmhYVcSa7DIE1DOENe7GM6lUym0l+EXKks'. |
'K20VAeH2M0JvVgrZfL5Qqkiy0lRVaMBd7H7EZUmsiJJcrTdVja'. |
'wGpdbTLj3/3qwrUOjAfGgg4LnNA5tdQx14Hm00QFBm65hfNzAm'. |
'+yIFhFtzuj+z2MI/MQn6Uez5pz4Ua41G7VumB/6RX4zMr1TKBr'. |
'SXAAAAAElFTkSuQmCC' ; |
//========================================================== |
// File: bl_silver.png |
//========================================================== |
$this->imgdata_large[3][0]= 1481 ; |
$this->imgdata_large[3][1]= |
'iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAMAAAAM7l6QAAADAF'. |
'BMVEUAAADOzs7Gxsa9vb21tbXOxsbOzsbGzsb3///O1ta1vb2c'. |
'paVSWlpKWlpSY2ve5+97hIze7/9aY2vO5/9zhJRaa3tSY3PGzt'. |
'aMlJxrc3tja3NKUlpCSlK1vcZze4RSWmPW5/+Upb3G3v9zhJxS'. |
'Y3t7jKVaa4TO3veltc6ElK1re5Rjc4ycpbV7hJRaY3M5QlLn7/'. |
'/Gzt6lrb2EjJzO3v9ja3vG1ve9zu+1xueltdacrc6UpcaMnL1C'. |
'SlqElLV7jK1zhKVre5zW3u/O1ue1vc6ttcaMlKVze4xrc4RSWm'. |
'tKUmPG1v+9zve1xu+tveeltd6crdbe5/+9xt6cpb17hJxaY3s5'. |
'QlrW3vfO1u/Gzue1vdattc6lrcaUnLWMlK2EjKVze5Rrc4xja4'. |
'RSWnNKUmtCSmO9xuecpcZ7hKVaY4TW3v/O1vfGzu+1vd6ttdal'. |
'rc69xu+UnL2MlLWEjK1ze5xrc5R7hK1ja4zO1v+1veettd6lrd'. |
'aMlL3Gzv/39//W1t7Gxs61tb29vcatrbWlpa2cnKWUlJyEhIx7'. |
'e4TW1ufGxta1tcZSUlqcnK3W1u+UlKW9vda1tc57e4ytrcalpb'. |
'1ra3vOzu9jY3OUlK29vd6MjKWEhJxaWmtSUmNzc4xKSlpjY3tK'. |
'SmNCQlqUjJzOxs7///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. |
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. |
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. |
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. |
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. |
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. |
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'. |
'AAAAAAAAAAAAAAAAAAAAAAAAD///9fnkWVAAAAAnRSTlP/AOW3'. |
'MEoAAAABYktHRP+lB/LFAAAACXBIWXMAAABFAAAARQBP+QatAA'. |
'AB/klEQVR42mNgxAsYqCdd3+lcb4hLmj8wMMvEu8DCMqYbU9op'. |
'UEFB2MTb26eyysomFl06XEEhUCHLpAKo2z/fujikEUVaXUFBMB'. |
'BouLePuV+VVWGRciIXknSEsImCQd3//xwmPr65llaFcSFJHkjS'. |
'3iYmWUDZ//8NfCr989NjNUMSUyTg0jneSiaCINn/gmlVQM12qg'. |
'lJnp5waTMTE5NAkCyHWZW/lXWNfUlikmdYK0zax7siS4EDKJtd'. |
'mQeU1XRwLBdLkRGASucWmGVnZ4dnhZvn5lmm29iVOWpnJqcuko'. |
'JKR1Wm5eTkRKYF5eblp9sU2ZeUJiV7zbfVg0pH56UFBQXNjIqK'. |
'jgkujItX1koKTVmYajsdKu2qETVhwgSXiUDZ2Bn9xqUeoZ5e0t'. |
'LzYYZ3B092ndjtOnmKTmycW1s7SHa+l5dtB8zlccE6RlN0dGbM'. |
'mDVbd5KupNBcL6+F82XgHouLj5vRP2PWLGNdd4+ppnxe8tJec6'. |
'XnNsKkm0uVQ5RDRHQTPTym68nPlZbvkfYCexsa5rpJ2qXa5Umm'. |
'ocmec3m8vHjmSs+fgxyhC5JDQ8WSPT2lvbzm8vDIe0nbtiBLN8'. |
'8BigNdu1B6Lsje+fPbUFMLi5TMfGmvHi/puUAv23q2YCTFNqH5'. |
'MvPnSwPh3HasCbm3XUpv+nS5VtrkEkwAANSTpGHdye9PAAAASn'. |
'RFWHRzaWduYXR1cmUANGJkODkyYmE4MWZhNTk4MTIyNDJjNjUx'. |
'NzZhY2UxMDAzOGFhZjdhZWIyNzliNTM2ZGFmZDlkM2RiNDU3Zm'. |
'NlNT9CliMAAAAASUVORK5CYII=' ; |
//========================================================== |
// File: bl_purple.png |
//========================================================== |
$this->imgdata_large[4][0]= 1149 ; |
$this->imgdata_large[4][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAACAV'. |
'BMVEX/////////7///5///1v//xv//rf//pf//lP//jP//hP//'. |
'c///a///Wv//Wvf/Uv//Sv//Qv//Qvf/Off/Mf//Kf//If//If'. |
'f/GP//GPf/EP//EPf/CP//CPf/CO//AP//APf3Oe/3Kff3Ke/3'. |
'Ie/3GO/3EO/3AO/vSu/vSufvOefvMefvIefvGOfvEOfvCOfvAO'. |
'fnUufnSufnMd7nId7nGN7nGNbnEN7nCN7nAN7ejN7ejNbec97e'. |
'c9beUtbeQtbeIdbeGNbeENbeCNbeANbWpdbWa9bWQs7WGM7WEM'. |
'7WCM7WAM7Otc7Orc7OnM7OSsbOIb3OGMbOEMbOCMbOAM7OAMbG'. |
'pcbGnMbGe8bGa8bGKbXGEL3GCL3GAL3FucXBu73AvsC/v7+9pb'. |
'29Ka29GLW9ELW9CLW9AL29ALW5rrm1lLW1e7W1MbW1GKW1EK21'. |
'CLW1CK21AK2tjK2thKWtMaWtIaWtGJytCK2tCKWtAK2tAKWlhK'. |
'Wle6WlEJylCJylAKWlAJyca5ycGJScEJScCJScAJycAJSUWpSU'. |
'UoyUKZSUEIyUCIyUAJSUAIyMUoyMSoyMIYSMEISMCISMAIyMAI'. |
'SECHuEAISEAHt7MXt7EHt7CHt7AHt7AHNzKXNzEGtzAHNzAGtr'. |
'GGtrEGNrCGtrAGtrAGNjCFpjAGNjAFpaAFpaAFIpZn4bAAAAAX'. |
'RSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsS'. |
'AdLdfvwAAAAHdElNRQfTAwkRFB0ymoOwAAAB9UlEQVR4nGNgIA'. |
'K42hhqGtm5+WFIWClKycvLK6gbuARGoEj4aMjLSElISUir6Tt7'. |
'x+aEIWR8leQlwEBSTc/CK7awLguuR0lGQkJMVFRUTFJVzwko1d'. |
'oFk9OQl5IQE+Dh5hVR0TV3CkkvbJgyASJjDZIR5GBl5eRX0TH1'. |
'DEqrbJ2ypBEspSgvJSXKw8bMxMavbOLoGZNf1TZlybw4oIyfLN'. |
'BxotxsLEzsQiaOHkFpBQ2905esrAZK2SpIAaUEuDm5+LTNPAKj'. |
'C+pbps1evrIDKGWnLictKSkuLKyoZQyUya9o7Z2+YMXKGUApew'. |
'M9PTVdXR0TEwf3wOjUirruafOXL18xFyjl72Kpb25qaurg4REU'. |
'EFVe2zJ5zpLlK1aCpbydnZ2dnDwDA6NTopLLeiZNXbB8BcTAyP'. |
'TQ0JDg4KCY1NS83JKmiVOBepYvX9UPlAovzEiPSU/LLyior2vq'. |
'mjZr3vLlIF01IC+XVhUWFlZW1Lc290ycOGfxohVATSsXx4Oksn'. |
'vaWlsb2tq6J0+bM2/RohVA81asbIcEYueU3t7JU6ZNnwNyGkhm'. |
'+cp5CRCppJnzZ8+ZM3/JUogECBbBIixr8Yqly8FCy8F6ltUgoj'. |
'lz7sqVK2ByK+cVMSCDxoUrwWDVysXt8WhJKqG4Y8bcuTP6qrGk'. |
'QwwAABiMu7T4HMi4AAAAAElFTkSuQmCC' ; |
//========================================================== |
// File: bl_gray.png |
//========================================================== |
$this->imgdata_large[5][0]= 905 ; |
$this->imgdata_large[5][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAABO1'. |
'BMVEX////////3///39/fv7+/e5+fW3t7Wzs7WxsbG1tbGzsbG'. |
'xsbDxMS/v7++wMC+v7+9zsa9xsa9vb29tbW9ra29pa24uLi1xs'. |
'a1vb21tbWxtrattbWmpqalra2cra2cpaWcnJycjIyUpaWUnJyU'. |
'lJSUjIyMnJyMnJSMlJSMlIyMjJSMjIyElJSElIyEjIyEhIR7jI'. |
'x7hIR7hHt7e3t7e3N7e2tzhIRze3tze3Nzc3Nre3trc3Nrc2tr'. |
'a2tjc3Njc2tja3Nja2tjY2NjWlpaa2taY2taY2NaY1paWlpaUl'. |
'JSY2NSY1pSWlpSWlJSUlJSUkpKWlpKWlJKUlpKUlJKUkpKSkpK'. |
'SkJCUlJCUkJCSkpCSkJCQkI5Sko5QkI5Qjk5OUI5OTkxQkIxOT'. |
'kxMTkxMTEpMTEhMTEhKSkYISEpy7AFAAAAAXRSTlMAQObYZgAA'. |
'AAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdE'. |
'lNRQfTAwkRFQfW40uLAAABx0lEQVR4nI3SbXfSMBQA4NV3nce5'. |
'TecAHUywRMHSgFuBCFsQUqwBS1OsWQh0GTj//y8wZUzdwQ/efM'. |
'tzcm/uuXdj4z9ic/PR9k4qk1qDnf0X2/uZzKt8GaRvSubg4LVp'. |
'mkWzCGAT/i3Zsm2XNQHLsm2n2937LaaNnGoJFAEo27B50qN0ay'. |
'Wg26lXsw8fP8nmzcJb2CbsnF5JmmCE8ncN404KvLfsYwd7/MdV'. |
'Pdgl/VbKMIzbuwVgVZw2JlSKJTVJ3609vWUY957lgAUd1KNcqr'. |
'yWnOcOPn8q7d5/8PywAqsOOiVDrn42NFk+HQ7dVuXNYeFdBTpN'. |
'nY5JdZl8xI5Y+HXYaTVqEDp1hAnRohZM03EUjMdhn5wghOoNnD'. |
'wSK7KiiDPqEtz+iD4ctdyAifNYzUnScBSxwPd6GLfRURW7Ay5i'. |
'pS5bmrY8348C5vvUI+TLiIVSJrVA0heK/GDkJxYMRoyfCSmk4s'. |
'uWc3yic/oBo4yF374LGQs5Xw0GyQljI8bYmEsxVUoKxa6HMpAT'. |
'vgyhU2mR8uU1pXmsa8ezqb6U4mwWF/5MeY8uLtQ0nmmQ8UWYvb'. |
'EcJaYWar7QhztrO5Wr4Q4hDbAG/4hfTAF2iCiWrCEAAAAASUVO'. |
'RK5CYII=' ; |
//========================================================== |
// File: bl_brown.png |
//========================================================== |
$this->imgdata_large[6][0]= 1053 ; |
$this->imgdata_large[6][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAABoV'. |
'BMVEX////Gzs7GvbXGrZTGpXu9nHO1nHO1nIy9taXGxs7GtaXO'. |
'nHPGlFrGjEq9hEq1hEqte0Klczmcazmce1KtnIzGxsbGvb3OlF'. |
'LOlFq9hFKte0qcc0KUYzGEWimMc1K9ta3OnGvOnGPWnGO9jFq9'. |
'jFKlc0KUazmMYzl7UilzUjGtpZzGxr3GnGPWpWvepXO1hFJ7Wj'. |
'FrSiFjUjG1ra3GnHPvxpT/5733zpythFKUa0KEYzlzUilaOSF7'. |
'Wjm9jErvvYz/99b///f/78bnrYS1hFqle0p7UjFrSiljQiFCMR'. |
'iMhHO9lGvGjFLWnGv/3q3////erXuthEqlc0paQiFKMRhSQin/'. |
'1qX/997//++cc0pjSilaQilKORhCKRiclIy9pYzGlGPntYT33q'. |
'3vvZSEWjlSOSE5KRB7c2O1lHutczmthFqte1JrWkqtjGtCKRBa'. |
'SjmljGuca0KMYzGMaznOztaclISUYzmEWjFKOSF7a1qEYzFaSi'. |
'GUjISEa0pKOSm9vb2llIxaQhg5IQiEc2tzY0paORilnJy1raVS'. |
'OSljUkJjWkKTpvQWAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHU'. |
'gAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkREiei'. |
'zP2EAAAB9UlEQVR4nGWS/VfSUBjHL5QluhhBxtwyWcCus5Blpm'. |
'wDC4ONaWXCyBi7RMZmpQ2Bypm9W/byV3cHHo/W88s95/s5z/d5'. |
'uwCcCh/4L3zAf+bs0NC588On9QAYGSUuBINk6GI4cmnsBLk8Go'. |
'1SFEGMkzRzZeLq5JE8FvDHouw1lqXiCZJOcnCKnx4AcP0GBqmZ'. |
'mRgRT9MMB4Wbs7cGSXNRik3dnp9fiMUzNCNKgpzN9bsaWaQo9s'. |
'7dfH7pXiFTZCBU1JK27LmtBO8TDx7mV1eXHqXXyiIUFLWiVzHx'. |
'BxcJIvV4/cn6wkqmWOOwmVE3UQOAp6HxRKL5bGPj+VwhUhalFq'. |
'8alm5vAt+LlySZTsebzcKrraIIW4JqZC3N3ga+1+EQTZKZta1M'. |
'pCZCSeDViqVrThsEdsLJZLJYLpZrHVGScrKBvTQNtQHY6XIM02'. |
'E6Ik7odRW1Dzy3N28n3kGuB3tQagm7UMBFXI/sATAs7L5vdbEs'. |
'8Lycm923NB0j5wMe6KOsKIIyxcuqauxbrmlqyEWfPmPy5assY1'. |
'U1SvWKZWom9nK/HfQ3+v2HYZSMStayTNN0PYKqg11P1nWsWq7u'. |
'4gJeY8g9PLrddNXRdW8Iryv86I3ja/9s26gvukhDdvUQnIjlKr'. |
'IdZCNH+3Xw779qbG63f//ZOzb6C4+ofdbzERrSAAAAAElFTkSu'. |
'QmCC' ; |
//========================================================== |
// File: bl_darkgreen.png |
//========================================================== |
$this->imgdata_large[7][0]= 1113 ; |
$this->imgdata_large[7][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAAB2l'. |
'BMVEX////////3///v///n/+/e99bW/+/W99bO786/v7++vr69'. |
'/96999a7wb24vbu1/9a1zqW1u7itxrWosq6l772l1qWlxrWlxq'. |
'2lva2cxpSU562U3q2UxqWUvaWUpZyM77WM57WMvYyMtZyMrZyM'. |
'pZSMnJSEvZyEtYyErZSElIx7zpR7xpx7xpR7vZR7jIRz1pRzxp'. |
'RzjIRrzpRrzoxrxoxrtYRrrYxrrXtrpYRrhHNjzoxjxoxjxoRj'. |
'vYRjtYRjrXtjpXtjlGNje2tazoxazoRaxoxaxoRavYRatYRatX'. |
'tarXtapXNanHNajFpae2tSzoRSxoRSvXtStXtSrXtSrXNSpXNS'. |
'nHNSnGtSlGtSlGNSjGtSjGNKvXtKtXNKrXNKpWtKnGtKlGNKjG'. |
'NKhGNKhFJKc1pKa1JCrWtCpWtCnGtClGNCjGNCjFpChFpCe1JC'. |
'a1JCY1I5pWs5nGM5lGM5jFo5hFo5e1o5c0o5WkoxjFoxhFoxhF'. |
'Ixe1Ixc1Ixc0oxa0ophFIpe0opc0opa0opa0IpY0IpWkIpWjkp'. |
'UkIpUjkhc0oha0IhY0IhWjkhWjEhUjkhUjEhSjEhSikhQjEhQi'. |
'kYWjkYSjEYSikYQjEYQikQSikQQikQQiEQOSExf8saAAAAAXRS'. |
'TlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAd'. |
'LdfvwAAAAHdElNRQfTAwkRFCaDkWqUAAAB+ElEQVR4nI3S+1vS'. |
'UBgHcGZlPV0ks/vFrmQWFimJjiwiYUJWjFBWFhClyZCy5hLrwA'. |
'x2EIwJC1w7zf2vnU0re+iHvs9++7x7zznvORbLf+TA6ct9fYMX'. |
'jrfAUYefpp+/iM1ykxf/lmuhUZ/PTwXC8dml5Wcd23o5H5Mk6b'. |
'5NUU8icXbhS67rNzn9JDnguOEYGQtEEtwC+Crs3RJ76P5A/znr'. |
'vsNX7wQnEiwHCtK7TTkW8rvdZ9uJtvZTLkxpHhSrP66bNEj7/P'. |
'3WNoLYeeSWQQCIpe9lQw7RNEU5rDsIYtcJ14Nocg7kRUlBNkxn'. |
'YmGKcp7cv3vPwR7XOJPmc0VYU3Sv0e9NOBAYG7Hbz/cMjTMveZ'. |
'CHkqxuTBv0PhYJB4N3XR6PJ5rMAPMnpGUxDX1IxSeMTEaZp1OZ'. |
'nGAIQiYtsalUIhFlmGTy3sO3AizJCKn6DKYryxzHsWyaneMzr6'. |
'cWxRVZVlFTe4SpE3zm+U/4+whyiwJcWVMQNr3XONirVWAklxcE'. |
'EdbqchPhjhVzGpeqhUKhWBQhLElr9fo3pDaQPrw5xOl1CGG1JE'. |
'k1uYEBIVkrb02+o6RItfq6rBhbw/tuINT96766KhuqYpY3UFPF'. |
'BbY/19yZ1XF1U0UNBa9T7rZsz80K0jWk6bpWGW55UzbvTHZ+3t'. |
'vbAv/IT+K1uCmhIrKJAAAAAElFTkSuQmCC' ; |
//========================================================== |
// File: bl_green.png |
//========================================================== |
$this->imgdata_large[8][0]= 1484 ; |
$this->imgdata_large[8][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABm'. |
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. |
'B3RJTUUH0wMMFjM4kcoDJQAABVlJREFUeNq9ll2MJFUVx3/11V'. |
'Vd/TE9vU0v4zLDwJIF16jBqLAPhsRXEiDqg0QTJiQSjcSNvCzw'. |
'sBEDDxizhvAAxBgf1oR9QF9NiE9ESFZkQyZB5WtddmdnZ3qqqr'. |
'uqbt367Cofqu3ZZpWVaDzJfbkf53//55z/PVdZXV3l/2H6f7Lp'. |
'5VdOV/4Nb+GmHpUeA7AdBNxc3kafNb73jRPK9Xwon8ToxVefqU'. |
'b91wibH5EkCQBCizFihTSviHUHR0hWws9xe3wvJ7/7nPKpgX5y'. |
'9oFqt3eOgWniRBoAbUBGGqZUibSYaeoT2B5bnkdaSA6793Cv/S'. |
'QPPbihXBfo5VdOV+8dfgnvwAU62YH5fCZ12sDujFkwyegCqTrB'. |
'iUOKTOJKj8jr88jS8zy6cXwBTP048nuHX0I0nDlIp7RpTG7kM0'. |
'sdyAYsTVukUuWGhlWHMq0ITL92lnUp9R1Obz/GmTNnqn9bDD8/'. |
'+0D1oX0O0zQZZDYCsK2j3Gl9jQqDfHiei8GfiKVLlsZkJaBAN1'. |
'0i6PgwUbB0GxG5/PrtE/xLRr959Znqw9452oVNI+jiJhnr1pe4'. |
'k29zB1/nFr5Kj7tpt1YYhJ0FJ7nUYbcJQBgahN2MzeCP/OipR6'. |
'prgN6Qr6ELFQFUWoRpNVjlKwxZB8DCpE+PtfEKqV1cUzxpVudu'. |
'GTBHA5Y1g99e+dUio9O/P1Vpq+/WE5GGjDSMoAtAQjrf3C52IP'. |
'QxpY4WK2hpReka9Gfrhqgz0bACRoCWjDh56kQ1z9FeuUUQxVhK'. |
'B92sD1VahM+bAJgcoJhGjP/6Ln8rAgDiRCVRKiIzxMkkodBJ85'. |
'im1IlEHbE4k1xyNveL4YP8HarmGJIOpqyjeQmfNHmTvnqZTWBt'. |
'vIJXpPwlukJSuSTKGK3pEwtJmiX00ZlInTyNscImO6XBITvH1c'. |
'8vVt2OucdKvIyeKRTNCivsEMgcpg6taYs30nfq0Gqg6hOSSFJ4'. |
'BSnJPht0IqEjWmOGocEI6F0J94F0qaL6BntTF0MtUfweKQKAPU'. |
'Wwp4OcVnQAmVb0p9DLOzjEhEKnGRmoRc7EzRGlwA6NujAKG4yP'. |
'6Sjwc4aVznZ7DK0xXdkDoJf0kGmFBniFBOBGcZSCCSKd0IwN0k'. |
'IS+QZWCGVZex4BnUxya3+Zt9iugQbcRFpIAtuHvAZulPUdLhUJ'. |
'RqegI3WcqaSXddlT3idsWMSRRGkEtNwmyTifAwyBo7LP+11J0e'. |
'7tM7pZOYblHkBLcqZ5LcYtw6Wbd4CM3SpE9foYZsIHoqDKCrbz'. |
'mLSQtPwmuhXgtBLs0GBdbXOhFGB7WBKO2F8GXt9/VO97Ya3atF'. |
'7nUHnwGjGGQqcPxFEdFqURkEidiZszAERoYIsGju1hq21kWee3'. |
'bw15+8WpsvAy3K1+i3JkkhZyPpxxjjPOsfOYiZ+TFhLPzQnHOU'. |
'tpzGB2dgA4tscIkKIx19Cxg/fPL7vQJu47eXt1VvsDK8pwPueZ'. |
'PuZoQMOqhRoJHSs0kKLBWjvjYinmeQGw1TaX1RFdfZ3LMzYLjA'. |
'C++dkn6AaH2Nobk6cxEzdnuG0TdC8zvdJkN0hqkFkO/jwL0fxa'. |
'so8sBcuFzQ+/+MRC+BeAHnpwQzn++ee5KT9Eshuy46dcKAXm32'. |
'0uzPQhS4GttkH2GQID2Wc0Y4LtAbDxhZ/x5A+e/uTG9+jGceXH'. |
'9/ySnnIXnUzOxXe1038mW3ZynNmam4yYWkO+f9cv+Oljz16/lV'. |
'9tDz/9nerc1hm8ZEScSRK7VvtYl1i1dklsOKyvc+zg/bzw1O8+'. |
'/efkajt56kR1ydlEJBc5H46xzbrJ3dY9wrB7hGcff+6/+279L+'. |
'0fHxyiE8XMLl4AAAAASUVORK5CYII=' ; |
//========================================================== |
// File: bl_blue.png |
//========================================================== |
$this->imgdata_large[9][0]= 1169 ; |
$this->imgdata_large[9][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAACEF'. |
'BMVEX/////////7//35//v1v/exv/Wvf/Wrf/Wpf/Orf+/v7+9'. |
'tc69jP+9hP+5ucW1tc6tlP+rq7Wlpdalpcalpb2cnM6cnMacc/'. |
'+cWv+UlLWUjN6UjK2Uc/+Ma/+MUv+EhKWEa/+EQvd7e8Z7e7V7'. |
'e6V7c957Wv9za9Zza8ZzSv9ra5xrSv9rOf9rMe9jUudjQv9jOe'. |
'9aWpRaUt5aUpRaSu9aSudSUoxSSs5SSoxSMf9KQtZKOfdKMedK'. |
'Kf9KKe9CKf9CKb1CKa1CIfdCIedCId45MXs5Kfc5If85Iec5Id'. |
'Y5GP8xMbUxMXsxKc4xKZQxIf8xGP8xGO8xGN4xGNYxGL0xGK0p'. |
'KXMpIYwpGP8pGO8pGOcpGNYpGM4pEP8pEPcpEOcpEN4pENYpEM'. |
'YpEL0hGKUhEP8hEPchEO8hEOchEN4hENYhEM4hEMYhELUhCP8h'. |
'CO8hCN4YGJwYGGsYEL0YEK0YEHMYCN4YCM4YCMYYCL0YCKUYAP'. |
'8QEJQQEIwQEHsQEGsQCM4QCLUQCK0QCKUQCJwQCJQQCIwQCHMQ'. |
'CGsQAP8QAPcQAO8QAOcQAN4QANYQAM4QAMYQAL0QALUQAKUQAJ'. |
'QQAIQICGsICGMIAO8IANYIAL0IALUIAK0IAKUIAJwIAJQIAIwI'. |
'AIQIAHsIAHMIAGsIAGMAAN4AAMYAAK0AAJQAAIwAAIQAAHMAAG'. |
'sAAGMAAFrR1dDlAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'. |
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkRFRPMOZ'. |
'/2AAAB+klEQVR4nGNgIAIIqeqZmBqpi2JISNml5lVXV3d198Yo'. |
'oUjwm1SnxsbGRsSm5ZfNXO4tjCTjVh0ABhFx6QV9E1Y0S8JkuN'. |
'3yAgLc7W3t/QPi4jPKJ8ye1yoIlTKpjvVy15eVUbN0i4zKLJ8w'. |
'ae6qcKgLqmMj3PUFWFl5NJ0CExLLJzbNW7BWCyxlXR0ba6/Axs'. |
'zELmfnkRBT0QiSKgXJCOflxUbYy3KyMHEoOrtEZ1c2TZ6/cMl6'. |
'eaCUamdsbIC7tjgPr4SBS3BMMVDTwkXr1hsDpYy6UmMj/O0tdX'. |
'QNbDxjknJLWqYsXLx0vStQynxGflpkZGCgs7Onp29SbtNkoMy6'. |
'pevCgFJWy3oyMuKjgoKCPWNCvEuqWhcsWrJ06XqQlPnMvrKyrM'. |
'TomJjkZAfHlNa2qdOWrlu63gcopbG8v7+hvLwip7g4JdSxsLZu'. |
'8dKlS9ettwBKic2eNXHChIkTG5tKqgpr2uo6loLAehWQx0LnzJ'. |
'49p6mpeXLLlNq6RUvqly6dvnR9Bx9ISnnlvLmT582bMr9t4aL2'. |
'+vrp60GaDCGB6Ld6wfwFCxYCJZYsXQ+SmL6+FBryInVrFi1atH'. |
'jJkqVQsH6pNCzCJNvXrQW6CmQJREYFEc2CYevXrwMLAyXXl0oz'. |
'IAOt0vVQUGSIkabkDV3DwlzNVDAksAAAfUbNQRCwr88AAAAASU'. |
'VORK5CYII=' ; |
//========================================================== |
// File: bs_red.png |
//========================================================== |
$this->imgdata_small[0][0]= 437 ; |
$this->imgdata_small[0][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAk1'. |
'BMVEX////////GxsbGra3/xsbOhITWhIT/hIT/e3v/c3P/a2vG'. |
'UlK1SkrOUlL/Y2PWUlLGSkrnUlLeSkrnSkr/SkqEGBj/KSmlGB'. |
'jeGBjvGBj3GBj/EBD/CAj/AAD3AADvAADnAADeAADWAADOAADG'. |
'AAC9AAC1AACtAAClAACcAACUAACMAACEAAB7AABzAABrAABjAA'. |
'BuukXBAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZ'. |
'cwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGDNEMgOYAAAAm0'. |
'lEQVR4nI3Q3RKCIBAFYGZMy9RKzX7MVUAUlQTe/+kS0K49d3wD'. |
'7JlFaG+CvIR3FvzPXgpLatxevVVS+Jzv0BDGk/UJwOkQ1ph2g/'. |
'Ct5ACX4wNT1o/zzUoJUFUGBiGfVnDTYGJgmrWy8iKEtp0Bpd2d'. |
'jLGu56MB7f4JOOfDJAwoNwslk/jOUi+Jts6RVNrC1hkhPy50Ef'. |
'u79/ADQMQSGQ8bBywAAAAASUVORK5CYII=' ; |
//========================================================== |
// File: bs_lightblue.png |
//========================================================== |
$this->imgdata_small[1][0]= 657 ; |
$this->imgdata_small[1][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAABVl'. |
'BMVEX////////d///AwMC7wcS08P+y+P+xxdCwxM+uws2twMur'. |
'vsinzNynytylzuKhyN6e5v6d5P+d1fOcwNWcu8ub4f+at8iZ3v'. |
'+ZvdGY2/yW2f+VscGU1vuT1fqTr72Sx+SSxeKR0fWRz/GPz/OP'. |
'rr+OyeqMy+6Myu2LyeyKxueJudSGw+SGorGDvt+Cvd6CvN2Aud'. |
'p+uNd+t9Z9tdV8tdR8tNN6sc94r813rct2q8h0qcZ0qMVzp8Rx'. |
'o8Bwor5tn7ptnrptnrlsnbhqmbRpmbNpi51ol7Flkqtkkqtkka'. |
'pjj6hijaRhjaZgi6NfiqJfiaFdh55bhJtag5pZgphYgJZYf5VX'. |
'cn9Ve5FSeI1RdopRdYlQdYlPc4dPcoZPcoVNcINLboBLbH9GZn'. |
'hGZXdFZHZEY3RDYnJCXW4/W2s/WWg+Wmo7VmU7VGM7U2E6VGM6'. |
'VGI5UV82T1wGxheQAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHU'. |
'gAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGTok'. |
'9Yp9AAAAtElEQVR4nGNgIBaw8wkpKghzwvksPAKiUsraprYiLF'. |
'ARXkE2JiZ1PXMHXzGIAIekOFBE08TGLTCOCyzCLyvDxsZqZOnk'. |
'E56kAhaRV9NQUjW2tPcMjs9wBYsY6Oobmlk7egRGpxZmgkW0zC'. |
'2s7Jy9giKT8gohaiQcnVzc/UNjkrMLCyHmcHr7BYREJKTlFxbm'. |
'QOxiEIuKTUzJKgQCaZibpdOzQfwCOZibGRi4dcJyw3S4iQ4HAL'. |
'qvIlIAMH7YAAAAAElFTkSuQmCC' ; |
//========================================================== |
// File: bs_gray.png |
//========================================================== |
$this->imgdata_small[2][0]= 550 ; |
$this->imgdata_small[2][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABEAAAAQCAMAAADH72RtAAABI1'. |
'BMVEX///8AAAD8EAD8IAD8NAD8RAD8VAAYGBi/v7+goKCCgoJk'. |
'ZGRGRkb8yAD83AD87AD8/AD4+ADo+ADY+ADI+AC0+ACk+ACU+A'. |
'CE+AB0/ABk/ABU/ABE/AAw/AAg/AAQ/AAA/AAA+AAA6BAA2CAA'. |
'yDQAtEQApFQAlGQAhHQAdIgAZJgAVKgARLgAMMgAINwAEOwAAP'. |
'wAAPgIAPAQAOgYAOAkANgsANA0AMg8AMBEALhMALBUAKhcAKBo'. |
'AJhwAJB4AIiAAID////4+Pjy8vLs7Ozm5ubg4ODa2trT09PNzc'. |
'3Hx8fBwcG7u7u1tbWurq6oqKiioqKcnJyWlpaQkJCJiYmDg4N9'. |
'fX13d3dxcXFra2tkZGReXl5YWFhSUlJMTExGRkZAQEA1BLn4AA'. |
'AAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIA'. |
'AAsSAdLdfvwAAAAHdElNRQfTAwkUGiIctEHoAAAAfElEQVR4nI'. |
'2N2xKDIAwF+bZ2kAa8cNFosBD//yvKWGh9dN+yk9kjxH28R7ze'. |
'wzBOYSX6CaNB927Z9qZ66KTSNmBM7UU9Hx2c5qjmJaWCaV5j4t'. |
'o1ANr40sn5a+x4biElrqHgrXMeac/c1nEpFHG0LSFoo/jO/BeF'. |
'lJnFbT58ayUf0BpA8wAAAABJRU5ErkJggg==' ; |
//========================================================== |
// File: bs_greenblue.png |
//========================================================== |
$this->imgdata_small[3][0]= 503 ; |
$this->imgdata_small[3][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAxl'. |
'BMVEX///////+/v79znJQhSkJ7raU5hHtjraVKnJRCjIRClIyU'. |
'9++E595avbVaxr2/v7+ctbWcvb17nJxrjIx7paUxQkK9//+Mvb'. |
'17ra2Evb17tbVCY2MQGBiU5+ec9/eM5+d71tZanJxjra1rvb1j'. |
'tbVSnJxara1rzs5jxsZKlJRChIQpUlIhQkJatbVSpaU5c3MxY2'. |
'MYMTEQISFavb1Sra1KnJxCjIw5e3sxa2spWlpClJQhSkoYOTkp'. |
'Y2MhUlIQKSkIGBgQMTH+e30mAAAAAXRSTlMAQObYZgAAAAFiS0'. |
'dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfT'. |
'AwkUGTIqLgJPAAAAqklEQVR4nI2QVxOCMBCEM6Mi2OiCvSslJB'. |
'CUoqjn//9TYgCfubf9Zu9uZxFqO+rscO7b6l/LljMZX29J2pNr'. |
'YjmX4ZaIEs2NeiWO19NNacl8rHAyD4LR6jjw6PMRdTjZE0JOiU'. |
'dDv2ALTlzRvSdCCfAHGCc7yRPSrAQRQOWxKc3C/IUjBlDdUcM8'. |
'97vFGwBY9QsZGBc/A4DWZNbeXIPWZEZI0c2lqSute/gCO9MXGY'. |
'4/IOkAAAAASUVORK5CYII=' ; |
//========================================================== |
// File: bs_yellow.png |
//========================================================== |
$this->imgdata_small[4][0]= 507 ; |
$this->imgdata_small[4][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAzF'. |
'BMVEX///////+/v79zYwCMewDOxoTWzoTezkr/5wj/5wDnzgDe'. |
'xgC1pQCtnACllACcjACUhABjWgDGvVK1rUrOxlLGvUqEexilnB'. |
'jv3hj35xj/7wj/7wD35wDv3gDn1gDezgDWxgDOvQDGtQC9rQCE'. |
'ewB7cwBzawBrYwDWzlLn3lLe1krn3kre1hi9tQC1rQCtpQClnA'. |
'CclACUjACMhAD/9wC/v7///8bOzoT//4T//3v//3P//2v//2Pn'. |
'50r//0r//yn39xj//xD//wBjYwDO8noaAAAAAXRSTlMAQObYZg'. |
'AAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAH'. |
'dElNRQfTAwkUGSDZl3MHAAAAqElEQVR4nI3QWRNDMBAA4My09E'. |
'IF1SME0VT1okXvM/3//6kEfbZv+81eswA0DfHxRpOV+M+zkDGG'. |
'rL63zCoJ2ef2RLZDIqNqYexyvFrY9ePkxGWdpvfzC7tEGtIRly'. |
'nqzboFKMlizAXbNnZyiFUKAy4bZ+B6W0lRaQDLmg4h/k7eFwDL'. |
'OWIky8qhXUBQ7gKGmsxpC+ah1TdriwByqG8GQNDNr6kLjf/wAx'. |
'KgEq+FpPbfAAAAAElFTkSuQmCC' ; |
//========================================================== |
// File: bs_darkgray.png |
//========================================================== |
$this->imgdata_small[5][0]= 611 ; |
$this->imgdata_small[5][1]= |
'iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAABJl'. |
'BMVEX////////o8v/f6O7W4OnR3PXL1OTL0evEyLvCzePAwMC/'. |
'v7a8wsq7t7C1xum1vtS1q6GzopmyxeKsrsOqvNWoq7anvN+nsb'. |
'qhrcGgqbGfpq6cp7+bqMuVmJKRm7yPlKKMnL6FkKWFipOEkLSE'. |
'j6qEhoqAiaB+jqd8haF7hZR4iJt4g5l3hZl2gIt2cod1hJVzeY'. |
'VzboJvhp9sfJJsb41peY1pd5xpdoVod4xndI5lcHxka4BjcYVg'. |
'Z3BfboFbb4lbZnZbYntaZ4laZYVZV3JYYWpXX3JWWm5VX4RVW2'. |
'NUYX9SXHxPWn5OVFxNWWtNVXVMVWFKV3xHUGZGU3dGTldFSlxE'. |
'Sk9ESXBCRlNBS3k/SGs/RU4+R1k9R2U6RFU2PUg0PEQxNU0ECL'. |
'QWAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAA'. |
'CxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGQmbJetrAAAAtklEQV'. |
'R4nGNgwAK4JZTNNOWlYDxhMT4ZDTOzQE1uMF9CiJWVU0LbxDlS'. |
'G8QVF+FnZ2KRNHAIiPUHaZGSlmZj5lH19A1KjLUA8lXU5MWllF'. |
'yjo30TYr2BfG19G11b37CEeN84H38gX1HbwTUkOjo+zjfG3hLI'. |
'l1exCvCNCwnxjfMz0gTyRdXNHXx9fUNCQu2MwU6SN3ZwD42LCH'. |
'W30IK4T8vUJSAkNMhDiwPqYiktXWN9JZj7UQAAjWEfhlG+kScA'. |
'AAAASUVORK5CYII=' ; |
//========================================================== |
// File: bs_darkgreen.png |
//========================================================== |
$this->imgdata_small[6][0]= 666 ; |
$this->imgdata_small[6][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAABX1'. |
'BMVEX////////l/+nAwMC86r+8wb28wby8wLy78sCzw7SywrSx'. |
'wLKwvrGuvK+syK+ryq2rx62n36ym3aumxKmk2qij0Keh16ahva'. |
'Og1aSguKKe06KeuaCetZ+d0KGdtZ+bz6Cay56ZyZ2Zwp2Zr5qZ'. |
'rpqYwJuXyZuXrJmVw5mUxZiTxJeTw5eTq5WRwJWPtJKOvZKKuI'. |
'6Kt42Kn4yJt42ItIuGsomFsYmEsIiEr4eDr4eBrIR/qoN+qIJ8'. |
'poB7pH56o356on14nnt2nXl0mndzmnZzmXZymHVwlXNvlHJukn'. |
'FtiHBqjm1qjW1oi2toiWpniWplh2hlhmdkhWdig2VggGNgf2Je'. |
'fmFdfGBde19bbl1aeFxXdFpWclhVclhVcVdUcFZTb1VSbVRQal'. |
'JPaVFKY0xKYkxJYUtIYEpHX0lEWkZCWERCV0NCVkM/U0A+U0A+'. |
'UUA+UEA9Uj89UT48Tj45TDvewfrHAAAAAXRSTlMAQObYZgAAAA'. |
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'. |
'RQfTAwkUGRjxlcuZAAAAtElEQVR4nGNgIBZw8osqqIpzw/msfI'. |
'IiUmr6lo6SbFARASEOJiYtQ2uXADmIAJeEGFBE18LBMySBBywi'. |
'LC/LwcFiZuvmH5WiAxZR0tRW1DC3dfYJS8zyAouYGBibWtm7+o'. |
'TEpZfkgEX0rG3snNx9Q2NSCksgaqRd3Ty8gyLiU/NKSiDmcPsF'. |
'BodHJ2UUlZTkQ+xikIlNSE7LLgECZagL2VQyc0H8YnV2uD94jS'. |
'ILIo14iQ4HALarJBNwbJVNAAAAAElFTkSuQmCC' ; |
//========================================================== |
// File: bs_purple.png |
//========================================================== |
$this->imgdata_small[7][0]= 447 ; |
$this->imgdata_small[7][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAnF'. |
'BMVEX///////+/v7/Gvca9rb3Grcb/xv+1hLWte629hL21e7XG'. |
'hMbWhNbOe87We9b/hP//e/97OXv/c///a///Y/+cOZz/Sv/WOd'. |
'bnOefvOe//Kf9jCGNrCGv/EP//CP/nCOf/AP/3APfvAO/nAOfe'. |
'AN7WANbOAM7GAMa9AL21ALWtAK2lAKWcAJyUAJSMAIyEAIR7AH'. |
'tzAHNrAGtjAGPP1sZnAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgF'. |
'HUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGS'. |
'o5QpoZAAAAnElEQVR4nI3Q2xJDMBAG4MyQokWrZz3oSkJISJH3'. |
'f7dK0Gv/Xb7J7vyzCK0NjtPsHuH/2wlhTE7LnTNLCO/TFQjjIp'. |
'hHAA6bY06LSqppMAY47x+04HXTba2kAFlmQKr+YuVDCGUG2k6/'. |
'rNwYK8rKwKCnPxHnVS0aA3rag4UQslUGhrlk0Kpv1+sx3tLZ6w'. |
'dtYemMkOsnz8R3V9/hB87DEu2Wos5+AAAAAElFTkSuQmCC' ; |
//========================================================== |
// File: bs_brown.png |
//========================================================== |
$this->imgdata_small[8][0]= 677 ; |
$this->imgdata_small[8][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAABaF'. |
'BMVEX//////////8X/3oD/3nj/1HX/0Gr/xGP/rkv/gBf+iS/2'. |
'bAL1agDxaQDuZwDrZwLpZQDmZQLlZADjcx7gZATeYQDdZgraXw'. |
'DZXwHYXgDXiEvXZAvUjlfUXwXTjVfTbR7ShUvRbR7RWwDMWQDL'. |
'WADKooLKWADJoYLJgkvHWATGoILFn4LFgEvFVgDEZx7EVQDDt6'. |
'/DVQDCt6/CnoLChlfCVADAwMC+hFe+UgC8UgC6UQC4gVe4UAC3'. |
'gVe3UAC1gFe1eUu1TwC1TgCzTgCwTQKuTACrSgCqSgCpSgCpSQ'. |
'CodEulSACkRwCiRgCdRACcRACaQwCYQgCWQgKVQQCVQACUQACS'. |
'UR6RPwCOPgCNPQCLPACKPACJOwCEOQCBOAB+NwB9NgB8NgB7NQ'. |
'B6NwJ4NAB3RR52MwB0MgBuLwBtLwBsLwBqLgBpLQBkLQJiKgBh'. |
'KgBgKwRcKABbKQJbJwBaKQRaJwBYKAJVJQDZvdIYAAAAAXRSTl'. |
'MAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLd'. |
'fvwAAAAHdElNRQfTAwkUGho0tvl2AAAAtklEQVR4nGNgIBaoSg'. |
'mLKGpowfkGMty8AqJKpi4mRlAROR5ONg4JFUv3YHOIgDo/HwsT'. |
'q6yps29EsjZYREFIkJ2ZS9/OMzA20wEsIi8uKSZtaOPmH5WSFw'. |
'YW0VRW07Vw8vCLSMguLwCL6FlaObp6B0TGZxSXQ9TouHv6+IXG'. |
'JGYWlpdDzNEKCgmPjkvLKS0vL4LYxWAen5SelV8OBNZQFxrZ5h'. |
'aC+GX2MDczMBh7pZakehkTHQ4AA0Am/jsB5gkAAAAASUVORK5C'. |
'YII=' ; |
//========================================================== |
// File: bs_blue.png |
//========================================================== |
$this->imgdata_small[9][0]= 436 ; |
$this->imgdata_small[9][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAk1'. |
'BMVEX///////+/v7+trcbGxv+EhM6EhNaEhP97e/9zc/9ra/9S'. |
'UsZKSrVSUs5jY/9SUtZKSsZSUudKSt5KSudKSv8YGIQpKf8YGK'. |
'UYGN4YGO8YGPcQEP8ICP8AAP8AAPcAAO8AAOcAAN4AANYAAM4A'. |
'AMYAAL0AALUAAK0AAKUAAJwAAJQAAIwAAIQAAHsAAHMAAGsAAG'. |
'ONFkFbAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZ'. |
'cwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGhNNakHSAAAAmk'. |
'lEQVR4nI3P2xKCIBAGYGfM6SBWo1nauIqogaDA+z9dK9Lhrv47'. |
'vtl/2A2CfxNlJRRp9IETYGraJeEb7ocLNKznia8A7Db7umWDUG'. |
'sxAzhurxRHxok4KQGqCuEhlL45oU1D2w5BztY4KRhj/bCAsetM'. |
'2uObjwvY8/oX50JItYDxSyZSTrO2mNhvGMbaWAevnbFIcpuTr7'. |
't+5AkyfBIKSJHdSQAAAABJRU5ErkJggg==' ; |
//========================================================== |
// File: bs_green.png |
//========================================================== |
$this->imgdata_small[10][0]= 452 ; |
$this->imgdata_small[10][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAn1'. |
'BMVEX///////+/v7+/v7/G/8aUxpSMvYyUzpSMzoyM1oxarVqE'. |
'/4R7/3tavVpKnEpaxlpz/3Nr/2tKtUpj/2Na51pKzkpK1kpK50'. |
'pK/0oYcxgp/ykYlBgY3hgY7xgY9xgQ/xAI/wgA/wAA9wAA7wAA'. |
'5wAA3gAA1gAAzgAAxgAAvQAAtQAArQAApQAAnAAAlAAAjAAAhA'. |
'AAewAAcwAAawAAYwA0tyxUAAAAAXRSTlMAQObYZgAAAAFiS0dE'. |
'AIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAw'. |
'kUGgW5vvSDAAAAnklEQVR4nI3QSxKCMAwA0M4gqCgoiiJ+kEAL'. |
'LQUq0PufzX7ENdnlJZNkgtDS2CYZvK6bf+7EoKLA9cH5SQzv6A'. |
'YloTywsAbYr44FrlgrXCMJwHl3xxVtuuFkJAPIcw2tGB9GcFli'. |
'oqEf5GTkSUhVMw2TtD0XSlnDOw3SznE5520vNEi7CwW9+Ayjyq'. |
'U/3+yPuq5gvhkhL0xlGnqL//AFf14UIh4mkEkAAAAASUVORK5C'. |
'YII=' ; |
//========================================================== |
// File: bs_white.png |
//========================================================== |
$this->imgdata_small[11][0]= 480 ; |
$this->imgdata_small[11][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABEAAAAQCAYAAADwMZRfAAAABm'. |
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'. |
'B3RJTUUH0wMLFTsY/ewvBQAAAW1JREFUeJytkz2u4jAUhT/jic'. |
'gfBUKiZhE0bIKeVbCWrIKenp6eDiGlCEEEBArIxvzGU4xeZjLk'. |
'jWb05lRXuvbx+exr4bouX1Xjyw7Atz81F4uFBYjjGIDhcCjq1o'. |
'k6nN1uZwFerxfP55Msy1itVmRZBsB4PK6YveHkeW5d18XzPIIg'. |
'wPd9Wq0WnU6HMAxJkoQoiuynOIfDwUopkVIihKAoCgAcx6Hdbm'. |
'OMIU1T5vN55eBKEikljUYDIX6kFUKU9e8aDAZlmjcca+1b7TgO'. |
'1+uVy+VS9nzfr8e53++VzdZaiqIgz3OMMWitOZ/PaK0JgqDeRC'. |
'mF53lIKYGfr3O73TDGoJQiTVO01nS73XqT4/FIs9kkCAIej0eZ'. |
'brPZEMcxSZKgtQZgMpmIWpN+vy+m06n1PK9yTx8Gy+WS/X5Pr9'. |
'er9GuHLYoiG4YhSilOpxPr9Zrtdlti/JriU5MPjUYjq7UuEWaz'. |
'2d+P/b/qv/zi75oetJcv7QQXAAAAAElFTkSuQmCC' ; |
//========================================================== |
// File: bs_cyan.png |
//========================================================== |
$this->imgdata_small[12][0]= 633 ; |
$this->imgdata_small[12][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAABPl'. |
'BMVEX////////F///AwMCvxsaC1NSC0dGCz8+CzMyA//94//91'. |
'//9q//9j//9X4uJX09NXz89Xx8dXxMRL//9L5uZL3d1L2NhLxs'. |
'ZLt7cv//8e9fUe8fEe7u4e398epqYehoYX//8L+PgK//8F9fUE'. |
'/v4E5+cEb28EZ2cC//8C/v4C/f0CzMwCrq4Cjo4CdXUCaWkCZW'. |
'UB/PwA//8A/f0A+/sA8/MA7e0A7OwA6+sA5eUA5OQA4uIA4eEA'. |
'3NwA2toA2NgA1dUA09MA0tIA0NAAysoAxsYAxcUAxMQAv78Avr'. |
'4AvLwAtrYAtbUAs7MAsLAAra0Aq6sAqKgApaUApKQAoqIAoKAA'. |
'n58AmpoAlZUAk5MAkpIAkJAAj48AjIwAiYkAh4cAf38AfX0Ae3'. |
'sAenoAcnIAcHAAa2sAaWkAaGgAYmIUPEuTAAAAAXRSTlMAQObY'. |
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'. |
'AHdElNRQfTAwkUGQDi+VPPAAAAtElEQVR4nGNgIBawikipyIiy'. |
'wfksfJpGRkamNtr8LFARPiMFHmFDcztXfwGoFi0jLiZuZRtnry'. |
'BddrCIiJEGL6eklYO7X3iCOFhE2thESdHawdUnJDZFDiyiamZh'. |
'aevk5h0UlZSpBhaRtbN3dPHwDY5MSM+EqBFzc/f0DgiLTkjLzI'. |
'SYw6bjHxgaEZeckZmpD7GLQSAqJj4xNRMIBGFuFtRLA/ENhGBu'. |
'ZmDgkJBXl5fgIDocAAKcINaFePT4AAAAAElFTkSuQmCC' ; |
//========================================================== |
// File: bs_bluegreen.png |
//========================================================== |
$this->imgdata_small[13][0]= 493 ; |
$this->imgdata_small[13][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAvV'. |
'BMVEX///////+/v79j//855/8x3v851v9Spb1C1v8AOUqEtcZK'. |
'lK1StdYxzv8hxv8AY4QASmNSlK1KpcZKtd4YQlIYnM4YrecIvf'. |
'8AtfcAre8AjL0AhLUAc5wAa5QAWnsAQloAKTkAGCFKhJxKrdYY'. |
'jL0Ypd4Atf8ArfcApecAnN4AlM4AjMYAe60Ac6UAY4wAUnNSnL'. |
'0AlNYAWoQASmsAOVIAITGEtc4YWnsAUnsAMUqtvcaErcYAKUIA'. |
'GCkAECHUyVh/AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAA'. |
'AJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGxNUcXCT'. |
'AAAAqUlEQVR4nI2Q1xKCMBREM2NHLCCogAGCjd6SqLT8/2cZKT'. |
'6zb3tm987OBWCsXoejp8rC35fi4+l6gXFZlD0Rz6fZ1tdDmKR9'. |
'RdOmkzmP7DDpilfX3SzvRgQ/Vr1uiZplfsCBiVf03RJd140wgj'. |
'kmNqMtuYXcxyYmNWJdRoYwzpM9qRvGujuCmSR7q7ARY00/MiWk'. |
'sCnjkobNEm1+HknDZgAqR0GKU43+wxdu2hYzbsHU6AAAAABJRU'. |
'5ErkJggg==' ; |
//========================================================== |
// File: bs_lightred.png |
//========================================================== |
$this->imgdata_small[14][0]= 532 ; |
$this->imgdata_small[14][1]= |
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAA3l'. |
'BMVEX///////+/v7/Gvb0hGBj/5///3v//zu//1u//xucpGCG9'. |
'nK21lKVSQkp7Wms5KTExISlaOUpjQlIhEBj/tdbOhKXnrcbGjK'. |
'Wla4TetcbGnK2EWmv/rc73pcZ7UmOcY3vOpbW1jJzenLW9e5Rz'. |
'Slq1c4xrQlJSOULGhJz/pcb3nL2chIzOnK33rcbelK3WjKWMWm'. |
'vGe5SEUmM5ISnOtb3GrbXerb3vpb2ca3v/rcaUY3POhJxCKTF7'. |
'SlrWnK21e4ytc4TvnLXnlK2la3taOUK1lJxrSlLGhJRjQkpSMT'. |
'lw+q2nAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZ'. |
'cwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAwkUGjoP2Nm+AAAAr0'. |
'lEQVR4nGNgIBaYiOk62imYwPnMkiIyso76yhJSzFARMxkRNk49'. |
'a3t5OW6oFk1LVkYOfWUHKxUXiEYzLS12DnN3VXkjIRtFsIiSk5'. |
'6evqGqhYGKugAfWMRa1FpD2UHeQEXQRlgALCJur+rgbCUNFOAS'. |
'hqjRkZe3MpBTcwEKCEPMMTGSs3Xz8OQHCnBBHckt6OJpIyAMBD'. |
'wwN/MYc4H4LK4wNzMwmGrzcvFqmxIdDgDiHRT6VVQkrAAAAABJ'. |
'RU5ErkJggg==' ; |
//========================================================== |
// File: bxs_lightred.png |
//========================================================== |
$this->imgdata_xsmall[0][0]= 432 ; |
$this->imgdata_xsmall[0][1]= |
'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAA3l'. |
'BMVEX///////+/v7/Gvb0hGBj/5///3v//zu//1u//xucpGCG9'. |
'nK21lKVSQkp7Wms5KTExISlaOUpjQlIhEBj/tdbOhKXnrcbGjK'. |
'Wla4TetcbGnK2EWmv/rc73pcZ7UmOcY3vOpbW1jJzenLW9e5Rz'. |
'Slq1c4xrQlJSOULGhJz/pcb3nL2chIzOnK33rcbelK3WjKWMWm'. |
'vGe5SEUmM5ISnOtb3GrbXerb3vpb2ca3v/rcaUY3POhJxCKTF7'. |
'SlrWnK21e4ytc4TvnLXnlK2la3taOUK1lJxrSlLGhJRjQkpSMT'. |
'lw+q2nAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZ'. |
'cwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAwkUKBOgGhWjAAAAS0'. |
'lEQVR4nGNgQAEmunYmEJaMCKe1vBxYzJKVQ9lKBSSupKdnaKGi'. |
'zgdkiqs6WKnYcIGYJnK2HvzCwmCNgi42wsLCECNMeXlNUY0HAL'. |
'DaB7Du8MiEAAAAAElFTkSuQmCC' ; |
//========================================================== |
// File: bxs_bluegreen.png |
//========================================================== |
$this->imgdata_xsmall[1][0]= 397 ; |
$this->imgdata_xsmall[1][1]= |
'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAvV'. |
'BMVEX///////+/v79j//855/8x3v851v9Spb1C1v8AOUqEtcZK'. |
'lK1StdYxzv8hxv8AY4QASmNSlK1KpcZKtd4YQlIYnM4YrecIvf'. |
'8AtfcAre8AjL0AhLUAc5wAa5QAWnsAQloAKTkAGCFKhJxKrdYY'. |
'jL0Ypd4Atf8ArfcApecAnN4AlM4AjMYAe60Ac6UAY4wAUnNSnL'. |
'0AlNYAWoQASmsAOVIAITGEtc4YWnsAUnsAMUqtvcaErcYAKUIA'. |
'GCkAECHUyVh/AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAA'. |
'AJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAwkUKDVyF5Be'. |
'AAAASUlEQVR4nGNgQAFmYqJcEJaEOJ+UrD5YTJKFTZrfGCQuaq'. |
'glLWvMaQ5kqujo6hnbKIKYXPr68gp2dmCNJiZAlh3ECGsREWtU'. |
'4wF1kwdpAHfnSwAAAABJRU5ErkJggg==' ; |
//========================================================== |
// File: bxs_navy.png |
//========================================================== |
$this->imgdata_xsmall[2][0]= 353 ; |
$this->imgdata_xsmall[2][1]= |
'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAk1'. |
'BMVEX///////+/v7+trcbGxv+EhM6EhNaEhP97e/9zc/9ra/9S'. |
'UsZKSrVSUs5jY/9SUtZKSsZSUudKSt5KSudKSv8YGIQpKf8YGK'. |
'UYGN4YGO8YGPcQEP8ICP8AAP8AAPcAAO8AAOcAAN4AANYAAM4A'. |
'AMYAAL0AALUAAK0AAKUAAJwAAJQAAIwAAIQAAHsAAHMAAGsAAG'. |
'ONFkFbAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZ'. |
'cwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAwkUJxXO4axZAAAAR0'. |
'lEQVR4nGNgQAGskhKsEJaslIi8ijpYTJaDU1FVAyQuKSujoKKh'. |
'LQ5kSigpqWro6oOYrOoaWroGBmCNWiCWAdQwUVFWVOMBOp4GCJ'. |
's5S60AAAAASUVORK5CYII=' ; |
//========================================================== |
// File: bxs_gray.png |
//========================================================== |
$this->imgdata_xsmall[3][0]= 492 ; |
$this->imgdata_xsmall[3][1]= |
'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAABI1'. |
'BMVEX///8AAAD8EAD8IAD8NAD8RAD8VAAYGBi/v7+goKCCgoJk'. |
'ZGRGRkb8yAD83AD87AD8/AD4+ADo+ADY+ADI+AC0+ACk+ACU+A'. |
'CE+AB0/ABk/ABU/ABE/AAw/AAg/AAQ/AAA/AAA+AAA6BAA2CAA'. |
'yDQAtEQApFQAlGQAhHQAdIgAZJgAVKgARLgAMMgAINwAEOwAAP'. |
'wAAPgIAPAQAOgYAOAkANgsANA0AMg8AMBEALhMALBUAKhcAKBo'. |
'AJhwAJB4AIiAAID////4+Pjy8vLs7Ozm5ubg4ODa2trT09PNzc'. |
'3Hx8fBwcG7u7u1tbWurq6oqKiioqKcnJyWlpaQkJCJiYmDg4N9'. |
'fX13d3dxcXFra2tkZGReXl5YWFhSUlJMTExGRkZAQEA1BLn4AA'. |
'AAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxEA'. |
'AAsRAX9kX5EAAAAHdElNRQfTAwkUKC74clmyAAAAQklEQVR4nG'. |
'NgQAVBYVCGt5dXYEQ0mOnp5h4QFgVmeri6+4dHxYMVeHoFRUTH'. |
'gTUFBIZBWAwMkZEx8bFQM2Lj0UwHANc/DV6yq/BiAAAAAElFTk'. |
'SuQmCC' ; |
//========================================================== |
// File: bxs_graypurple.png |
//========================================================== |
$this->imgdata_xsmall[4][0]= 542 ; |
$this->imgdata_xsmall[4][1]= |
'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAABSl'. |
'BMVEX////////11P/MqdvKrNfAwMC+u7+9u7+4rr24lsi3rby3'. |
'lMe1rLq1o720q7i0oL20ksSzoryyqbaykMGxlb2wkL+vnbiujb'. |
'2sjLuri7qpl7GoirWoibenmK2mla6mjLKmhrSllauki7CjhrCj'. |
'hLGihLChg6+ggq2fkqadkKOcfqqai6Gag6WYe6WXeqSWeaOTd6'. |
'CTd5+Rdp6RdZ6RdZ2Qg5eOc5qMcpiLcZeJb5WIbpOHbZKGbJGE'. |
'a4+CaY2AZ4t/Z4p/Zop/Zol+Zol7ZIZ6Y4V5YoR1ZH11X391Xn'. |
'9zXX1yXXtxXHtvWnluWXhsV3VqVnNpVXJoVHFnU3BmUm9jUGth'. |
'VGdgTmheTGZcS2RcSmRaSWJYR19XRl5SQllRQlhQQVdPQFZOP1'. |
'VLPlFJO09IPE5IOk5FOEtEN0lDOEpDOElDNklCNkc/M0XhbrfD'. |
'AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACx'. |
'EAAAsRAX9kX5EAAAAHdElNRQfTAwkUKCgREfyHAAAATUlEQVR4'. |
'nGNgQAEcIko8EBY3M5Ougy+IxSXMwmTsFsAHZMqrSRvZB0W7A5'. |
'k6FlYugXEZICaPr394Um4uSAFDRFRCbm4uxAihsDAhVOMBHT0L'. |
'hkeRpo8AAAAASUVORK5CYII=' ; |
//========================================================== |
// File: bxs_red.png |
//========================================================== |
$this->imgdata_xsmall[5][0]= 357 ; |
$this->imgdata_xsmall[5][1]= |
'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAk1'. |
'BMVEX////////GxsbGra3/xsbOhITWhIT/hIT/e3v/c3P/a2vG'. |
'UlK1SkrOUlL/Y2PWUlLGSkrnUlLeSkrnSkr/SkqEGBj/KSmlGB'. |
'jeGBjvGBj3GBj/EBD/CAj/AAD3AADvAADnAADeAADWAADOAADG'. |
'AAC9AAC1AACtAAClAACcAACUAACMAACEAAB7AABzAABrAABjAA'. |
'BuukXBAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZ'. |
'cwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAwkUIyjy5SVMAAAAS0'. |
'lEQVR4nGNgQAFsUpJsEJastIi8ijpYTJaDU0FVgxXIlJKVUVDR'. |
'0BYHMiUUlVQ1dPVBTDZ1dS1dAwOQAgYtbSDLAGIEq6goK6rxAD'. |
'yXBg73lwGUAAAAAElFTkSuQmCC' ; |
//========================================================== |
// File: bxs_yellow.png |
//========================================================== |
$this->imgdata_xsmall[6][0]= 414 ; |
$this->imgdata_xsmall[6][1]= |
'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAzF'. |
'BMVEX///////+/v79zYwCMewDOxoTWzoTezkr/5wj/5wDnzgDe'. |
'xgC1pQCtnACllACcjACUhABjWgDGvVK1rUrOxlLGvUqEexilnB'. |
'jv3hj35xj/7wj/7wD35wDv3gDn1gDezgDWxgDOvQDGtQC9rQCE'. |
'ewB7cwBzawBrYwDWzlLn3lLe1krn3kre1hi9tQC1rQCtpQClnA'. |
'CclACUjACMhAD/9wC/v7///8bOzoT//4T//3v//3P//2v//2Pn'. |
'50r//0r//yn39xj//xD//wBjYwDO8noaAAAAAXRSTlMAQObYZg'. |
'AAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAH'. |
'dElNRQfTAwkUIzoBXFQEAAAAS0lEQVR4nGNgQAFsDhJsEJaTo5'. |
'2skj5YzMnSSk7ZwBzIlOSUklPiMxYHMnW4FXT5VNVBTDZeXiNV'. |
'QUGQAgYBYyBLEGIEq5gYK6rxAH4kBmHBaMQQAAAAAElFTkSuQm'. |
'CC' ; |
//========================================================== |
// File: bxs_greenblue.png |
//========================================================== |
$this->imgdata_xsmall[7][0]= 410 ; |
$this->imgdata_xsmall[7][1]= |
'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAxl'. |
'BMVEX///////+/v79znJQhSkJ7raU5hHtjraVKnJRCjIRClIyU'. |
'9++E595avbVaxr2/v7+ctbWcvb17nJxrjIx7paUxQkK9//+Mvb'. |
'17ra2Evb17tbVCY2MQGBiU5+ec9/eM5+d71tZanJxjra1rvb1j'. |
'tbVSnJxara1rzs5jxsZKlJRChIQpUlIhQkJatbVSpaU5c3MxY2'. |
'MYMTEQISFavb1Sra1KnJxCjIw5e3sxa2spWlpClJQhSkoYOTkp'. |
'Y2MhUlIQKSkIGBgQMTH+e30mAAAAAXRSTlMAQObYZgAAAAFiS0'. |
'dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElNRQfT'. |
'AwkUJy5/6kV9AAAATUlEQVR4nGNgQAGCyuyCEJaGugKHviVYzF'. |
'hO3sxCWwDIVNLTM9PXtpEGMhW12Cy0DR1ATEFLSxZ7BweQAgYd'. |
'HUMHBweIEQKiogKoxgMAo/4H5AfSehsAAAAASUVORK5CYII=' ; |
//========================================================== |
// File: bxs_purple.png |
//========================================================== |
$this->imgdata_xsmall[8][0]= 364 ; |
$this->imgdata_xsmall[8][1]= |
'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAnF'. |
'BMVEX///////+/v7/Gvca9rb3Grcb/xv+1hLWte629hL21e7XG'. |
'hMbWhNbOe87We9b/hP//e/97OXv/c///a///Y/+cOZz/Sv/WOd'. |
'bnOefvOe//Kf9jCGNrCGv/EP//CP/nCOf/AP/3APfvAO/nAOfe'. |
'AN7WANbOAM7GAMa9AL21ALWtAK2lAKWcAJyUAJSMAIyEAIR7AH'. |
'tzAHNrAGtjAGPP1sZnAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgF'. |
'HUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAwkUIj'. |
'mBTjT/AAAASUlEQVR4nGNgQAGskhKsEJaCrJiSuhZYTEFASFlD'. |
'GyQuqSCnrK6tJwpkiquoamgbGIGYrFpaugbGxmCNunpAljHECB'. |
'ZBQRZU4wFSMAZsXeM71AAAAABJRU5ErkJggg==' ; |
//========================================================== |
// File: bxs_green.png |
//========================================================== |
$this->imgdata_xsmall[9][0]= 370 ; |
$this->imgdata_xsmall[9][1]= |
'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAAAn1'. |
'BMVEX///////+/v7+/v7/G/8aUxpSMvYyUzpSMzoyM1oxarVqE'. |
'/4R7/3tavVpKnEpaxlpz/3Nr/2tKtUpj/2Na51pKzkpK1kpK50'. |
'pK/0oYcxgp/ykYlBgY3hgY7xgY9xgQ/xAI/wgA/wAA9wAA7wAA'. |
'5wAA3gAA1gAAzgAAxgAAvQAAtQAArQAApQAAnAAAlAAAjAAAhA'. |
'AAewAAcwAAawAAYwA0tyxUAAAAAXRSTlMAQObYZgAAAAFiS0dE'. |
'AIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAw'. |
'kUKBrZxq0HAAAATElEQVR4nGNgQAGccrIcEJaivISyhjaIxa7I'. |
'I6CiqcMKZMopKqho6OhLA5kyqmqaOobGICartraeoYkJSAGDnj'. |
'6QZQIxgk1Skg3VeABlVgbItqEBUwAAAABJRU5ErkJggg==' ; |
//========================================================== |
// File: bxs_darkgreen.png |
//========================================================== |
$this->imgdata_xsmall[10][0]= 563 ; |
$this->imgdata_xsmall[10][1]= |
'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAABX1'. |
'BMVEX////////l/+nAwMC86r+8wb28wby8wLy78sCzw7SywrSx'. |
'wLKwvrGuvK+syK+ryq2rx62n36ym3aumxKmk2qij0Keh16ahva'. |
'Og1aSguKKe06KeuaCetZ+d0KGdtZ+bz6Cay56ZyZ2Zwp2Zr5qZ'. |
'rpqYwJuXyZuXrJmVw5mUxZiTxJeTw5eTq5WRwJWPtJKOvZKKuI'. |
'6Kt42Kn4yJt42ItIuGsomFsYmEsIiEr4eDr4eBrIR/qoN+qIJ8'. |
'poB7pH56o356on14nnt2nXl0mndzmnZzmXZymHVwlXNvlHJukn'. |
'FtiHBqjm1qjW1oi2toiWpniWplh2hlhmdkhWdig2VggGNgf2Je'. |
'fmFdfGBde19bbl1aeFxXdFpWclhVclhVcVdUcFZTb1VSbVRQal'. |
'JPaVFKY0xKYkxJYUtIYEpHX0lEWkZCWERCV0NCVkM/U0A+U0A+'. |
'UUA+UEA9Uj89UT48Tj45TDvewfrHAAAAAXRSTlMAQObYZgAAAA'. |
'FiS0dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElN'. |
'RQfTAwkUKCFozUQjAAAATUlEQVR4nGNgQAGcoqrcEJYQB5OhSw'. |
'CIxSXGwWThGcIDZCppK5o7hyV6AZl6NnbuoSmFICZ3YHB0RkkJ'. |
'SAFDbEJaSUkJxAjeyEheVOMBQj4MOEkWew4AAAAASUVORK5CYI'. |
'I=' ; |
//========================================================== |
// File: bxs_cyan.png |
//========================================================== |
$this->imgdata_xsmall[11][0]= 530 ; |
$this->imgdata_xsmall[11][1]= |
'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAABPl'. |
'BMVEX////////F///AwMCvxsaC1NSC0dGCz8+CzMyA//94//91'. |
'//9q//9j//9X4uJX09NXz89Xx8dXxMRL//9L5uZL3d1L2NhLxs'. |
'ZLt7cv//8e9fUe8fEe7u4e398epqYehoYX//8L+PgK//8F9fUE'. |
'/v4E5+cEb28EZ2cC//8C/v4C/f0CzMwCrq4Cjo4CdXUCaWkCZW'. |
'UB/PwA//8A/f0A+/sA8/MA7e0A7OwA6+sA5eUA5OQA4uIA4eEA'. |
'3NwA2toA2NgA1dUA09MA0tIA0NAAysoAxsYAxcUAxMQAv78Avr'. |
'4AvLwAtrYAtbUAs7MAsLAAra0Aq6sAqKgApaUApKQAoqIAoKAA'. |
'n58AmpoAlZUAk5MAkpIAkJAAj48AjIwAiYkAh4cAf38AfX0Ae3'. |
'sAenoAcnIAcHAAa2sAaWkAaGgAYmIUPEuTAAAAAXRSTlMAQObY'. |
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAA'. |
'AHdElNRQfTAwkUKQFKuFWqAAAATUlEQVR4nGNgQAGsUjJsEJaR'. |
'grC5qz9YzIiL28YriB3IlDZRsnYNiZUDMmXtHT2CE9JBTDb/wI'. |
'jkzEyQAoaomMTMzEyIERzy8hyoxgMAN2MLVPW0f4gAAAAASUVO'. |
'RK5CYII=' ; |
//========================================================== |
// File: bxs_orange.png |
//========================================================== |
$this->imgdata_xsmall[12][0]= 572 ; |
$this->imgdata_xsmall[12][1]= |
'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAABaF'. |
'BMVEX//////////8X/3oD/3nj/1HX/0Gr/xGP/rkv/gBf+iS/2'. |
'bAL1agDxaQDuZwDrZwLpZQDmZQLlZADjcx7gZATeYQDdZgraXw'. |
'DZXwHYXgDXiEvXZAvUjlfUXwXTjVfTbR7ShUvRbR7RWwDMWQDL'. |
'WADKooLKWADJoYLJgkvHWATGoILFn4LFgEvFVgDEZx7EVQDDt6'. |
'/DVQDCt6/CnoLChlfCVADAwMC+hFe+UgC8UgC6UQC4gVe4UAC3'. |
'gVe3UAC1gFe1eUu1TwC1TgCzTgCwTQKuTACrSgCqSgCpSgCpSQ'. |
'CodEulSACkRwCiRgCdRACcRACaQwCYQgCWQgKVQQCVQACUQACS'. |
'UR6RPwCOPgCNPQCLPACKPACJOwCEOQCBOAB+NwB9NgB8NgB7NQ'. |
'B6NwJ4NAB3RR52MwB0MgBuLwBtLwBsLwBqLgBpLQBkLQJiKgBh'. |
'KgBgKwRcKABbKQJbJwBaKQRaJwBYKAJVJQDZvdIYAAAAAXRSTl'. |
'MAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9k'. |
'X5EAAAAHdElNRQfTAwkUJBSSy88MAAAATUlEQVR4nGNgQAGqwo'. |
'paEBYPJ4eKezCIpc7HwmrqG6ENZMpLihm6RaWEAZl6Vo7ekRnF'. |
'IKZWSHhcTnk5SAFDfFJWeXk5xAjj1FRjVOMBeFwNcWYSLjsAAA'. |
'AASUVORK5CYII=' ; |
//========================================================== |
// File: bxs_lightblue.png |
//========================================================== |
$this->imgdata_xsmall[13][0]= 554 ; |
$this->imgdata_xsmall[13][1]= |
'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAC67D+PAAABVl'. |
'BMVEX////////d///AwMC7wcS08P+y+P+xxdCwxM+uws2twMur'. |
'vsinzNynytylzuKhyN6e5v6d5P+d1fOcwNWcu8ub4f+at8iZ3v'. |
'+ZvdGY2/yW2f+VscGU1vuT1fqTr72Sx+SSxeKR0fWRz/GPz/OP'. |
'rr+OyeqMy+6Myu2LyeyKxueJudSGw+SGorGDvt+Cvd6CvN2Aud'. |
'p+uNd+t9Z9tdV8tdR8tNN6sc94r813rct2q8h0qcZ0qMVzp8Rx'. |
'o8Bwor5tn7ptnrptnrlsnbhqmbRpmbNpi51ol7Flkqtkkqtkka'. |
'pjj6hijaRhjaZgi6NfiqJfiaFdh55bhJtag5pZgphYgJZYf5VX'. |
'cn9Ve5FSeI1RdopRdYlQdYlPc4dPcoZPcoVNcINLboBLbH9GZn'. |
'hGZXdFZHZEY3RDYnJCXW4/W2s/WWg+Wmo7VmU7VGM7U2E6VGM6'. |
'VGI5UV82T1wGxheQAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHU'. |
'gAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElNRQfTAwkUJziL'. |
'PvAsAAAATUlEQVR4nGNgQAHsQgqcEJYgG5Oegy+IxSHOxmTiFs'. |
'gFZMprKBnbB8e7AplaFlbOQUl5ICanX0BEWmEhSAFDVGxKYWEh'. |
'xAjusDBuVOMBJO8LrFHRAykAAAAASUVORK5CYII=' ; |
//========================================================== |
// File: bxs_darkgray.png |
//========================================================== |
$this->imgdata_xsmall[14][0]= 574 ; |
$this->imgdata_xsmall[14][1]= |
'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABm'. |
'JLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsRAAALEQF/ZF+RAAAB'. |
'iElEQVR42k3QPU8TYRwA8P//ebkXrgdIColXRAOEkJqbaExMut'. |
'DBhE1GNjYHPg+DG6ODiU6QOLjVxITBcFKBYCstlAC2Bz17fe76'. |
'vLD6+wg/1FpTRFR5lpaub/u1eGBGaAT4HneD4OlXx7avtDYUjT'. |
'HQabd2Ti8e3vVSKzxrtHS32wIpFVldno22Nqvvg2Bhl0gp/aNm'. |
'vJ3qqXAtLIva+ks1H0wqlSXi4+d6+OFTfRsAfHJx2d1od24rZP'. |
'xP2HzopINr1mkesX7ccojqif0v9crxWXODZTno3+dNGA7uWLsd'. |
'mUYU4fHJCViMG9umLBmM4L6fagZGg9QKfjZ+Qfy3C3G/B3mugF'. |
'IHHNcDf64E3KJALApk2p8CSolUUqLjFkyxOGMsTtFyJ+Wz57NQ'. |
'8DghS4sLB0svioeZZo7nPhFoUKZDIVFbglkTTnl5/rC8snjAkJ'. |
'Bk/XV5LxHC/v7tR8jzTFPbg8LENK9WX0Vv31T2AEmCSmlKCCoh'. |
'ROnP1U1tPFYjJBRcbtzSf+GPsFTAQBq1n4AAAABKdEVYdHNpZ2'. |
'5hdHVyZQBiYzYyMDIyNjgwYThjODMyMmUxNjk0NWUzZjljOGFh'. |
'N2VmZWFhMjA4OTE2ZjkwOTdhZWE1MzYyMjk0MWRkM2I5EqaPDA'. |
'AAAABJRU5ErkJggg==' ; |
} |
} |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/jpgraph_log.php |
---|
New file |
0,0 → 1,305 |
<?php |
/*======================================================================= |
// File: JPGRAPH_LOG.PHP |
// Description: Log scale plot extension for JpGraph |
// Created: 2001-01-08 |
// Ver: $Id: jpgraph_log.php 1106 2009-02-22 20:16:35Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
*/ |
DEFINE('LOGLABELS_PLAIN',0); |
DEFINE('LOGLABELS_MAGNITUDE',1); |
//=================================================== |
// CLASS LogScale |
// Description: Logarithmic scale between world and screen |
//=================================================== |
class LogScale extends LinearScale { |
//--------------- |
// CONSTRUCTOR |
// Log scale is specified using the log of min and max |
function __construct($min,$max,$type="y") { |
parent::__construct($min,$max,$type); |
$this->ticks = new LogTicks(); |
$this->name = 'log'; |
} |
//---------------- |
// PUBLIC METHODS |
// Translate between world and screen |
function Translate($a) { |
if( !is_numeric($a) ) { |
if( $a != '' && $a != '-' && $a != 'x' ) { |
JpGraphError::RaiseL(11001); |
// ('Your data contains non-numeric values.'); |
} |
return 1; |
} |
if( $a < 0 ) { |
JpGraphError::RaiseL(11002); |
//("Negative data values can not be used in a log scale."); |
exit(1); |
} |
if( $a==0 ) $a=1; |
$a=log10($a); |
return ceil($this->off + ($a*1.0 - $this->scale[0]) * $this->scale_factor); |
} |
// Relative translate (don't include offset) usefull when we just want |
// to know the relative position (in pixels) on the axis |
function RelTranslate($a) { |
if( !is_numeric($a) ) { |
if( $a != '' && $a != '-' && $a != 'x' ) { |
JpGraphError::RaiseL(11001); |
//('Your data contains non-numeric values.'); |
} |
return 1; |
} |
if( $a==0 ) { |
$a=1; |
} |
$a=log10($a); |
return round(($a*1.0 - $this->scale[0]) * $this->scale_factor); |
} |
// Use bcpow() for increased precision |
function GetMinVal() { |
if( function_exists("bcpow") ) { |
return round(bcpow(10,$this->scale[0],15),14); |
} |
else { |
return round(pow(10,$this->scale[0]),14); |
} |
} |
function GetMaxVal() { |
if( function_exists("bcpow") ) { |
return round(bcpow(10,$this->scale[1],15),14); |
} |
else { |
return round(pow(10,$this->scale[1]),14); |
} |
} |
// Logarithmic autoscaling is much simplier since we just |
// set the min and max to logs of the min and max values. |
// Note that for log autoscale the "maxstep" the fourth argument |
// isn't used. This is just included to give the method the same |
// signature as the linear counterpart. |
function AutoScale($img,$min,$max,$maxsteps,$majend=true) { |
if( $min==0 ) $min=1; |
if( $max <= 0 ) { |
JpGraphError::RaiseL(11004); |
//('Scale error for logarithmic scale. You have a problem with your data values. The max value must be greater than 0. It is mathematically impossible to have 0 in a logarithmic scale.'); |
} |
if( is_numeric($this->autoscale_min) ) { |
$smin = round($this->autoscale_min); |
$smax = ceil(log10($max)); |
if( $min >= $max ) { |
JpGraphError::RaiseL(25071);//('You have specified a min value with SetAutoMin() which is larger than the maximum value used for the scale. This is not possible.'); |
} |
} |
else { |
$smin = floor(log10($min)); |
if( is_numeric($this->autoscale_max) ) { |
$smax = round($this->autoscale_max); |
if( $smin >= $smax ) { |
JpGraphError::RaiseL(25072);//('You have specified a max value with SetAutoMax() which is smaller than the miminum value used for the scale. This is not possible.'); |
} |
} |
else |
$smax = ceil(log10($max)); |
} |
$this->Update($img,$smin,$smax); |
} |
//--------------- |
// PRIVATE METHODS |
} // Class |
//=================================================== |
// CLASS LogTicks |
// Description: |
//=================================================== |
class LogTicks extends Ticks{ |
private $label_logtype=LOGLABELS_MAGNITUDE; |
private $ticklabels_pos = array(); |
//--------------- |
// CONSTRUCTOR |
function LogTicks() { |
} |
//--------------- |
// PUBLIC METHODS |
function IsSpecified() { |
return true; |
} |
function SetLabelLogType($aType) { |
$this->label_logtype = $aType; |
} |
// For log scale it's meaningless to speak about a major step |
// We just return -1 to make the framework happy (specifically |
// StrokeLabels() ) |
function GetMajor() { |
return -1; |
} |
function SetTextLabelStart($aStart) { |
JpGraphError::RaiseL(11005); |
//('Specifying tick interval for a logarithmic scale is undefined. Remove any calls to SetTextLabelStart() or SetTextTickInterval() on the logarithmic scale.'); |
} |
function SetXLabelOffset($dummy) { |
// For log scales we dont care about XLabel offset |
} |
// Draw ticks on image "img" using scale "scale". The axis absolute |
// position in the image is specified in pos, i.e. for an x-axis |
// it specifies the absolute y-coord and for Y-ticks it specified the |
// absolute x-position. |
function Stroke($img,$scale,$pos) { |
$start = $scale->GetMinVal(); |
$limit = $scale->GetMaxVal(); |
$nextMajor = 10*$start; |
$step = $nextMajor / 10.0; |
$img->SetLineWeight($this->weight); |
if( $scale->type == "y" ) { |
// member direction specified if the ticks should be on |
// left or right side. |
$a=$pos + $this->direction*$this->GetMinTickAbsSize(); |
$a2=$pos + $this->direction*$this->GetMajTickAbsSize(); |
$count=1; |
$this->maj_ticks_pos[0]=$scale->Translate($start); |
$this->maj_ticklabels_pos[0]=$scale->Translate($start); |
if( $this->supress_first ) |
$this->maj_ticks_label[0]=""; |
else { |
if( $this->label_formfunc != '' ) { |
$f = $this->label_formfunc; |
$this->maj_ticks_label[0]=call_user_func($f,$start); |
} |
elseif( $this->label_logtype == LOGLABELS_PLAIN ) { |
$this->maj_ticks_label[0]=$start; |
} |
else { |
$this->maj_ticks_label[0]='10^'.round(log10($start)); |
} |
} |
$i=1; |
for($y=$start; $y<=$limit; $y+=$step,++$count ) { |
$ys=$scale->Translate($y); |
$this->ticks_pos[]=$ys; |
$this->ticklabels_pos[]=$ys; |
if( $count % 10 == 0 ) { |
if( !$this->supress_tickmarks ) { |
if( $this->majcolor!="" ) { |
$img->PushColor($this->majcolor); |
$img->Line($pos,$ys,$a2,$ys); |
$img->PopColor(); |
} |
else { |
$img->Line($pos,$ys,$a2,$ys); |
} |
} |
$this->maj_ticks_pos[$i]=$ys; |
$this->maj_ticklabels_pos[$i]=$ys; |
if( $this->label_formfunc != '' ) { |
$f = $this->label_formfunc; |
$this->maj_ticks_label[$i]=call_user_func($f,$nextMajor); |
} |
elseif( $this->label_logtype == 0 ) { |
$this->maj_ticks_label[$i]=$nextMajor; |
} |
else { |
$this->maj_ticks_label[$i]='10^'.round(log10($nextMajor)); |
} |
++$i; |
$nextMajor *= 10; |
$step *= 10; |
$count=1; |
} |
else { |
if( !$this->supress_tickmarks && !$this->supress_minor_tickmarks) { |
if( $this->mincolor!="" ) { |
$img->PushColor($this->mincolor); |
} |
$img->Line($pos,$ys,$a,$ys); |
if( $this->mincolor!="" ) { |
$img->PopColor(); |
} |
} |
} |
} |
} |
else { |
$a=$pos - $this->direction*$this->GetMinTickAbsSize(); |
$a2=$pos - $this->direction*$this->GetMajTickAbsSize(); |
$count=1; |
$this->maj_ticks_pos[0]=$scale->Translate($start); |
$this->maj_ticklabels_pos[0]=$scale->Translate($start); |
if( $this->supress_first ) { |
$this->maj_ticks_label[0]=""; |
} |
else { |
if( $this->label_formfunc != '' ) { |
$f = $this->label_formfunc; |
$this->maj_ticks_label[0]=call_user_func($f,$start); |
} |
elseif( $this->label_logtype == 0 ) { |
$this->maj_ticks_label[0]=$start; |
} |
else { |
$this->maj_ticks_label[0]='10^'.round(log10($start)); |
} |
} |
$i=1; |
for($x=$start; $x<=$limit; $x+=$step,++$count ) { |
$xs=$scale->Translate($x); |
$this->ticks_pos[]=$xs; |
$this->ticklabels_pos[]=$xs; |
if( $count % 10 == 0 ) { |
if( !$this->supress_tickmarks ) { |
$img->Line($xs,$pos,$xs,$a2); |
} |
$this->maj_ticks_pos[$i]=$xs; |
$this->maj_ticklabels_pos[$i]=$xs; |
if( $this->label_formfunc != '' ) { |
$f = $this->label_formfunc; |
$this->maj_ticks_label[$i]=call_user_func($f,$nextMajor); |
} |
elseif( $this->label_logtype == 0 ) { |
$this->maj_ticks_label[$i]=$nextMajor; |
} |
else { |
$this->maj_ticks_label[$i]='10^'.round(log10($nextMajor)); |
} |
++$i; |
$nextMajor *= 10; |
$step *= 10; |
$count=1; |
} |
else { |
if( !$this->supress_tickmarks && !$this->supress_minor_tickmarks) { |
$img->Line($xs,$pos,$xs,$a); |
} |
} |
} |
} |
return true; |
} |
} // Class |
/* EOF */ |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/jpgraph_plotline.php |
---|
New file |
0,0 → 1,138 |
<?php |
/*======================================================================= |
// File: JPGRAPH_PLOTLINE.PHP |
// Description: PlotLine extension for JpGraph |
// Created: 2009-03-24 |
// Ver: $Id: jpgraph_plotline.php 1881 2009-10-01 10:28:12Z ljp $ |
// |
// CLASS PlotLine |
// Data container class to hold properties for a static |
// line that is drawn directly in the plot area. |
// Useful to add static borders inside a plot to show for example set-values |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
*/ |
class PlotLine { |
public $scaleposition, $direction=-1; |
protected $weight=1; |
protected $color = 'black'; |
private $legend='',$hidelegend=false, $legendcsimtarget='', $legendcsimalt='',$legendcsimwintarget=''; |
private $iLineStyle='solid'; |
public $numpoints=0; // Needed since the framework expects this property |
function __construct($aDir=HORIZONTAL,$aPos=0,$aColor='black',$aWeight=1) { |
$this->direction = $aDir; |
$this->color=$aColor; |
$this->weight=$aWeight; |
$this->scaleposition=$aPos; |
} |
function SetLegend($aLegend,$aCSIM='',$aCSIMAlt='',$aCSIMWinTarget='') { |
$this->legend = $aLegend; |
$this->legendcsimtarget = $aCSIM; |
$this->legendcsimwintarget = $aCSIMWinTarget; |
$this->legendcsimalt = $aCSIMAlt; |
} |
function HideLegend($f=true) { |
$this->hidelegend = $f; |
} |
function SetPosition($aScalePosition) { |
$this->scaleposition=$aScalePosition; |
} |
function SetDirection($aDir) { |
$this->direction = $aDir; |
} |
function SetColor($aColor) { |
$this->color=$aColor; |
} |
function SetWeight($aWeight) { |
$this->weight=$aWeight; |
} |
function SetLineStyle($aStyle) { |
$this->iLineStyle = $aStyle; |
} |
//--------------- |
// PRIVATE METHODS |
function DoLegend($graph) { |
if( !$this->hidelegend ) $this->Legend($graph); |
} |
// Framework function the chance for each plot class to set a legend |
function Legend($aGraph) { |
if( $this->legend != '' ) { |
$dummyPlotMark = new PlotMark(); |
$lineStyle = 1; |
$aGraph->legend->Add($this->legend,$this->color,$dummyPlotMark,$lineStyle, |
$this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget); |
} |
} |
function PreStrokeAdjust($aGraph) { |
// Nothing to do |
} |
// Called by framework to allow the object to draw |
// optional information in the margin area |
function StrokeMargin($aImg) { |
// Nothing to do |
} |
// Framework function to allow the object to adjust the scale |
function PrescaleSetup($aGraph) { |
// Nothing to do |
} |
function Min() { |
return array(null,null); |
} |
function Max() { |
return array(null,null); |
} |
function _Stroke($aImg,$aMinX,$aMinY,$aMaxX,$aMaxY,$aXPos,$aYPos) { |
$aImg->SetColor($this->color); |
$aImg->SetLineWeight($this->weight); |
$oldStyle = $aImg->SetLineStyle($this->iLineStyle); |
if( $this->direction == VERTICAL ) { |
$ymin_abs = $aMinY; |
$ymax_abs = $aMaxY; |
$xpos_abs = $aXPos; |
$aImg->StyleLine($xpos_abs, $ymin_abs, $xpos_abs, $ymax_abs); |
} |
elseif( $this->direction == HORIZONTAL ) { |
$xmin_abs = $aMinX; |
$xmax_abs = $aMaxX; |
$ypos_abs = $aYPos; |
$aImg->StyleLine($xmin_abs, $ypos_abs, $xmax_abs, $ypos_abs); |
} |
else { |
JpGraphError::RaiseL(25125);//(" Illegal direction for static line"); |
} |
$aImg->SetLineStyle($oldStyle); |
} |
function Stroke($aImg,$aXScale,$aYScale) { |
$this->_Stroke($aImg, |
$aImg->left_margin, |
$aYScale->Translate($aYScale->GetMinVal()), |
$aImg->width-$aImg->right_margin, |
$aYScale->Translate($aYScale->GetMaxVal()), |
$aXScale->Translate($this->scaleposition), |
$aYScale->Translate($this->scaleposition) |
); |
} |
} |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/jpgraph_iconplot.php |
---|
New file |
0,0 → 1,190 |
<?php |
//======================================================================= |
// File: JPGRAPH_ICONPLOT.PHP |
// Description: Extension module to add icons to plots |
// Created: 2004-02-18 |
// Ver: $Id: jpgraph_iconplot.php 1404 2009-06-28 15:25:41Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
//=================================================== |
// CLASS IconPlot |
// Description: Make it possible to add a (small) image |
// to the graph |
//=================================================== |
class IconPlot { |
public $iX=0,$iY=0,$iScale=1.0,$iMix=100; |
private $iHorAnchor='left',$iVertAnchor='top'; |
private $iFile=''; |
private $iAnchors = array('left','right','top','bottom','center'); |
private $iCountryFlag='',$iCountryStdSize=3; |
private $iScalePosY=null,$iScalePosX=null; |
private $iImgString=''; |
function __construct($aFile="",$aX=0,$aY=0,$aScale=1.0,$aMix=100) { |
$this->iFile = $aFile; |
$this->iX=$aX; |
$this->iY=$aY; |
$this->iScale= $aScale; |
if( $aMix < 0 || $aMix > 100 ) { |
JpGraphError::RaiseL(8001); //('Mix value for icon must be between 0 and 100.'); |
} |
$this->iMix = $aMix ; |
} |
function SetCountryFlag($aFlag,$aX=0,$aY=0,$aScale=1.0,$aMix=100,$aStdSize=3) { |
$this->iCountryFlag = $aFlag; |
$this->iX=$aX; |
$this->iY=$aY; |
$this->iScale= $aScale; |
if( $aMix < 0 || $aMix > 100 ) { |
JpGraphError::RaiseL(8001);//'Mix value for icon must be between 0 and 100.'); |
} |
$this->iMix = $aMix; |
$this->iCountryStdSize = $aStdSize; |
} |
function SetPos($aX,$aY) { |
$this->iX=$aX; |
$this->iY=$aY; |
} |
function CreateFromString($aStr) { |
$this->iImgString = $aStr; |
} |
function SetScalePos($aX,$aY) { |
$this->iScalePosX = $aX; |
$this->iScalePosY = $aY; |
} |
function SetScale($aScale) { |
$this->iScale = $aScale; |
} |
function SetMix($aMix) { |
if( $aMix < 0 || $aMix > 100 ) { |
JpGraphError::RaiseL(8001);//('Mix value for icon must be between 0 and 100.'); |
} |
$this->iMix = $aMix ; |
} |
function SetAnchor($aXAnchor='left',$aYAnchor='center') { |
if( !in_array($aXAnchor,$this->iAnchors) || |
!in_array($aYAnchor,$this->iAnchors) ) { |
JpGraphError::RaiseL(8002);//("Anchor position for icons must be one of 'top', 'bottom', 'left', 'right' or 'center'"); |
} |
$this->iHorAnchor=$aXAnchor; |
$this->iVertAnchor=$aYAnchor; |
} |
function PreStrokeAdjust($aGraph) { |
// Nothing to do ... |
} |
function DoLegend($aGraph) { |
// Nothing to do ... |
} |
function Max() { |
return array(false,false); |
} |
// The next four function are framework function tht gets called |
// from Gantt and is not menaiungfull in the context of Icons but |
// they must be implemented to avoid errors. |
function GetMaxDate() { return false; } |
function GetMinDate() { return false; } |
function GetLineNbr() { return 0; } |
function GetAbsHeight() {return 0; } |
function Min() { |
return array(false,false); |
} |
function StrokeMargin(&$aImg) { |
return true; |
} |
function Stroke($aImg,$axscale=null,$ayscale=null) { |
$this->StrokeWithScale($aImg,$axscale,$ayscale); |
} |
function StrokeWithScale($aImg,$axscale,$ayscale) { |
if( $this->iScalePosX === null || $this->iScalePosY === null || |
$axscale === null || $ayscale === null ) { |
$this->_Stroke($aImg); |
} |
else { |
$this->_Stroke($aImg, |
round($axscale->Translate($this->iScalePosX)), |
round($ayscale->Translate($this->iScalePosY))); |
} |
} |
function GetWidthHeight() { |
$dummy=0; |
return $this->_Stroke($dummy,null,null,true); |
} |
function _Stroke($aImg,$x=null,$y=null,$aReturnWidthHeight=false) { |
if( $this->iFile != '' && $this->iCountryFlag != '' ) { |
JpGraphError::RaiseL(8003);//('It is not possible to specify both an image file and a country flag for the same icon.'); |
} |
if( $this->iFile != '' ) { |
$gdimg = Graph::LoadBkgImage('',$this->iFile); |
} |
elseif( $this->iImgString != '') { |
$gdimg = Image::CreateFromString($this->iImgString); |
} |
else { |
if( ! class_exists('FlagImages',false) ) { |
JpGraphError::RaiseL(8004);//('In order to use Country flags as icons you must include the "jpgraph_flags.php" file.'); |
} |
$fobj = new FlagImages($this->iCountryStdSize); |
$dummy=''; |
$gdimg = $fobj->GetImgByName($this->iCountryFlag,$dummy); |
} |
$iconw = imagesx($gdimg); |
$iconh = imagesy($gdimg); |
if( $aReturnWidthHeight ) { |
return array(round($iconw*$this->iScale),round($iconh*$this->iScale)); |
} |
if( $x !== null && $y !== null ) { |
$this->iX = $x; $this->iY = $y; |
} |
if( $this->iX >= 0 && $this->iX <= 1.0 ) { |
$w = imagesx($aImg->img); |
$this->iX = round($w*$this->iX); |
} |
if( $this->iY >= 0 && $this->iY <= 1.0 ) { |
$h = imagesy($aImg->img); |
$this->iY = round($h*$this->iY); |
} |
if( $this->iHorAnchor == 'center' ) |
$this->iX -= round($iconw*$this->iScale/2); |
if( $this->iHorAnchor == 'right' ) |
$this->iX -= round($iconw*$this->iScale); |
if( $this->iVertAnchor == 'center' ) |
$this->iY -= round($iconh*$this->iScale/2); |
if( $this->iVertAnchor == 'bottom' ) |
$this->iY -= round($iconh*$this->iScale); |
$aImg->CopyMerge($gdimg,$this->iX,$this->iY,0,0, |
round($iconw*$this->iScale),round($iconh*$this->iScale), |
$iconw,$iconh, |
$this->iMix); |
} |
} |
?> |
/tags/v1.0-aigle/composants/statistiques/lib/gd_image.inc.php |
---|
New file |
0,0 → 1,2021 |
<?php |
//======================================================================= |
// File: GD_IMAGE.INC.PHP |
// Description: PHP Graph Plotting library. Low level image drawing routines |
// Created: 2001-01-08, refactored 2008-03-29 |
// Ver: $Id: gd_image.inc.php 1922 2010-01-11 11:42:50Z ljp $ |
// |
// Copyright (c) Aditus Consulting. All rights reserved. |
//======================================================================== |
require_once 'jpgraph_rgb.inc.php'; |
require_once 'jpgraph_ttf.inc.php'; |
// Line styles |
define('LINESTYLE_SOLID',1); |
define('LINESTYLE_DOTTED',2); |
define('LINESTYLE_DASHED',3); |
define('LINESTYLE_LONGDASH',4); |
// The DEFAULT_GFORMAT sets the default graphic encoding format, i.e. |
// PNG, JPG or GIF depending on what is installed on the target system |
// in that order. |
if( !DEFINED("DEFAULT_GFORMAT") ) { |
define("DEFAULT_GFORMAT","auto"); |
} |
//======================================================================== |
// CLASS Image |
// Description: The very coor image drawing class that encapsulates all |
// calls to the GD library |
// Note: The class used by the library is the decendant |
// class RotImage which extends the Image class with transparent |
// rotation. |
//========================================================================= |
class Image { |
public $left_margin=30,$right_margin=30,$top_margin=20,$bottom_margin=30; |
public $img=null; |
public $plotwidth=0,$plotheight=0; |
public $width=0, $height=0; |
public $rgb=null; |
public $current_color,$current_color_name; |
public $line_weight=1, $line_style=LINESTYLE_SOLID; |
public $img_format; |
public $ttf=null; |
protected $expired=true; |
protected $lastx=0, $lasty=0; |
protected $obs_list=array(); |
protected $font_size=12,$font_family=FF_FONT1, $font_style=FS_NORMAL; |
protected $font_file=''; |
protected $text_halign="left",$text_valign="bottom"; |
protected $use_anti_aliasing=false; |
protected $quality=null; |
protected $colorstack=array(),$colorstackidx=0; |
protected $canvascolor = 'white' ; |
protected $langconv = null ; |
protected $iInterlace=false; |
protected $bbox_cache = array(); // STore the last found tetx bounding box |
//--------------- |
// CONSTRUCTOR |
function __construct($aWidth=0,$aHeight=0,$aFormat=DEFAULT_GFORMAT,$aSetAutoMargin=true) { |
$this->CreateImgCanvas($aWidth,$aHeight); |
if( $aSetAutoMargin ) { |
$this->SetAutoMargin(); |
} |
if( !$this->SetImgFormat($aFormat) ) { |
JpGraphError::RaiseL(25081,$aFormat);//("JpGraph: Selected graphic format is either not supported or unknown [$aFormat]"); |
} |
$this->ttf = new TTF(); |
$this->langconv = new LanguageConv(); |
} |
// Enable interlacing in images |
function SetInterlace($aFlg=true) { |
$this->iInterlace=$aFlg; |
} |
// Should we use anti-aliasing. Note: This really slows down graphics! |
function SetAntiAliasing($aFlg=true) { |
$this->use_anti_aliasing = $aFlg; |
if( function_exists('imageantialias') ) { |
imageantialias($this->img,$aFlg); |
} |
else { |
JpGraphError::RaiseL(25128);//('The function imageantialias() is not available in your PHP installation. Use the GD version that comes with PHP and not the standalone version.') |
} |
} |
function GetAntiAliasing() { |
return $this->use_anti_aliasing ; |
} |
function CreateRawCanvas($aWidth=0,$aHeight=0) { |
if( $aWidth <= 1 || $aHeight <= 1 ) { |
JpGraphError::RaiseL(25082,$aWidth,$aHeight);//("Illegal sizes specified for width or height when creating an image, (width=$aWidth, height=$aHeight)"); |
} |
$this->img = @imagecreatetruecolor($aWidth, $aHeight); |
if( $this->img < 1 ) { |
JpGraphError::RaiseL(25126); |
//die("Can't create truecolor image. Check that you really have GD2 library installed."); |
} |
$this->SetAlphaBlending(); |
if( $this->iInterlace ) { |
imageinterlace($this->img,1); |
} |
if( $this->rgb != null ) { |
$this->rgb->img = $this->img ; |
} |
else { |
$this->rgb = new RGB($this->img); |
} |
} |
function CloneCanvasH() { |
$oldimage = $this->img; |
$this->CreateRawCanvas($this->width,$this->height); |
imagecopy($this->img,$oldimage,0,0,0,0,$this->width,$this->height); |
return $oldimage; |
} |
function CreateImgCanvas($aWidth=0,$aHeight=0) { |
$old = array($this->img,$this->width,$this->height); |
$aWidth = round($aWidth); |
$aHeight = round($aHeight); |
$this->width=$aWidth; |
$this->height=$aHeight; |
if( $aWidth==0 || $aHeight==0 ) { |
// We will set the final size later. |
// Note: The size must be specified before any other |
// img routines that stroke anything are called. |
$this->img = null; |
$this->rgb = null; |
return $old; |
} |
$this->CreateRawCanvas($aWidth,$aHeight); |
// Set canvas color (will also be the background color for a |
// a pallett image |
$this->SetColor($this->canvascolor); |
$this->FilledRectangle(0,0,$aWidth-1,$aHeight-1); |
return $old ; |
} |
function CopyCanvasH($aToHdl,$aFromHdl,$aToX,$aToY,$aFromX,$aFromY,$aWidth,$aHeight,$aw=-1,$ah=-1) { |
if( $aw === -1 ) { |
$aw = $aWidth; |
$ah = $aHeight; |
$f = 'imagecopyresized'; |
} |
else { |
$f = 'imagecopyresampled'; |
} |
$f($aToHdl,$aFromHdl,$aToX,$aToY,$aFromX,$aFromY, $aWidth,$aHeight,$aw,$ah); |
} |
function Copy($fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth=-1,$fromHeight=-1) { |
$this->CopyCanvasH($this->img,$fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth,$fromHeight); |
} |
function CopyMerge($fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth=-1,$fromHeight=-1,$aMix=100) { |
if( $aMix == 100 ) { |
$this->CopyCanvasH($this->img,$fromImg, |
$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth,$fromHeight); |
} |
else { |
if( ($fromWidth != -1 && ($fromWidth != $toWidth)) || ($fromHeight != -1 && ($fromHeight != $fromHeight)) ) { |
// Create a new canvas that will hold the re-scaled original from image |
if( $toWidth <= 1 || $toHeight <= 1 ) { |
JpGraphError::RaiseL(25083);//('Illegal image size when copying image. Size for copied to image is 1 pixel or less.'); |
} |
$tmpimg = @imagecreatetruecolor($toWidth, $toHeight); |
if( $tmpimg < 1 ) { |
JpGraphError::RaiseL(25084);//('Failed to create temporary GD canvas. Out of memory ?'); |
} |
$this->CopyCanvasH($tmpimg,$fromImg,0,0,0,0, |
$toWidth,$toHeight,$fromWidth,$fromHeight); |
$fromImg = $tmpimg; |
} |
imagecopymerge($this->img,$fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$aMix); |
} |
} |
static function GetWidth($aImg=null) { |
if( $aImg === null ) { |
$aImg = $this->img; |
} |
return imagesx($aImg); |
} |
static function GetHeight($aImg=null) { |
if( $aImg === null ) { |
$aImg = $this->img; |
} |
return imagesy($aImg); |
} |
static function CreateFromString($aStr) { |
$img = imagecreatefromstring($aStr); |
if( $img === false ) { |
JpGraphError::RaiseL(25085); |
//('An image can not be created from the supplied string. It is either in a format not supported or the string is representing an corrupt image.'); |
} |
return $img; |
} |
function SetCanvasH($aHdl) { |
$this->img = $aHdl; |
$this->rgb->img = $aHdl; |
} |
function SetCanvasColor($aColor) { |
$this->canvascolor = $aColor ; |
} |
function SetAlphaBlending($aFlg=true) { |
ImageAlphaBlending($this->img,$aFlg); |
} |
function SetAutoMargin() { |
$min_bm=5; |
$lm = min(40,$this->width/7); |
$rm = min(20,$this->width/10); |
$tm = max(5,$this->height/7); |
$bm = max($min_bm,$this->height/6); |
$this->SetMargin($lm,$rm,$tm,$bm); |
} |
//--------------- |
// PUBLIC METHODS |
function SetFont($family,$style=FS_NORMAL,$size=10) { |
$this->font_family=$family; |
$this->font_style=$style; |
$this->font_size=$size; |
$this->font_file=''; |
if( ($this->font_family==FF_FONT1 || $this->font_family==FF_FONT2) && $this->font_style==FS_BOLD ){ |
++$this->font_family; |
} |
if( $this->font_family > FF_FONT2+1 ) { // A TTF font so get the font file |
// Check that this PHP has support for TTF fonts |
if( !function_exists('imagettfbbox') ) { |
JpGraphError::RaiseL(25087);//('This PHP build has not been configured with TTF support. You need to recompile your PHP installation with FreeType support.'); |
} |
$this->font_file = $this->ttf->File($this->font_family,$this->font_style); |
} |
} |
// Get the specific height for a text string |
function GetTextHeight($txt="",$angle=0) { |
$tmp = preg_split('/\n/',$txt); |
$n = count($tmp); |
$m=0; |
for($i=0; $i< $n; ++$i) { |
$m = max($m,strlen($tmp[$i])); |
} |
if( $this->font_family <= FF_FONT2+1 ) { |
if( $angle==0 ) { |
$h = imagefontheight($this->font_family); |
if( $h === false ) { |
JpGraphError::RaiseL(25088);//('You have a misconfigured GD font support. The call to imagefontwidth() fails.'); |
} |
return $n*$h; |
} |
else { |
$w = @imagefontwidth($this->font_family); |
if( $w === false ) { |
JpGraphError::RaiseL(25088);//('You have a misconfigured GD font support. The call to imagefontwidth() fails.'); |
} |
return $m*$w; |
} |
} |
else { |
$bbox = $this->GetTTFBBox($txt,$angle); |
return $bbox[1]-$bbox[5]+1; |
} |
} |
// Estimate font height |
function GetFontHeight($angle=0) { |
$txt = "XOMg"; |
return $this->GetTextHeight($txt,$angle);< |