Update jpgraph

ryzomclassic-develop
kaetemi 3 years ago
parent 8adf8e228a
commit cb47713119
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -0,0 +1,63 @@
README FOR JPGRAPH 4.3.4
=========================
This package contains the JpGraph PHP library version 4.3.4
The library is Copyright (C) 2000-2010 Asial Corporatoin and
released under dual license QPL 1.0 for open source and educational
use and JpGraph Professional License for commercial use.
Please see full license details at
http://jpgraph.net/pro/
http://jpgraph.net/download/
Requirements:
-------------
Miminum:
* PHP 5.1.0 or higher
* GD 2.0.28 or higher
Note: Earlier versions might work but is unsupported.
Recommended:
* >= PHP 5.2.0
* PHP Builtin GD library
Installation
------------
1. Make sure that the PHP version is compatible with the stated
requirements and that the PHP installation has support for
the GD library. Please run phpinfo() to check if GD library
is supported in the installation.
If the GD library doesn't seem to be installed
please consult the PHP manual under section "Image" for
instructions on where to find this library. Please refer to
the manual section "Verifying your PHP installation"
2. Unzip and copy the files to a directory of your choice where Your
httpd sever can access them.
For a global site installation you should copy the files to
somewhere in the PHP search path.
3. Check that the default directory paths in jpg-config.inc.php
for cache directory and TTF directory suits your installation.
Note1: The default directories are different depending on if
the library is running on Windows or UNIX.
Note2: Apache/PHP must have write permission to your cache
directory if you enable the cache feature. By default the cache
is disabled.
Documentation
-------------
The installation includes HTML documentation and reference guide for the
library. The portal page for all documentation is
<YOUR-INSTALLATION-DIRECTORY>/docs/index.html
Bug reports and suggestions
---------------------------
Should be reported using the contact form at
http://jpgraph.net/contact/

@ -0,0 +1,75 @@
<?php
require_once "jpgraph/jpgraph.php";
require_once "jpgraph/jpgraph_canvas.php";
require_once "jpgraph/jpgraph_barcode.php";
$params = array(
array('code',1),array('data',''),array('modwidth',1),array('info',false),
array('notext',false),array('checksum',false),array('showframe',false),
array('vertical',false) , array('backend','IMAGE'), array('file',''),
array('scale',1), array('height',70), array('pswidth','') );
$n=count($params);
for($i=0; $i < $n; ++$i ) {
$v = $params[$i][0];
if( empty($_GET[$params[$i][0]]) ) {
$$v = $params[$i][1];
}
else
$$v = $_GET[$params[$i][0]];
}
if( $modwidth < 1 || $modwidth > 5 ) {
echo "<h4>Module width must be between 1 and 5 pixels</h4>";
}
elseif( $data==="" ) {
echo "<h3>Please enter data to be encoded, select symbology and press 'Ok'.</h3>";
echo "<i>Note: Data must be valid for the choosen encoding.</i>";
}
elseif( $code==-1 ) {
echo "<h4>No code symbology selected.</h4>";
}
elseif( $height < 10 || $height > 500 ) {
echo "<h4> Height must be in range [10, 500]</h4>";
}
elseif( $scale < 0.1 || $scale > 15 ) {
echo "<h4> Scale must be in range [0.1, 15]</h4>";
}
else {
if( $code==20 ) {
$encoder = BarcodeFactory::Create(6);
$encoder->UseExtended();
}
else {
$encoder = BarcodeFactory::Create($code);
}
$b = $backend=='EPS' ? 'PS' : $backend;
$b = substr($backend,0,5) == 'IMAGE' ? 'IMAGE' : $b;
$e = BackendFactory::Create($b,$encoder);
if( substr($backend,0,5) == 'IMAGE' ) {
if( substr($backend,5,1) == 'J' )
$e->SetImgFormat('JPEG');
}
if( $e ) {
if( $backend == 'EPS' )
$e->SetEPS();
if( $pswidth!='' )
$modwidth = $pswidth;
$e->SetModuleWidth($modwidth);
$e->AddChecksum($checksum);
$e->NoText($notext);
$e->SetScale($scale);
$e->SetVertical($vertical);
$e->ShowFrame($showframe);
$e->SetHeight($height);
$r = $e->Stroke($data,$file,$info,$info);
if( $r )
echo nl2br(htmlspecialchars($r));
if( $file != '' )
echo "<p>Wrote file $file.";
}
else
echo "<h3>Can't create choosen backend: $backend.</h3>";
}
?>

@ -0,0 +1,125 @@
<H2>JpGraph Barcode 1.0</h2>
<hr>
</font>
<form name="barcodespec" action="barcode_image.php" target=barcode
method post>
<table cellspacing=4 cellpadding=0>
<tr>
<td colspan=2>
Data:<br>
<input type=text name=data size=25 maxlength=30>
</td>
<tr><td>
Encoding:<br>
<select name=code>
<option selected value=-1> Choose encoding </option>
<option value=4> UPC A </option>
<option value=5> UPC E </option>
<option value=3> EAN 8 </option>
<option value=2> EAN 13 </option>
<option value=1> EAN 128 </option>
<option value=11> Industrial 2 of 5 </option>
<option value=12> Interleaved 2 of 5 </option>
<option value=14> CODE 11 </option>
<option value=6> CODE 39 </option>
<option value=20> CODE 39 Extended </option>
<option value=8> CODE 128 </option>
<option value=13> CODABAR </option>
<option value=10> BOOKLAND (ISBN) </option>
</select>
</td>
<td>
Module width:<br>
<select name=modwidth>
<option value=1> One </option>
<option value=2> Two </option>
<option value=3> Three </option>
<option value=4> Four </option>
<option value=5> Five </option>
</select>
</td>
</tr>
<tr>
<td>
Add checksum:<br>
<input type=checkbox value=1 name=checksum>
</td>
<td>
Hide text:<br>
<input type=checkbox value=1 name=notext>
</td>
</tr>
<tr>
<td>
Show frame:<br>
<input type=checkbox value=1 name=showframe>
</td>
<td>
Vertical layout:<br>
<input type=checkbox value=1 name=vertical>
</td>
</tr>
<tr>
<td>
Height:<br>
<input type=text name=height value="70" size=3 maxlength=3>
</td>
<td>
Scale:<br>
<input type=text name=scale value="1.0" size=4 maxlength=4>
</td>
</tr>
<tr>
<td>
Write to file:<br>
<input type=text name=file size=15 maxlength=80>
</td>
<td>
Format:<br>
<select name=backend>
<option selected value="IMAGEPNG">Image (PNG)</option>
<option value="IMAGEJPG">Image (JPEG)</option>
<option value="PS">Postscript</option>
<option value="EPS">EPS</option>
</select>
</td>
<tr>
<td>
PS module width:
</td>
<td>
<input type=text name=pswidth size=4 maxlength=4><br>
</td>
</tr>
<tr>
<td colspan=2>
<small><i>(If specified will override Module width above)</i></small><br>
</td>
</tr>
<tr>
<td>
Debug info:<br>
<input type=checkbox value=1 name=info>
</td>
<td align=right valign=bottom>
<br>
<input type=submit name=submit value="&nbsp; Create &nbsp;" style="font-weight:bold;">
</td>
</tr></table>
</form>
<p>
<hr>

@ -0,0 +1,10 @@
<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN">
<HTML><HEAD>
<LINK REL=STYLESHEET TYPE="text/css" HREF="de_normal.css">
<title>Barcode SYSTEMTEST</title>
</head>
<frameset cols="280,*">
<frame src=barcode_menu.php name=menu>;
<frame src=barcode_image.php name=barcode>
</frameset>
</html>

@ -0,0 +1,16 @@
<?php
// ==============================================
// Output Image using Code 39 using only default values
// ==============================================
require_once ('jpgraph/jpgraph_barcode.php');
try {
$encoder = BarcodeFactory::Create(ENCODING_CODE39);
$e = BackendFactory::Create(BACKEND_IMAGE,$encoder);
$e->Stroke('abc123');
} catch( JpGraphException $e ) {
//echo 'Error: ' . $e->getMessage()."\n";
JpGraphError::Raise($e->getMessage());
}
?>

@ -0,0 +1,11 @@
<?php
// ==============================================
// Output Image using Code 39 using only default values
// ==============================================
require_once ('jpgraph/jpgraph_barcode.php');
$encoder = BarcodeFactory::Create(ENCODING_CODE39);
$e = BackendFactory::Create(BACKEND_IMAGE,$encoder);
$e->Stroke('ABC123');
?>

@ -0,0 +1,14 @@
<?php
// ==============================================
// Output Image using Code 128
// ==============================================
require_once ('jpgraph/jpgraph_barcode.php');
$encoder = BarcodeFactory::Create(ENCODING_CODE128);
$e = BackendFactory::Create(BACKEND_PS,$encoder);
$e->SetModuleWidth(2);
$e->SetHeight(20);
echo nl2br($e->Stroke('3125134772'));
?>

@ -0,0 +1,14 @@
<?php
// ==============================================
// Output Postscript of nterleaved 2 of 5
// ==============================================
require_once ('jpgraph/jpgraph_barcode.php');
$encoder = BarcodeFactory::Create(ENCODING_CODEI25);
$e = BackendFactory::Create(BACKEND_PS,$encoder);
$e->SetModuleWidth(2);
$e->SetHeight(70);
$ps = $e->Stroke('3125134772');
echo nl2br(htmlspecialchars($ps));
?>

@ -0,0 +1,17 @@
<?php
// ==============================================
// Output Encapsulated Postscript of interleaved 2 of 5
// ==============================================
require_once ('jpgraph/jpgraph_barcode.php');
echo "Start ...<br>";
$encoder = BarcodeFactory::Create(ENCODING_CODEI25);
$e = BackendFactory::Create(BACKEND_PS,$encoder);
$e->SetModuleWidth(2);
$e->SetHeight(70);
$e->SetEPS();
$ps = $e->Stroke('3125134772');
echo nl2br(htmlspecialchars($ps));
?>

@ -0,0 +1,12 @@
<?php
// ==============================================
// Output Image using Code Interleaved 2 of 5
// ==============================================
require_once ('jpgraph/jpgraph_barcode.php');
$encoder = BarcodeFactory::Create(ENCODING_CODEI25);
$e = BackendFactory::Create(BACKEND_IMAGE,$encoder);
$e->SetModuleWidth(2);
$e->Stroke('1234');
?>

@ -0,0 +1,74 @@
<?php
// =======================================================
// Example of how to format US Postal shipping information
// =======================================================
require_once ('jpgraph/jpgraph_barcode.php');
// The Full barcode standard is described in
// http://www.usps.com/cpim/ftp/pubs/pub91/91c4.html#508hdr1
//
// The data start with AI=420 which means
// "Ship to/Deliver To Postal Code (within single authority)
//
class USPS_Confirmation {
function USPS_Confirmation() {
}
// Private utility function
function _USPS_chkd($aData) {
$n = strlen($aData);
// Add all even numbers starting from position 1 from the end
$et = 0 ;
for( $i=1; $i <= $n; $i+=2 ) {
$d = intval(substr($aData,-$i,1));
$et += $d;
}
// Add all odd numbers starting from position 2 from the end
$ot = 0 ;
for( $i=2; $i <= $n; $i+=2 ) {
$d = intval(substr($aData,-$i,1));
$ot += $d;
}
$tot = 3*$et + $ot;
$chkdigit = (10 - ($tot % 10))%10;;
return $chkdigit;
}
// Get type 1 of confirmation code (with ZIP)
function GetPICwithZIP($aZIP,$aServiceType,$aDUNS,$aSeqNbr) {
// Convert to USPS format with AI=420 and extension starting with AI=91
$data = '420'. $aZIP . '91' . $aServiceType . $aDUNS . $aSeqNbr;
// Only calculate the checkdigit from the AI=91 and forward
// and do not include the ~1 (FUNC1) in the calculation
$cd = $this->_USPS_chkd(substr($data,8));
$data = '420'. $aZIP . '~191' . $aServiceType . $aDUNS . $aSeqNbr;
return $data . $cd;
}
// Get type 2 of confirmation code (without ZIP)
function GetPIC($aServiceType,$aDUNS,$aSeqNbr) {
// Convert to USPS format with AI=91
$data = '91' . $aServiceType . $aDUNS . $aSeqNbr;
$cd = $this->_USPS_chkd($data);
return $data . $cd;
}
}
$usps = new USPS_Confirmation();
$zip = '92663';
$service = '21';
$DUNS = '805213907';
$seqnr = '04508735';
$data = $usps->GetPICwithZIP($zip,$service,$DUNS,$seqnr);
//$data = $usps->GetPIC('01','123456789','00000001');
$encoder = BarcodeFactory::Create(ENCODING_EAN128);
$e = BackendFactory::Create(BACKEND_IMAGE,$encoder);
$e->SetModuleWidth(2);
$e->SetFont(FF_ARIAL,FS_NORMAL,14);
$e->Stroke($data);
?>

@ -0,0 +1,281 @@
<?php
require_once('jpgraph/jpgraph_barcode.php');
/*=======================================================================
// File: MKBARCODE.PHP
// Description: Comman line tool to generate linear barcodes
// Created: 2009-06-20
// Ver: $Id: mkbarcode.php 1455 2009-07-03 18:52:25Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//=======================================================================
*/
//----------------------------------------------------------------------
// CLASS ParseArgs
// Parse command line arguments and make sanity checks
//----------------------------------------------------------------------
class ParseArgs {
var $argc,$argv;
function ParseArgs() {
// Get command line argument
$this->argv = ($_SERVER['argv']);
$this->argc = ($_SERVER['argc']);
}
function PrintUsage() {
$n = $this->argv[0];
echo "$n -b <symbology> [-r -h -c -o <output format> -m <width> -s <scale> -y <height> -f <filename> ] datastring \n".
"Create the specified barcode\n".
"-b What symbology to use, one of the following strings (case insensitive)\n".
" UPCA \n".
" UPCE \n".
" EAN128 \n".
" EAN13 \n".
" EAN8 \n".
" CODE11 \n".
" CODE39 \n".
" CODE128 \n".
" CODE25 \n".
" CODEI25 \n".
" CODABAR \n".
" BOOKLAND \n".
"-c Add checkdigit for symbologies where this is optional\n".
"-o Output format. 0=Image, 1=PS, 2=EPS\n".
"-m Module width\n".
"-s Scale factor\n".
"-h Show this help\n".
"-f Filename to write to\n".
"-r Rotate barcode 90 degrees\n".
"-y height Set height in pixels\n".
"-x Hide the human readable text\n".
"--silent Silent. Don't give any error mesages\n";
exit(1);
}
function Get() {
$barcode='code39';
$hide=false;
$checkdigit=false;
$modulewidth=2;
$scale=1;
$output=0;
$filename='';
$data = '';
$rotate = false;
$silent=false;
$height = 70;
if( ($n=$this->GetNum()) > 0 ) {
$i=1;
while( $i <= $n ) {
switch( $this->argv[$i] ) {
case '-h':
$this->PrintUsage();
exit(0);
break;
case '-b':
$barcode = $this->argv[++$i];
break;
case '-o':
$output = (int)$this->argv[++$i];
break;
case '-y':
$height = (int)$this->argv[++$i];
break;
case '-x':
$hide=true;
break;
case '-r':
$rotate=true;
break;
case '-c':
$checkdigit=true;
break;
case '--silent':
$silent=true;
break;
case '-s':
$scale = (float)$this->argv[++$i];
break;
case '-m':
$modulewidth = (float)$this->argv[++$i];
break;
case '-f':
$filename = $this->argv[++$i];
break;
default:
if( $data == '' ) {
$data = $this->argv[$i];
}
else {
$this->PrintUsage();
die("Illegal specified parameters");
}
break;
}
++$i;
}
}
if( $output < 0 || $output > 2 ) {
fwrite(STDERR,"Unkown output format ($output)\n");
exit(1);
}
if( $output === 0 ) {
$modulewidth = floor($modulewidth);
}
// Sanity check
if( $modulewidth > 15 ) {
fwrite(STDERR,"Too large modulewidth\n");
exit(1);
}
// Sanity check
if( $height > 1000 ) {
fwrite(STDERR,"Too large height\n");
exit(1);
}
// Sanity check
if( $scale > 15 ) {
fwrite(STDERR,"Too large scale factor\n");
exit(1);
}
if( strlen($filename) > 256 ) {
fwrite(STDERR,"Too long filename\n");
exit(1);
}
if( trim($data) == '' ) {
fwrite(STDERR,"No input data specified\n");
exit(1);
}
$barcodes = array(
'UPCA' => ENCODING_UPCA,
'UPCE' => ENCODING_UPCE,
'EAN128' => ENCODING_EAN128,
'EAN13' => ENCODING_EAN13,
'EAN8' => ENCODING_EAN8,
'CODE11' => ENCODING_CODE11,
'CODE39' => ENCODING_CODE39,
'CODE128' => ENCODING_CODE128,
'CODE25' => ENCODING_CODE25,
'CODEI25' => ENCODING_CODEI25,
'CODABAR' => ENCODING_CODABAR,
'BOOKLAND' => ENCODING_BOOKLAND,
);
$barcode = strtoupper($barcode);
if( key_exists($barcode,$barcodes) ) {
$barcode = $barcodes[$barcode];
}
else {
fwrite(STDERR,'Specified barcode symbology ('.$barcode.") is not supported\n");
exit(1);
}
$ret = array(
'barcode' => $barcode,
'hide' => $hide,
'modulewidth' => $modulewidth,
'scale' => $scale,
'output' => $output,
'data' => $data,
'silent' => $silent,
'rotate' => $rotate,
'height' => $height,
'checkdigit' => $checkdigit,
'filename' => $filename
);
return $ret;
}
function _Dump() {
var_dump($this->argv);
}
function GetNum() {
return $this->argc-1;
}
}
//----------------------------------------------------------------------
// CLASS Driver
// Main driver class to create barcodes with the parmeters specified on
// the command line.
//----------------------------------------------------------------------
class Driver {
private $iParams;
static public $silent=false;
static public function ErrHandlerPS(Exception $e) {
if( !Driver::$silent )
fwrite(STDERR,$e->getMessage()."\n");
exit(1);
}
static public function ErrHandlerImg(Exception $e) {
if( !Driver::$silent )
fwrite(STDERR,$e->getMessage()."\n");
$errobj = new JpGraphErrObjectImg();
$errobj->Raise($e->getMessage());
exit(1);
}
function Run($aParams) {
$this->iParams = $aParams;
Driver::$silent = $aParams['silent'];
$encoder = BarcodeFactory::Create($aParams['barcode']);
$encoder->AddChecksum($aParams['checkdigit']);
switch( $aParams['output'] ) {
case 0:
$e = BackendFactory::Create(BACKEND_IMAGE,$encoder);
set_exception_handler(array('Driver','ErrHandlerImg'));
break;
case 1:
$e = BackendFactory::Create(BACKEND_PS,$encoder);
set_exception_handler(array('Driver','ErrHandlerPS'));
break;
case 2:
$e = BackendFactory::Create(BACKEND_PS,$encoder);
$e->SetEPS();
set_exception_handler(array('Driver','ErrHandlerPS'));
break;
}
$e->SetHeight($aParams['height']);
$e->SetVertical($aParams['rotate']);
$e->SetModuleWidth($aParams['modulewidth']);
$e->SetScale($aParams['scale']);
$e->HideText($aParams['hide']);
if( $aParams['output'] === 0 ) {
$err = $e->Stroke($aParams['data'], $aParams['filename']);
}
else {
$s = $e->Stroke($aParams['data'], $aParams['filename']);
if( $aParams['filename'] == '' ) {
// If no filename specified then return the generated postscript
echo $s;
}
}
}
}
$pa = new ParseArgs();
$params = $pa->Get();
$driver = new Driver();
$driver->Run($params);
// Successfull termination
exit(0);
?>

@ -0,0 +1,237 @@
class JpCountryFlags {
$iCountryFlags = array(
'Afghanistan' => 'afgh.gif',
'Republic of Angola' => 'agla.gif',
'Republic of Albania' => 'alba.gif',
'Alderney' => 'alde.gif',
'Democratic and Popular Republic of Algeria' => 'alge.gif',
'Territory of American Samoa' => 'amsa.gif',
'Principality of Andorra' => 'andr.gif',
'British Overseas Territory of Anguilla' => 'angu.gif',
'Antarctica' => 'anta.gif',
'Argentine Republic' => 'arge.gif',
'League of Arab States' => 'arle.gif',
'Republic of Armenia' => 'arme.gif',
'Aruba' => 'arub.gif',
'Commonwealth of Australia' => 'astl.gif',
'Republic of Austria' => 'aust.gif',
'Azerbaijani Republic' => 'azer.gif',
'British Antarctic Territory' => 'bant.gif',
'Kingdom of Belgium' => 'belg.gif',
'British Overseas Territory of Bermuda' => 'berm.gif',
'Commonwealth of the Bahamas' => 'bhms.gif',
'Kingdom of Bahrain' => 'bhrn.gif',
'Republic of Belarus' => 'blru.gif',
'Republic of Bolivia' => 'blva.gif',
'Belize' => 'blze.gif',
'Republic of Benin' => 'bnin.gif',
'Republic of Botswana' => 'bots.gif',
'Federative Republic of Brazil' => 'braz.gif',
'Barbados' => 'brbd.gif',
'British Indian Ocean Territory' => 'brin.gif',
'Brunei Darussalam' => 'brun.gif',
'Republic of Burkina' => 'bufa.gif',
'Republic of Bulgaria' => 'bulg.gif',
'Republic of Burundi' => 'buru.gif',
'Overseas Territory of the British Virgin Islands' => 'bvis.gif',
'Central African Republic' => 'cafr.gif',
'Kingdom of Cambodia' => 'camb.gif',
'Republic of Cameroon' => 'came.gif',
'Dominion of Canada' => 'cana.gif',
'Caribbean Community' => 'cari.gif',
'Republic of Cape Verde' => 'cave.gif',
'Republic of Chad' => 'chad.gif',
'Republic of Chile' => 'chil.gif',
'Territory of Christmas Island' => 'chms.gif',
'Commonwealth of Independent States' => 'cins.gif',
'Cook Islands' => 'ckis.gif',
'Republic of Colombia' => 'clmb.gif',
'Territory of Cocos Islands' => 'cois.gif',
'Commonwealth' => 'comn.gif',
'Union of the Comoros' => 'como.gif',
'Republic of the Congo' => 'cong.gif',
'Republic of Costa Rica' => 'corc.gif',
'Republic of Croatia' => 'croa.gif',
'Republic of Cuba' => 'cuba.gif',
'British Overseas Territory of the Cayman Islands' => 'cyis.gif',
'Republic of Cyprus' => 'cypr.gif',
'The Czech Republic' => 'czec.gif',
'Kingdom of Denmark' => 'denm.gif',
'Republic of Djibouti' => 'djib.gif',
'Commonwealth of Dominica' => 'domn.gif',
'Dominican Republic' => 'dore.gif',
'Republic of Ecuador' => 'ecua.gif',
'Arab Republic of Egypt' => 'egyp.gif',
'Republic of El Salvador' => 'elsa.gif',
'England' => 'engl.gif',
'Republic of Equatorial Guinea' => 'eqgu.gif',
'State of Eritrea' => 'erit.gif',
'Republic of Estonia' => 'estn.gif',
'Ethiopia' => 'ethp.gif',
'European Union' => 'euun.gif',
'British Overseas Territory of the Falkland Islands' => 'fais.gif',
'International Federation of Vexillological Associations' => 'fiav.gif',
'Republic of Fiji' => 'fiji.gif',
'Republic of Finland' => 'finl.gif',
'Territory of French Polynesia' => 'fpol.gif',
'French Republic' => 'fran.gif',
'Overseas Department of French Guiana' => 'frgu.gif',
'Gabonese Republic' => 'gabn.gif',
'Republic of the Gambia' => 'gamb.gif',
'Republic of Georgia' => 'geor.gif',
'Federal Republic of Germany' => 'germ.gif',
'Republic of Ghana' => 'ghan.gif',
'Gibraltar' => 'gibr.gif',
'Hellenic Republic' => 'grec.gif',
'State of Grenada' => 'gren.gif',
'Overseas Department of Guadeloupe' => 'guad.gif',
'Territory of Guam' => 'guam.gif',
'Republic of Guatemala' => 'guat.gif',
'The Bailiwick of Guernsey' => 'guer.gif',
'Republic of Guinea' => 'guin.gif',
'Republic of Haiti' => 'hait.gif',
'Hong Kong Special Administrative Region' => 'hokn.gif',
'Republic of Honduras' => 'hond.gif',
'Republic of Hungary' => 'hung.gif',
'Republic of Iceland' => 'icel.gif',
'International Committee of the Red Cross' => 'icrc.gif',
'Republic of India' => 'inda.gif',
'Republic of Indonesia' => 'indn.gif',
'Republic of Iraq' => 'iraq.gif',
'Republic of Ireland' => 'irel.gif',
'Organization of the Islamic Conference' => 'isco.gif',
'Isle of Man' => 'isma.gif',
'State of Israel' => 'isra.gif',
'Italian Republic' => 'ital.gif',
'Jamaica' => 'jama.gif',
'Japan' => 'japa.gif',
'The Bailiwick of Jersey' => 'jers.gif',
'Hashemite Kingdom of Jordan' => 'jord.gif',
'Republic of Kazakhstan' => 'kazk.gif',
'Republic of Kenya' => 'keny.gif',
'Republic of Kiribati' => 'kirb.gif',
'State of Kuwait' => 'kuwa.gif',
'Kyrgyz Republic' => 'kyrg.gif',
'Republic of Latvia' => 'latv.gif',
'Lebanese Republic' => 'leba.gif',
'Kingdom of Lesotho' => 'lest.gif',
'Republic of Liberia' => 'libe.gif',
'Principality of Liechtenstein' => 'liec.gif',
'Republic of Lithuania' => 'lith.gif',
'Grand Duchy of Luxembourg' => 'luxe.gif',
'Macao Special Administrative Region' => 'maca.gif',
'Republic of Macedonia' => 'mace.gif',
'Republic of Madagascar' => 'mada.gif',
'Republic of the Marshall Islands' => 'mais.gif',
'Republic of Maldives' => 'mald.gif',
'Republic of Mali' => 'mali.gif',
'Federation of Malaysia' => 'mals018.gif',
'Republic of Malta' => 'malt.gif',
'Republic of Malawi' => 'malw.gif',
'Overseas Department of Martinique' => 'mart.gif',
'Islamic Republic of Mauritania' => 'maur.gif',
'Territorial Collectivity of Mayotte' => 'mayt.gif',
'United Mexican States' => 'mexc.gif',
'Federated States of Micronesia' => 'micr.gif',
'Midway Islands' => 'miis.gif',
'Republic of Moldova' => 'mold.gif',
'Principality of Monaco' => 'mona.gif',
'Republic of Mongolia' => 'mong.gif',
'British Overseas Territory of Montserrat' => 'mont.gif',
'Kingdom of Morocco' => 'morc.gif',
'Republic of Mozambique' => 'moza.gif',
'Republic of Mauritius' => 'mrts.gif',
'Union of Myanmar' => 'myan.gif',
'Republic of Namibia' => 'namb.gif',
'North Atlantic Treaty Organization' => 'nato.gif',
'Republic of Nauru' => 'naur.gif',
'Turkish Republic of Northern Cyprus' => 'ncyp.gif',
'Netherlands Antilles' => 'nean.gif',
'Kingdom of Nepal' => 'nepa.gif',
'Kingdom of the Netherlands' => 'neth.gif',
'Territory of Norfolk Island' => 'nfis.gif',
'Federal Republic of Nigeria' => 'ngra.gif',
'Republic of Nicaragua' => 'nica.gif',
'Republic of Niger' => 'nigr.gif',
'Niue' => 'niue.gif',
'Commonwealth of the Northern Mariana Islands' => 'nmar.gif',
'Province of Northern Ireland' => 'noir.gif',
'Nordic Council' => 'nord.gif',
'Kingdom of Norway' => 'norw.gif',
'Territory of New Caledonia and Dependencies' => 'nwca.gif',
'New Zealand' => 'nwze.gif',
'Organization of American States' => 'oast.gif',
'Organization of African Unity' => 'oaun.gif',
'International Olympic Committee' => 'olym.gif',
'Sultanate of Oman' => 'oman.gif',
'Organization of Petroleum Exporting Countries' => 'opec.gif',
'Islamic Republic of Pakistan' => 'paks.gif',
'Republic of Palau' => 'pala.gif',
'Independent State of Papua New Guinea' => 'pang.gif',
'Republic of Paraguay' => 'para.gif',
'Republic of the Philippines' => 'phil.gif',
'British Overseas Territory of the Pitcairn Islands' => 'piis.gif',
'Republic of Poland' => 'pola.gif',
'Republic of Portugal' => 'port.gif',
'Commonwealth of Puerto Rico' => 'purc.gif',
'State of Qatar' => 'qata.gif',
'Russian Federation' => 'russ.gif',
'Republic of Rwanda' => 'rwan.gif',
'Kingdom of Saudi Arabia' => 'saar.gif',
'Republic of San Marino' => 'sama.gif',
'Nordic Sami Conference' => 'sami.gif',
'Sark' => 'sark.gif',
'Scotland' => 'scot.gif',
'Principality of Seborga' => 'sebo.gif',
'Republic of Sierra Leone' => 'sile.gif',
'Republic of Singapore' => 'sing.gif',
'Republic of Korea' => 'skor.gif',
'Republic of Slovenia' => 'slva.gif',
'Somali Republic' => 'smla.gif',
'Republic of Somaliland' => 'smld.gif',
'Republic of South Africa' => 'soaf.gif',
'Solomon Islands' => 'sois.gif',
'Kingdom of Spain' => 'span.gif',
'Secretariat of the Pacific Community' => 'spco.gif',
'Democratic Socialist Republic of Sri Lanka' => 'srla.gif',
'Saint Lucia' => 'stlu.gif',
'Republic of the Sudan' => 'suda.gif',
'Republic of Suriname' => 'surn.gif',
'Slovak Republic' => 'svka.gif',
'Kingdom of Sweden' => 'swdn.gif',
'Swiss Confederation' => 'swit.gif',
'Syrian Arab Republic' => 'syra.gif',
'Kingdom of Swaziland' => 'szld.gif',
'Republic of China' => 'taiw.gif',
'Republic of Tajikistan' => 'tajk.gif',
'United Republic of Tanzania' => 'tanz.gif',
'Kingdom of Thailand' => 'thal.gif',
'Autonomous Region of Tibet' => 'tibe.gif',
'Turkmenistan' => 'tkst.gif',
'Togolese Republic' => 'togo.gif',
'Tokelau' => 'toke.gif',
'Kingdom of Tonga' => 'tong.gif',
'Tristan da Cunha' => 'trdc.gif',
'Tromelin' => 'tris.gif',
'Republic of Tunisia' => 'tuns.gif',
'Republic of Turkey' => 'turk.gif',
'Tuvalu' => 'tuva.gif',
'United Arab Emirates' => 'uaem.gif',
'Republic of Uganda' => 'ugan.gif',
'Ukraine' => 'ukrn.gif',
'United Kingdom of Great Britain' => 'unkg.gif',
'United Nations' => 'unna.gif',
'United States of America' => 'unst.gif',
'Oriental Republic of Uruguay' => 'urgy.gif',
'Virgin Islands of the United States' => 'usvs.gif',
'Republic of Uzbekistan' => 'uzbk.gif',
'State of the Vatican City' => 'vacy.gif',
'Republic of Vanuatu' => 'vant.gif',
'Bolivarian Republic of Venezuela' => 'venz.gif',
'Republic of Yemen' => 'yemn.gif',
'Democratic Republic of Congo' => 'zare.gif',
'Republic of Zimbabwe' => 'zbwe.gif'
) ;

File diff suppressed because it is too large Load Diff

@ -0,0 +1,344 @@
<?php
/*
Copyright (c) 2006-2008 Ulrich Mierendorff
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Changelog:
version 1.1
- improved the rendering speed by ~20%
- Thanks to Matthias Mächler for fixing some small errors:
* uninitialized variables
* deprecated passing of $img reference in imageSmoothArc ()
version 1.0
Release of rewritten script
*/
function imageSmoothArcDrawSegment (&$img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY, $color, $start, $stop, $seg)
{
// Originally written from scratch by Ulrich Mierendorff, 06/2006
// Rewritten and improved, 04/2007, 07/2007
// Please do not use THIS function directly. Scroll down to imageSmoothArc(...).
$fillColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], $color[3] );
$xStart = abs($a * cos($start));
$yStart = abs($b * sin($start));
$xStop = abs($a * cos($stop));
$yStop = abs($b * sin($stop));
$dxStart = 0;
$dyStart = 0;
$dxStop = 0;
$dyStop = 0;
if ($xStart != 0)
$dyStart = $yStart/$xStart;
if ($xStop != 0)
$dyStop = $yStop/$xStop;
if ($yStart != 0)
$dxStart = $xStart/$yStart;
if ($yStop != 0)
$dxStop = $xStop/$yStop;
if (abs($xStart) >= abs($yStart)) {
$aaStartX = true;
} else {
$aaStartX = false;
}
if ($xStop >= $yStop) {
$aaStopX = true;
} else {
$aaStopX = false;
}
//$xp = +1; $yp = -1; $xa = +1; $ya = 0;
for ( $x = 0; $x < $a; $x += 1 ) {
/*$y = $b * sqrt( 1 - ($x*$x)/($a*$a) );
$error = $y - (int)($y);
$y = (int)($y);
$diffColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error );*/
$_y1 = $dyStop*$x;
$_y2 = $dyStart*$x;
if ($xStart > $xStop)
{
$error1 = $_y1 - (int)($_y1);
$error2 = 1 - $_y2 + (int)$_y2;
$_y1 = $_y1-$error1;
$_y2 = $_y2+$error2;
}
else
{
$error1 = 1 - $_y1 + (int)$_y1;
$error2 = $_y2 - (int)($_y2);
$_y1 = $_y1+$error1;
$_y2 = $_y2-$error2;
}
/*
if ($aaStopX)
$diffColor1 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error1 );
if ($aaStartX)
$diffColor2 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error2 );
*/
if ($seg == 0 || $seg == 2)
{
$i = $seg;
if (!($start > $i*M_PI/2 && $x > $xStart)) {
if ($i == 0) {
$xp = +1; $yp = -1; $xa = +1; $ya = 0;
} else {
$xp = -1; $yp = +1; $xa = 0; $ya = +1;
}
if ( $stop < ($i+1)*(M_PI/2) && $x <= $xStop ) {
$diffColor1 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error1 );
$y1 = $_y1; if ($aaStopX) imageSetPixel($img, $cx+$xp*($x)+$xa, $cy+$yp*($y1+1)+$ya, $diffColor1);
} else {
$y = $b * sqrt( 1 - ($x*$x)/($a*$a) );
$error = $y - (int)($y);
$y = (int)($y);
$diffColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error );
$y1 = $y; if ($x < $aaAngleX ) imageSetPixel($img, $cx+$xp*$x+$xa, $cy+$yp*($y1+1)+$ya, $diffColor);
}
if ($start > $i*M_PI/2 && $x <= $xStart) {
$diffColor2 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error2 );
$y2 = $_y2; if ($aaStartX) imageSetPixel($img, $cx+$xp*$x+$xa, $cy+$yp*($y2-1)+$ya, $diffColor2);
} else {
$y2 = 0;
}
if ($y2 <= $y1) imageLine($img, $cx+$xp*$x+$xa, $cy+$yp*$y1+$ya , $cx+$xp*$x+$xa, $cy+$yp*$y2+$ya, $fillColor);
}
}
if ($seg == 1 || $seg == 3)
{
$i = $seg;
if (!($stop < ($i+1)*M_PI/2 && $x > $xStop)) {
if ($i == 1) {
$xp = -1; $yp = -1; $xa = 0; $ya = 0;
} else {
$xp = +1; $yp = +1; $xa = 1; $ya = 1;
}
if ( $start > $i*M_PI/2 && $x < $xStart ) {
$diffColor2 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error2 );
$y1 = $_y2; if ($aaStartX) imageSetPixel($img, $cx+$xp*$x+$xa, $cy+$yp*($y1+1)+$ya, $diffColor2);
} else {
$y = $b * sqrt( 1 - ($x*$x)/($a*$a) );
$error = $y - (int)($y);
$y = (int) $y;
$diffColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error );
$y1 = $y; if ($x < $aaAngleX ) imageSetPixel($img, $cx+$xp*$x+$xa, $cy+$yp*($y1+1)+$ya, $diffColor);
}
if ($stop < ($i+1)*M_PI/2 && $x <= $xStop) {
$diffColor1 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error1 );
$y2 = $_y1; if ($aaStopX) imageSetPixel($img, $cx+$xp*$x+$xa, $cy+$yp*($y2-1)+$ya, $diffColor1);
} else {
$y2 = 0;
}
if ($y2 <= $y1) imageLine($img, $cx+$xp*$x+$xa, $cy+$yp*$y1+$ya, $cx+$xp*$x+$xa, $cy+$yp*$y2+$ya, $fillColor);
}
}
}
///YYYYY
for ( $y = 0; $y < $b; $y += 1 ) {
/*$x = $a * sqrt( 1 - ($y*$y)/($b*$b) );
$error = $x - (int)($x);
$x = (int)($x);
$diffColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error );
*/
$_x1 = $dxStop*$y;
$_x2 = $dxStart*$y;
if ($yStart > $yStop)
{
$error1 = $_x1 - (int)($_x1);
$error2 = 1 - $_x2 + (int)$_x2;
$_x1 = $_x1-$error1;
$_x2 = $_x2+$error2;
}
else
{
$error1 = 1 - $_x1 + (int)$_x1;
$error2 = $_x2 - (int)($_x2);
$_x1 = $_x1+$error1;
$_x2 = $_x2-$error2;
}
/*
if (!$aaStopX)
$diffColor1 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error1 );
if (!$aaStartX)
$diffColor2 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error2 );
*/
if ($seg == 0 || $seg == 2)
{
$i = $seg;
if (!($start > $i*M_PI/2 && $y > $yStop)) {
if ($i == 0) {
$xp = +1; $yp = -1; $xa = 1; $ya = 0;
} else {
$xp = -1; $yp = +1; $xa = 0; $ya = 1;
}
if ( $stop < ($i+1)*(M_PI/2) && $y <= $yStop ) {
$diffColor1 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error1 );
$x1 = $_x1; if (!$aaStopX) imageSetPixel($img, $cx+$xp*($x1-1)+$xa, $cy+$yp*($y)+$ya, $diffColor1);
}
if ($start > $i*M_PI/2 && $y < $yStart) {
$diffColor2 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error2 );
$x2 = $_x2; if (!$aaStartX) imageSetPixel($img, $cx+$xp*($x2+1)+$xa, $cy+$yp*($y)+$ya, $diffColor2);
} else {
$x = $a * sqrt( 1 - ($y*$y)/($b*$b) );
$error = $x - (int)($x);
$x = (int)($x);
$diffColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error );
$x1 = $x; if ($y < $aaAngleY && $y <= $yStop ) imageSetPixel($img, $cx+$xp*($x1+1)+$xa, $cy+$yp*$y+$ya, $diffColor);
}
}
}
if ($seg == 1 || $seg == 3)
{
$i = $seg;
if (!($stop < ($i+1)*M_PI/2 && $y > $yStart)) {
if ($i == 1) {
$xp = -1; $yp = -1; $xa = 0; $ya = 0;
} else {
$xp = +1; $yp = +1; $xa = 1; $ya = 1;
}
if ( $start > $i*M_PI/2 && $y < $yStart ) {
$diffColor2 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error2 );
$x1 = $_x2; if (!$aaStartX) imageSetPixel($img, $cx+$xp*($x1-1)+$xa, $cy+$yp*$y+$ya, $diffColor2);
}
if ($stop < ($i+1)*M_PI/2 && $y <= $yStop) {
$diffColor1 = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error1 );
$x2 = $_x1; if (!$aaStopX) imageSetPixel($img, $cx+$xp*($x2+1)+$xa, $cy+$yp*$y+$ya, $diffColor1);
} else {
$x = $a * sqrt( 1 - ($y*$y)/($b*$b) );
$error = $x - (int)($x);
$x = (int)($x);
$diffColor = imageColorExactAlpha( $img, $color[0], $color[1], $color[2], 127-(127-$color[3])*$error );
$x1 = $x; if ($y < $aaAngleY && $y < $yStart) imageSetPixel($img,$cx+$xp*($x1+1)+$xa, $cy+$yp*$y+$ya, $diffColor);
}
}
}
}
}
function imageSmoothArc ( &$img, $cx, $cy, $w, $h, $color, $start, $stop)
{
// Originally written from scratch by Ulrich Mierendorff, 06/2006
// Rewritten and improved, 04/2007, 07/2007
// compared to old version:
// + Support for transparency added
// + Improved quality of edges & antialiasing
// note: This function does not represent the fastest way to draw elliptical
// arcs. It was written without reading any papers on that subject. Better
// algorithms may be twice as fast or even more.
// what it cannot do: It does not support outlined arcs, only filled
// Parameters:
// $cx - Center of ellipse, X-coord
// $cy - Center of ellipse, Y-coord
// $w - Width of ellipse ($w >= 2)
// $h - Height of ellipse ($h >= 2 )
// $color - Color of ellipse as a four component array with RGBA
// $start - Starting angle of the arc, no limited range!
// $stop - Stop angle of the arc, no limited range!
// $start _can_ be greater than $stop!
// If any value is not in the given range, results are undefined!
// This script does not use any special algorithms, everything is completely
// written from scratch; see http://de.wikipedia.org/wiki/Ellipse for formulas.
while ($start < 0)
$start += 2*M_PI;
while ($stop < 0)
$stop += 2*M_PI;
while ($start > 2*M_PI)
$start -= 2*M_PI;
while ($stop > 2*M_PI)
$stop -= 2*M_PI;
if ($start > $stop)
{
imageSmoothArc ( $img, $cx, $cy, $w, $h, $color, $start, 2*M_PI);
imageSmoothArc ( $img, $cx, $cy, $w, $h, $color, 0, $stop);
return;
}
$a = 1.0*round ($w/2);
$b = 1.0*round ($h/2);
$cx = 1.0*round ($cx);
$cy = 1.0*round ($cy);
$aaAngle = atan(($b*$b)/($a*$a)*tan(0.25*M_PI));
$aaAngleX = $a*cos($aaAngle);
$aaAngleY = $b*sin($aaAngle);
$a -= 0.5; // looks better...
$b -= 0.5;
for ($i=0; $i<4;$i++)
{
if ($start < ($i+1)*M_PI/2)
{
if ($start > $i*M_PI/2)
{
if ($stop > ($i+1)*M_PI/2)
{
imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY , $color, $start, ($i+1)*M_PI/2, $i);
}
else
{
imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY, $color, $start, $stop, $i);
break;
}
}
else
{
if ($stop > ($i+1)*M_PI/2)
{
imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY, $color, $i*M_PI/2, ($i+1)*M_PI/2, $i);
}
else
{
imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY, $color, $i*M_PI/2, $stop, $i);
break;
}
}
}
}
}
?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,105 +0,0 @@
<?php
//=======================================================================
// File: IMGDATA_BEVELS.INC
// Description: Base64 encoded images for round bevels
// Created: 2003-03-20
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: imgdata_bevels.inc,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
class ImgData_Bevels extends ImgData {
var $name = 'Round Bevels';
var $an = array(MARK_IMG_BEVEL => 'imgdata');
var $colors = array('green','purple','orange','red','yellow');
var $index = array('green'=>1,'purple'=>4,'orange'=>2,'red'=>0,'yellow'=>3);
var $maxidx = 4 ;
var $imgdata ;
function ImgData_Bevels() {
//==========================================================
// File: bullets_balls_red_013.png
//==========================================================
$this->imgdata[0][0]= 337 ;
$this->imgdata[0][1]=
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
'BMVEX////////27t/f3+LFwcmNxMuxm62DmqKth1VpZmIWg6fv'.
'HCa7K0BwMEytCjFnIyUlEBg9vhQvAAAAAXRSTlMAQObYZgAAAA'.
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
'RQfTAxcBNhk+pYJVAAAAl0lEQVR4nE2Q2xLDIAgFHUWBKJf//9'.
'oekmbafVDZARRbK/pYTKP9WNcNv64zzUdd9BjmrgnsVXRNSzO3'.
'CJ5ahdhy0XKQkxld1kxb45j7dp0x2lBNOyVgQpMaoadX7Hs7zr'.
'P1yKj47DKBnKaBKiSAkNss7O6PkMx6kIgYXISQJpcZCqdY6KR+'.
'J1PkS5Xob/h7MNz8x6D3fz5DKQjpkZOBYAAAAABJRU5ErkJggg'.
'==' ;
//==========================================================
// File: bullets_balls_green_013.png
//==========================================================
$this->imgdata[1][0]= 344 ;
$this->imgdata[1][1]=
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
'BMVEX////////27t/e3+K3vriUub/Dm18j4xc3ob10k0ItqQlU'.
'e5JBmwpxY1ENaKBgUh0iHgwsSre9AAAAAXRSTlMAQObYZgAAAA'.
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
'RQfTAxcBNTfJXtxZAAAAnklEQVR4nE2QWY4EMQhDUVhSIRC4/2'.
'kbaqLp9p+f2AxAayAzDfiK9znPORuvH0x8Ss9z6I9sHp6tcxE9'.
'nLmWmebmt5F5p2AR0+C9AWpLBjXRaZsCAT3SqklVp0YkAWaGtd'.
'c5Z41/STYpPzW7BjyiRrwkVmQto/Cw9tNEMvsgcekyCyFPboIu'.
'IsuXiKffYB4NK4r/h6d4g9HPPwCR7i8+GscIiiaonUAAAAAASU'.
'VORK5CYII=' ;
//==========================================================
// File: bullets_balls_oy_035.png
//==========================================================
$this->imgdata[2][0]= 341 ;
$this->imgdata[2][1]=
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
'BMVEX////////27t/f3+K5tbqNwcjnkjXjbxR2i5anfEoNkbis'.
'PBxpU0sZbZejKgdqIRIlERIwYtkYAAAAAXRSTlMAQObYZgAAAA'.
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
'RQfTAxcBNgK0wEu5AAAAm0lEQVR4nE3QVxIEIQgEUErAgTHA/U'.
'+7zbipf9RXgoGo0liMmX6RdSPLPtZM9F4LuuSIaZtZWffiU6Iz'.
'Y8SOMF0NogBj30ioGRGLZgiPvce1TbIRz6oBQEbOFGK0rIoxrn'.
'5hDomMA1cfGRCaRVhjS3gkzheM+4HtnlkXcvdZhWG4qZawewe6'.
'9Jnz/TKLB/ML6HUepn//QczazuwFO/0Ivpolhi4AAAAASUVORK'.
'5CYII=' ;
//==========================================================
// File: bullets_balls_oy_036.png
//==========================================================
$this->imgdata[3][0]= 340 ;
$this->imgdata[3][1]=
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
'BMVEX////////27t/e3+LO3hfYzz65ubiNwci6uQ12ipadgVGa'.
'fwsNkbhnVkcaZ5dwSA8lFg7CEepmAAAAAXRSTlMAQObYZgAAAA'.
'FiS0dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElN'.
'RQfTAxcCBySi1nevAAAAjElEQVR4nFXPWw7EIAgFUNMoCMhj/6'.
'staKczc/2RkwjS2glQ+w3YytgXCXCZpRo8gJdGxZadJws13CUP'.
'4SZI4MYiUxypeiGGw1XShVBTNN9kLXP2GRrZPFvKgd7z/sqGGV'.
'7C7r7r3l09alYN3iA8Yn+ImdVrNoEeSRqJPAaHfhZzLYwXstdZ'.
'rP3n2bvdAI4INwtihiwAAAAASUVORK5CYII=' ;
//==========================================================
// File: bullets_balls_pp_019.png
//==========================================================
$this->imgdata[4][0]= 334 ;
$this->imgdata[4][1]=
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
'BMVEX////+/v7i4eO/w8eHxcvKroNVormtfkjrMN2BeXQrepPc'.
'Esy4IL+OFaR7F25LHF8mFRh5XXtUAAAAAXRSTlMAQObYZgAAAA'.
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
'RQfTAxcBNgkjEpIxAAAAlElEQVR4nE2QAQ7FIAhDDTAVndL7n3'.
'ZV/7JfEwMvFIWUlkTMVNInbVv5ZeJqG7Smh2QTBwJBpsdizAZP'.
'5NyW0awhK8kYodnZxS6ECvPRp2sI+y7PBv1mN02KH7h77QCJ8D'.
'4VvY5NUgEmCwj6ZMzHtJRgRSXwC1gfcqJJH0GBnSnK1kUQ72DY'.
'CPBv+MCS/e0jib77eQAJxwiEWm7hFwAAAABJRU5ErkJggg==' ;
}
}
?>

@ -0,0 +1,104 @@
<?php
//=======================================================================
// File: IMGDATA_BEVELS.INC
// Description: Base64 encoded images for round bevels
// Created: 2003-03-20
// Ver: $Id: imgdata_bevels.inc.php 1106 2009-02-22 20:16:35Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
class ImgData_Bevels extends ImgData {
protected $name = 'Round Bevels';
protected $an = array(MARK_IMG_BEVEL => 'imgdata');
protected $colors = array('green','purple','orange','red','yellow');
protected $index = array('green'=>1,'purple'=>4,'orange'=>2,'red'=>0,'yellow'=>3);
protected $maxidx = 4 ;
protected $imgdata ;
function __construct() {
//==========================================================
// File: bullets_balls_red_013.png
//==========================================================
$this->imgdata[0][0]= 337 ;
$this->imgdata[0][1]=
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
'BMVEX////////27t/f3+LFwcmNxMuxm62DmqKth1VpZmIWg6fv'.
'HCa7K0BwMEytCjFnIyUlEBg9vhQvAAAAAXRSTlMAQObYZgAAAA'.
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
'RQfTAxcBNhk+pYJVAAAAl0lEQVR4nE2Q2xLDIAgFHUWBKJf//9'.
'oekmbafVDZARRbK/pYTKP9WNcNv64zzUdd9BjmrgnsVXRNSzO3'.
'CJ5ahdhy0XKQkxld1kxb45j7dp0x2lBNOyVgQpMaoadX7Hs7zr'.
'P1yKj47DKBnKaBKiSAkNss7O6PkMx6kIgYXISQJpcZCqdY6KR+'.
'J1PkS5Xob/h7MNz8x6D3fz5DKQjpkZOBYAAAAABJRU5ErkJggg'.
'==' ;
//==========================================================
// File: bullets_balls_green_013.png
//==========================================================
$this->imgdata[1][0]= 344 ;
$this->imgdata[1][1]=
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
'BMVEX////////27t/e3+K3vriUub/Dm18j4xc3ob10k0ItqQlU'.
'e5JBmwpxY1ENaKBgUh0iHgwsSre9AAAAAXRSTlMAQObYZgAAAA'.
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
'RQfTAxcBNTfJXtxZAAAAnklEQVR4nE2QWY4EMQhDUVhSIRC4/2'.
'kbaqLp9p+f2AxAayAzDfiK9znPORuvH0x8Ss9z6I9sHp6tcxE9'.
'nLmWmebmt5F5p2AR0+C9AWpLBjXRaZsCAT3SqklVp0YkAWaGtd'.
'c5Z41/STYpPzW7BjyiRrwkVmQto/Cw9tNEMvsgcekyCyFPboIu'.
'IsuXiKffYB4NK4r/h6d4g9HPPwCR7i8+GscIiiaonUAAAAAASU'.
'VORK5CYII=' ;
//==========================================================
// File: bullets_balls_oy_035.png
//==========================================================
$this->imgdata[2][0]= 341 ;
$this->imgdata[2][1]=
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
'BMVEX////////27t/f3+K5tbqNwcjnkjXjbxR2i5anfEoNkbis'.
'PBxpU0sZbZejKgdqIRIlERIwYtkYAAAAAXRSTlMAQObYZgAAAA'.
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
'RQfTAxcBNgK0wEu5AAAAm0lEQVR4nE3QVxIEIQgEUErAgTHA/U'.
'+7zbipf9RXgoGo0liMmX6RdSPLPtZM9F4LuuSIaZtZWffiU6Iz'.
'Y8SOMF0NogBj30ioGRGLZgiPvce1TbIRz6oBQEbOFGK0rIoxrn'.
'5hDomMA1cfGRCaRVhjS3gkzheM+4HtnlkXcvdZhWG4qZawewe6'.
'9Jnz/TKLB/ML6HUepn//QczazuwFO/0Ivpolhi4AAAAASUVORK'.
'5CYII=' ;
//==========================================================
// File: bullets_balls_oy_036.png
//==========================================================
$this->imgdata[3][0]= 340 ;
$this->imgdata[3][1]=
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
'BMVEX////////27t/e3+LO3hfYzz65ubiNwci6uQ12ipadgVGa'.
'fwsNkbhnVkcaZ5dwSA8lFg7CEepmAAAAAXRSTlMAQObYZgAAAA'.
'FiS0dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElN'.
'RQfTAxcCBySi1nevAAAAjElEQVR4nFXPWw7EIAgFUNMoCMhj/6'.
'staKczc/2RkwjS2glQ+w3YytgXCXCZpRo8gJdGxZadJws13CUP'.
'4SZI4MYiUxypeiGGw1XShVBTNN9kLXP2GRrZPFvKgd7z/sqGGV'.
'7C7r7r3l09alYN3iA8Yn+ImdVrNoEeSRqJPAaHfhZzLYwXstdZ'.
'rP3n2bvdAI4INwtihiwAAAAASUVORK5CYII=' ;
//==========================================================
// File: bullets_balls_pp_019.png
//==========================================================
$this->imgdata[4][0]= 334 ;
$this->imgdata[4][1]=
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
'BMVEX////+/v7i4eO/w8eHxcvKroNVormtfkjrMN2BeXQrepPc'.
'Esy4IL+OFaR7F25LHF8mFRh5XXtUAAAAAXRSTlMAQObYZgAAAA'.
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
'RQfTAxcBNgkjEpIxAAAAlElEQVR4nE2QAQ7FIAhDDTAVndL7n3'.
'ZV/7JfEwMvFIWUlkTMVNInbVv5ZeJqG7Smh2QTBwJBpsdizAZP'.
'5NyW0awhK8kYodnZxS6ECvPRp2sI+y7PBv1mN02KH7h77QCJ8D'.
'4VvY5NUgEmCwj6ZMzHtJRgRSXwC1gfcqJJH0GBnSnK1kUQ72DY'.
'CPBv+MCS/e0jib77eQAJxwiEWm7hFwAAAABJRU5ErkJggg==' ;
}
}
?>

@ -1,178 +0,0 @@
<?php
//=======================================================================
// File: IMGDATA_DIAMONDS.INC
// Description: Base64 encoded images for diamonds
// Created: 2003-03-20
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: imgdata_diamonds.inc,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
class ImgData_Diamonds extends ImgData {
var $name = 'Diamonds';
var $an = array(MARK_IMG_DIAMOND =>'imgdata');
var $colors = array('lightblue','darkblue','gray',
'blue','pink','purple','red','yellow');
var $index = array('lightblue' =>7,'darkblue'=>2,'gray'=>6,
'blue'=>4,'pink'=>1,'purple'=>5,'red'=>0,'yellow'=>3);
var $maxidx = 7 ;
var $imgdata ;
function ImgData_Diamonds() {
//==========================================================
// File: diam_red.png
//==========================================================
$this->imgdata[0][0]= 668 ;
$this->imgdata[0][1]=
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA/F'.
'BMVEX///////+cAAD/AADOAABjAABrAADWGBjOCAj/CAj/GBj/'.
'EBCcCAiMOTl7KSl7ISFzGBilGBjOEBBrCAjv5+eMQkK1QkKtMT'.
'GtKSnWKSn/KSlzEBCcEBDexsb/tbXOe3ucWlqcUlKUSkr/e3vn'.
'a2u9UlL/a2uEMTHeUlLeSkqtOTn/UlL/SkrWOTn/QkL/OTmlIS'.
'H/MTH/ISH39/f/9/f35+fezs7/5+fvzs7WtbXOra3nvb3/zs7G'.
'nJzvtbXGlJTepaW9jIy1hITWlJS1e3uta2ulY2P/lJTnhITne3'.
'vGY2O9Wlr/c3PeY2O1Skr/Y2P/WlreQkLWISGlEBCglEUaAAAA'.
'AXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAA'.
'sSAdLdfvwAAAAHdElNRQfTAwsWEw5WI4qnAAABGUlEQVR4nHXQ'.
'1XLDMBAFUKUCM1NiO8zcpIxpp8z0//9SWY7b2LHv6EU6s1qtAN'.
'iMBAojLPkigpJvogKC4pxDuQipjanlICXof1RQDkYEF21mKIfg'.
'/GGKtjAmOKt9oSyuCU7OhyiDCQnjowGfRnooCJIkiWJvv8NxnG'.
'nyNAwFcekvZpPP3mu7Vrp8fOq8DYbTyjdnAvBj7Jbd7nP95urs'.
'+MC2D6unF+Cu0VJULQBAlsOQuueN3Hrp2nGUvqppemBZ0aU7Se'.
'SXvYZFMKaLJn7MH3btJmZEMEmGSOreqy0SI/4ffo3uiUOYEACy'.
'OFopmNWlP5uZd9uPWmUoxvK9ilO9NtBo6mS7KkZD0fOJYqgGBU'.
'S/T7OKCAA9tfsFOicXcbxt29cAAAAASUVORK5CYII=' ;
//==========================================================
// File: diam_pink.png
//==========================================================
$this->imgdata[1][0]= 262 ;
$this->imgdata[1][1]=
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'.
'BMVEX///+AgID/M5n/Zpn/zMz/mZn1xELhAAAAAXRSTlMAQObY'.
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'.
'AHdElNRQfTAwsWEi3tX8qUAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'.
'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'.
'6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'.
'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'.
'==' ;
//==========================================================
// File: diam_blue.png
//==========================================================
$this->imgdata[2][0]= 662 ;
$this->imgdata[2][1]=
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA+V'.
'BMVEX///+AgIAAAJwAAP8AAM4AAGMAAGsQEP8YGHMQEHMYGP8Q'.
'EKUICJwICM5KSpQxMYQpKXsYGNYQEM4ICGsICP97e85aWpw5OY'.
'xSUv85ObVCQt4xMa0pKa0hIaUpKf+9vd6EhLVra+dzc/9SUr1r'.
'a/9aWt5SUt5CQrVaWv9KSv8hIXs5Of8xMf8pKdYhIdYYGKUhIf'.
'/Ozs739//v7/fn5+/v7//n5/fW1ufOzufOzu/W1v+trc69veel'.
'pc6trd6UlMa9vf+MjL21tfe1tf+UlNZzc61ra6Wlpf+EhOeMjP'.
'9ra8ZSUpyEhP9CQoxKSrVCQv85Od4xMdYQENZnJhlWAAAAAXRS'.
'TlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAd'.
'LdfvwAAAAHdElNRQfTAwsWEx3Snct5AAABFklEQVR4nHXR5XbD'.
'IBgGYM6AuHsaqbvOfeuknev9X8xISbplSd5/8JyXwwcA/I0AKm'.
'PFchVBdvKNKggKQx2VIoRwMZihMiQE49YUlWBCcPL0hYq4ITh+'.
'qKECUoLDZWqoQNA766F/mJHlHXblPJJNiyURhM5eU9cNw5BlmS'.
'IrLOLxhzfotF7vwO2j3ez2ap/TmW4AIM7DoN9+tu+vLk6Pdg9O'.
'6ufXjfXLm6pxPACSJIpRFAa+/26DhuK6qjbiON40k0N3skjOvm'.
'NijBmchF5mi+1jhQqDmWyIzPp1hUlrv8On5l+6mMm1tigFNyrt'.
'5R97g+FKKyGKkTNKesXPJTZXOFIrUoKiypcTQVHjK4g8H2dWEQ'.
'B8bvUDLSQXSr41rmEAAAAASUVORK5CYII=' ;
//==========================================================
// File: diam_yellow.png
//==========================================================
$this->imgdata[3][0]= 262 ;
$this->imgdata[3][1]=
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'.
'BMVEX///+AgIBmMwCZZgD/zADMmQD/QLMZAAAAAXRSTlMAQObY'.
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'.
'AHdElNRQfTAwsWEwcv/zIDAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'.
'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'.
'6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'.
'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'.
'==' ;
//==========================================================
// File: diam_lightblue.png
//==========================================================
$this->imgdata[4][0]= 671 ;
$this->imgdata[4][1]=
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA/1'.
'BMVEX///+AgIAAnP8A//8Azv8AY/8Aa/8I//8Y1v8Izv8Y//8Q'.
'//8InP8Qzv8Ypf85jP8he/8Yc/8Ia/8pe/8p//8p1v9Ctf8xrf'.
'8prf8QnP8Qc/9CjP+1//97//9r//9S//9K//9C//85//8x//8h'.
'//9r5/9K3v9S3v851v97zv9Svf85rf8hpf/G3v9SnP9anP9KlP'.
'8xhP/n7//v7+f3///n///O//+U//9z//9j//9a//975/9C3v8h'.
'1v+E5/+17/9j3v/O7//n9/+95/+l3v9jxv+U1v8Qpf9avf9Ktf'.
'+Uxv+11v97tf9rrf+cxv+Mvf9jpf+tzv+Etf/O3v/39/8Akkxr'.
'AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACx'.
'IAAAsSAdLdfvwAAAAHdElNRQfTAwsWEiHk6Ya/AAABGUlEQVR4'.
'nHXQ13KDMBAF0J2o0E01GHDvJa7p3em95/+/JQJMYjDc0Yt0Zr'.
'VaAaxHgtxwbSGPkGQpOIeQ2ORxJiJmNWYZyAhZR0WcgQGhViU0'.
'nEGoedDHGxgRapRPcRpXhOr7XZzCmLjaXk9IIjvkOEmSRLG62+'.
'F5XlEElhA5sW21GvXj6mGlDBfnJ51lr9svnvEKwH1hu2QPbwd3'.
'N9eXVzuL7/Hn29frdKaamgcgy67L3HFG9gDefV+dm5qme4YRXL'.
'oVR374mRqUELZYosf84XAxISFRQuMh4rrH8YxGSP6HX6H97NNQ'.
'KEAaR08qCeuSnx2a8zIPWqUowtKHSRK91rAw0elmVYQFVc8mhq'.
'7p5RD7Ps3IIwA9sfsFxFUX6eZ4Zh4AAAAASUVORK5CYII=' ;
//==========================================================
// File: diam_purple.png
//==========================================================
$this->imgdata[5][0]= 657 ;
$this->imgdata[5][1]=
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA/F'.
'BMVEX///////8xAP/OAP+cAP9jAP9rAP+cCP85CP/OEP9SKf/O'.
'CP9CEP9zGP9rCP+lGP/WOf/WIf9KIf9jOf+MQv+EMf97If9zEP'.
'+1Sv+lIf/ne//eUv/na//n5//Oxv/Wzv+chP9zUv97Wv9rQv9a'.
'Mf9KGP/v5/+te/97Kf+9Y/+tOf+tKf+lEP/vtf/WMf/WKf/v7+'.
'f39/+tnP+9rf9rSv9jQv9CGP+ljP+EY//Gtf+tlP+Ma/9zSv/e'.
'zv+UUv+9lP+cWv+lY/+cUv+MOf+EKf+UQv/Opf/OhP/Ga/+1Qv'.
'/Oe/+9Uv/ntf/eWv/eSv/WGP/3zv/vlP/WEP//9/+pL4oHAAAA'.
'AXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAA'.
'sSAdLdfvwAAAAHdElNRQfTAwsWEjX+M1LCAAABDklEQVR4nHXQ'.
'1bLDIBAGYFqIEW+ksbr7cXd3ff93OUCamdOE/Mxw882yywLwPz'.
'+gNKotlRFUVnNUQlCxTMRFCKEdE+MgpJaEiIOU4DKaoSIygtb3'.
'FBUQrm3xjPK4JvXjK0A5hFniYSBtIilQVYUm+X0KTVNiYah+2q'.
'ulFb8nUbSovD2+TCavwXQWmnMA6ro+di+uR5cPzfPhVqPV3N1p'.
'n3b3+rimAWAYhP3xnXd7P6oc9vadPsa1wYEs00dFQRAFehlX21'.
'25Sg9NOgwF5jeNTjVL9om0TjDc1lmeCKZ17nFPzhPtSRt6J06R'.
'WKUoeG3MoXRa/wjLHGLodwZcotPqjsYngnWslRBZH91hWTbpD2'.
'EdF1ECWW1SAAAAAElFTkSuQmCC' ;
//==========================================================
// File: diam_gray.png
//==========================================================
$this->imgdata[6][0]= 262 ;
$this->imgdata[6][1]=
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'.
'BMVEX//////wAzMzNmZmbMzMyZmZlq4Qo5AAAAAXRSTlMAQObY'.
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'.
'AHdElNRQfTAwsWExZFTxLxAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'.
'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'.
'6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'.
'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'.
'==' ;
//==========================================================
// File: diam_blgr.png
//==========================================================
$this->imgdata[7][0]= 262 ;
$this->imgdata[7][1]=
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'.
'BMVEX///+AgIBmzP9m///M//+Z//8hMmBVAAAAAXRSTlMAQObY'.
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'.
'AHdElNRQfTAwsWEwCxm6egAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'.
'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'.
'6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'.
'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'.
'==' ;
}
}
?>

@ -0,0 +1,177 @@
<?php
//=======================================================================
// File: IMGDATA_DIAMONDS.INC
// Description: Base64 encoded images for diamonds
// Created: 2003-03-20
// Ver: $Id: imgdata_diamonds.inc.php 1106 2009-02-22 20:16:35Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
class ImgData_Diamonds extends ImgData {
protected $name = 'Diamonds';
protected $an = array(MARK_IMG_DIAMOND =>'imgdata');
protected $colors = array('lightblue','darkblue','gray',
'blue','pink','purple','red','yellow');
protected $index = array('lightblue' =>7,'darkblue'=>2,'gray'=>6,
'blue'=>4,'pink'=>1,'purple'=>5,'red'=>0,'yellow'=>3);
protected $maxidx = 7 ;
protected $imgdata ;
function __construct() {
//==========================================================
// File: diam_red.png
//==========================================================
$this->imgdata[0][0]= 668 ;
$this->imgdata[0][1]=
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA/F'.
'BMVEX///////+cAAD/AADOAABjAABrAADWGBjOCAj/CAj/GBj/'.
'EBCcCAiMOTl7KSl7ISFzGBilGBjOEBBrCAjv5+eMQkK1QkKtMT'.
'GtKSnWKSn/KSlzEBCcEBDexsb/tbXOe3ucWlqcUlKUSkr/e3vn'.
'a2u9UlL/a2uEMTHeUlLeSkqtOTn/UlL/SkrWOTn/QkL/OTmlIS'.
'H/MTH/ISH39/f/9/f35+fezs7/5+fvzs7WtbXOra3nvb3/zs7G'.
'nJzvtbXGlJTepaW9jIy1hITWlJS1e3uta2ulY2P/lJTnhITne3'.
'vGY2O9Wlr/c3PeY2O1Skr/Y2P/WlreQkLWISGlEBCglEUaAAAA'.
'AXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAA'.
'sSAdLdfvwAAAAHdElNRQfTAwsWEw5WI4qnAAABGUlEQVR4nHXQ'.
'1XLDMBAFUKUCM1NiO8zcpIxpp8z0//9SWY7b2LHv6EU6s1qtAN'.
'iMBAojLPkigpJvogKC4pxDuQipjanlICXof1RQDkYEF21mKIfg'.
'/GGKtjAmOKt9oSyuCU7OhyiDCQnjowGfRnooCJIkiWJvv8NxnG'.
'nyNAwFcekvZpPP3mu7Vrp8fOq8DYbTyjdnAvBj7Jbd7nP95urs'.
'+MC2D6unF+Cu0VJULQBAlsOQuueN3Hrp2nGUvqppemBZ0aU7Se'.
'SXvYZFMKaLJn7MH3btJmZEMEmGSOreqy0SI/4ffo3uiUOYEACy'.
'OFopmNWlP5uZd9uPWmUoxvK9ilO9NtBo6mS7KkZD0fOJYqgGBU'.
'S/T7OKCAA9tfsFOicXcbxt29cAAAAASUVORK5CYII=' ;
//==========================================================
// File: diam_pink.png
//==========================================================
$this->imgdata[1][0]= 262 ;
$this->imgdata[1][1]=
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'.
'BMVEX///+AgID/M5n/Zpn/zMz/mZn1xELhAAAAAXRSTlMAQObY'.
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'.
'AHdElNRQfTAwsWEi3tX8qUAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'.
'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'.
'6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'.
'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'.
'==' ;
//==========================================================
// File: diam_blue.png
//==========================================================
$this->imgdata[2][0]= 662 ;
$this->imgdata[2][1]=
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA+V'.
'BMVEX///+AgIAAAJwAAP8AAM4AAGMAAGsQEP8YGHMQEHMYGP8Q'.
'EKUICJwICM5KSpQxMYQpKXsYGNYQEM4ICGsICP97e85aWpw5OY'.
'xSUv85ObVCQt4xMa0pKa0hIaUpKf+9vd6EhLVra+dzc/9SUr1r'.
'a/9aWt5SUt5CQrVaWv9KSv8hIXs5Of8xMf8pKdYhIdYYGKUhIf'.
'/Ozs739//v7/fn5+/v7//n5/fW1ufOzufOzu/W1v+trc69veel'.
'pc6trd6UlMa9vf+MjL21tfe1tf+UlNZzc61ra6Wlpf+EhOeMjP'.
'9ra8ZSUpyEhP9CQoxKSrVCQv85Od4xMdYQENZnJhlWAAAAAXRS'.
'TlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAd'.
'LdfvwAAAAHdElNRQfTAwsWEx3Snct5AAABFklEQVR4nHXR5XbD'.
'IBgGYM6AuHsaqbvOfeuknev9X8xISbplSd5/8JyXwwcA/I0AKm'.
'PFchVBdvKNKggKQx2VIoRwMZihMiQE49YUlWBCcPL0hYq4ITh+'.
'qKECUoLDZWqoQNA766F/mJHlHXblPJJNiyURhM5eU9cNw5BlmS'.
'IrLOLxhzfotF7vwO2j3ez2ap/TmW4AIM7DoN9+tu+vLk6Pdg9O'.
'6ufXjfXLm6pxPACSJIpRFAa+/26DhuK6qjbiON40k0N3skjOvm'.
'NijBmchF5mi+1jhQqDmWyIzPp1hUlrv8On5l+6mMm1tigFNyrt'.
'5R97g+FKKyGKkTNKesXPJTZXOFIrUoKiypcTQVHjK4g8H2dWEQ'.
'B8bvUDLSQXSr41rmEAAAAASUVORK5CYII=' ;
//==========================================================
// File: diam_yellow.png
//==========================================================
$this->imgdata[3][0]= 262 ;
$this->imgdata[3][1]=
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'.
'BMVEX///+AgIBmMwCZZgD/zADMmQD/QLMZAAAAAXRSTlMAQObY'.
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'.
'AHdElNRQfTAwsWEwcv/zIDAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'.
'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'.
'6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'.
'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'.
'==' ;
//==========================================================
// File: diam_lightblue.png
//==========================================================
$this->imgdata[4][0]= 671 ;
$this->imgdata[4][1]=
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA/1'.
'BMVEX///+AgIAAnP8A//8Azv8AY/8Aa/8I//8Y1v8Izv8Y//8Q'.
'//8InP8Qzv8Ypf85jP8he/8Yc/8Ia/8pe/8p//8p1v9Ctf8xrf'.
'8prf8QnP8Qc/9CjP+1//97//9r//9S//9K//9C//85//8x//8h'.
'//9r5/9K3v9S3v851v97zv9Svf85rf8hpf/G3v9SnP9anP9KlP'.
'8xhP/n7//v7+f3///n///O//+U//9z//9j//9a//975/9C3v8h'.
'1v+E5/+17/9j3v/O7//n9/+95/+l3v9jxv+U1v8Qpf9avf9Ktf'.
'+Uxv+11v97tf9rrf+cxv+Mvf9jpf+tzv+Etf/O3v/39/8Akkxr'.
'AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACx'.
'IAAAsSAdLdfvwAAAAHdElNRQfTAwsWEiHk6Ya/AAABGUlEQVR4'.
'nHXQ13KDMBAF0J2o0E01GHDvJa7p3em95/+/JQJMYjDc0Yt0Zr'.
'VaAaxHgtxwbSGPkGQpOIeQ2ORxJiJmNWYZyAhZR0WcgQGhViU0'.
'nEGoedDHGxgRapRPcRpXhOr7XZzCmLjaXk9IIjvkOEmSRLG62+'.
'F5XlEElhA5sW21GvXj6mGlDBfnJ51lr9svnvEKwH1hu2QPbwd3'.
'N9eXVzuL7/Hn29frdKaamgcgy67L3HFG9gDefV+dm5qme4YRXL'.
'oVR374mRqUELZYosf84XAxISFRQuMh4rrH8YxGSP6HX6H97NNQ'.
'KEAaR08qCeuSnx2a8zIPWqUowtKHSRK91rAw0elmVYQFVc8mhq'.
'7p5RD7Ps3IIwA9sfsFxFUX6eZ4Zh4AAAAASUVORK5CYII=' ;
//==========================================================
// File: diam_purple.png
//==========================================================
$this->imgdata[5][0]= 657 ;
$this->imgdata[5][1]=
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA/F'.
'BMVEX///////8xAP/OAP+cAP9jAP9rAP+cCP85CP/OEP9SKf/O'.
'CP9CEP9zGP9rCP+lGP/WOf/WIf9KIf9jOf+MQv+EMf97If9zEP'.
'+1Sv+lIf/ne//eUv/na//n5//Oxv/Wzv+chP9zUv97Wv9rQv9a'.
'Mf9KGP/v5/+te/97Kf+9Y/+tOf+tKf+lEP/vtf/WMf/WKf/v7+'.
'f39/+tnP+9rf9rSv9jQv9CGP+ljP+EY//Gtf+tlP+Ma/9zSv/e'.
'zv+UUv+9lP+cWv+lY/+cUv+MOf+EKf+UQv/Opf/OhP/Ga/+1Qv'.
'/Oe/+9Uv/ntf/eWv/eSv/WGP/3zv/vlP/WEP//9/+pL4oHAAAA'.
'AXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAA'.
'sSAdLdfvwAAAAHdElNRQfTAwsWEjX+M1LCAAABDklEQVR4nHXQ'.
'1bLDIBAGYFqIEW+ksbr7cXd3ff93OUCamdOE/Mxw882yywLwPz'.
'+gNKotlRFUVnNUQlCxTMRFCKEdE+MgpJaEiIOU4DKaoSIygtb3'.
'FBUQrm3xjPK4JvXjK0A5hFniYSBtIilQVYUm+X0KTVNiYah+2q'.
'ulFb8nUbSovD2+TCavwXQWmnMA6ro+di+uR5cPzfPhVqPV3N1p'.
'n3b3+rimAWAYhP3xnXd7P6oc9vadPsa1wYEs00dFQRAFehlX21'.
'25Sg9NOgwF5jeNTjVL9om0TjDc1lmeCKZ17nFPzhPtSRt6J06R'.
'WKUoeG3MoXRa/wjLHGLodwZcotPqjsYngnWslRBZH91hWTbpD2'.
'EdF1ECWW1SAAAAAElFTkSuQmCC' ;
//==========================================================
// File: diam_gray.png
//==========================================================
$this->imgdata[6][0]= 262 ;
$this->imgdata[6][1]=
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'.
'BMVEX//////wAzMzNmZmbMzMyZmZlq4Qo5AAAAAXRSTlMAQObY'.
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'.
'AHdElNRQfTAwsWExZFTxLxAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'.
'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'.
'6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'.
'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'.
'==' ;
//==========================================================
// File: diam_blgr.png
//==========================================================
$this->imgdata[7][0]= 262 ;
$this->imgdata[7][1]=
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'.
'BMVEX///+AgIBmzP9m///M//+Z//8hMmBVAAAAAXRSTlMAQObY'.
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'.
'AHdElNRQfTAwsWEwCxm6egAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'.
'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'.
'6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'.
'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'.
'==' ;
}
}
?>

@ -1,518 +0,0 @@
<?php
//=======================================================================
// File: IMGDATA_PUSHPINS.INC
// Description: Base64 encoded images for pushpins
// Created: 2003-03-20
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: imgdata_pushpins.inc,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
class ImgData_PushPins extends ImgData {
var $name = 'Push pins';
var $an = array(MARK_IMG_PUSHPIN => 'imgdata_small',
MARK_IMG_SPUSHPIN => 'imgdata_small',
MARK_IMG_LPUSHPIN => 'imgdata_large');
var $colors = array('blue','green','orange','pink','red');
var $index = array('red' => 0, 'orange' => 1, 'pink' => 2, 'blue' => 3, 'green' => 4 ) ;
var $maxidx = 4 ;
var $imgdata_large, $imgdata_small ;
function ImgData_PushPins() {
// 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' ;
}
}
?>

@ -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) Asial Corporation. 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' ;
}
}
?>

@ -1,151 +0,0 @@
<?php
//=======================================================================
// File: IMGDATA_SQUARES.INC
// Description: Base64 encoded images for squares
// Created: 2003-03-20
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: imgdata_squares.inc,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
class ImgData_Squares extends ImgData {
var $name = 'Squares';
var $an = array(MARK_IMG_SQUARE =>'imgdata');
var $colors = array('bluegreen','blue','green',
'lightblue','orange','purple','red','yellow');
var $index = array('bluegreen' =>2,'blue'=>5,'green'=>6,
'lightblue'=>0,'orange'=>7,'purple'=>4,'red'=>3,'yellow'=>1);
var $maxidx = 7 ;
var $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' ;
}
}
?>

@ -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) Asial Corporation. 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' ;
}
}
?>

@ -1,145 +0,0 @@
<?php
//=======================================================================
// File: IMGDATA_STARS.INC
// Description: Base64 encoded images for stars
// Created: 2003-03-20
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: imgdata_stars.inc,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
class ImgData_Stars extends ImgData {
var $name = 'Stars';
var $an = array(MARK_IMG_STAR => 'imgdata');
var $colors = array('bluegreen','lightblue','purple','blue','green','pink','red','yellow');
var $index = array('bluegreen'=>3,'lightblue'=>4,'purple'=>1,
'blue'=>5,'green'=>0,'pink'=>7,'red'=>2,'yellow'=>6);
var $maxidx = 7 ;
var $imgdata ;
function ImgData_Stars() {
//==========================================================
// 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==' ;
}
}
?>

@ -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) Asial Corporation. 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==' ;
}
}
?>

@ -1,201 +0,0 @@
<?php
//=======================================================================
// File: JPG-CONFIG.INC
// Description: Configuration file for JpGraph library
// Created: 2004-03-27
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: jpg-config.inc,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
//------------------------------------------------------------------------
// Directories for cache and font directory.
//
// CACHE_DIR:
// The full absolute name of the directory to be used to store the
// cached image files. This directory will not be used if the USE_CACHE
// define (further down) is false. If you enable the cache please note that
// this directory MUST be readable and writable for the process running PHP.
// Must end with '/'
//
// TTF_DIR:
// Directory where TTF fonts can be found. Must end with '/'
//
// The default values used if these defines are left commented out are:
//
// UNIX:
// CACHE_DIR /tmp/jpgraph_cache/
// TTF_DIR /usr/X11R6/lib/X11/fonts/truetype/
// MBTTF_DIR /usr/share/fonts/ja/TrueType/
//
// WINDOWS:
// CACHE_DIR $SERVER_TEMP/jpgraph_cache/
// TTF_DIR $SERVER_SYSTEMROOT/fonts/
// MBTTF_DIR $SERVER_SYSTEMROOT/fonts/
//
//------------------------------------------------------------------------
// DEFINE("CACHE_DIR","/tmp/jpgraph_cache/");
// DEFINE("TTF_DIR","/usr/X11R6/lib/X11/fonts/truetype/");
// DEFINE("MBTTF_DIR","/usr/share/fonts/ja/TrueType/");
//-------------------------------------------------------------------------
// Cache directory specification for use with CSIM graphs that are
// using the cache.
// The directory must be the filesysystem name as seen by PHP
// and the 'http' version must be the same directory but as
// seen by the HTTP server relative to the 'htdocs' ddirectory.
// If a relative path is specified it is taken to be relative from where
// the image script is executed.
// Note: The default setting is to create a subdirectory in the
// directory from where the image script is executed and store all files
// there. As ususal this directory must be writeable by the PHP process.
DEFINE("CSIMCACHE_DIR","csimcache/");
DEFINE("CSIMCACHE_HTTP_DIR","csimcache/");
//------------------------------------------------------------------------
// Defines for font setup
//------------------------------------------------------------------------
// Actual name of the TTF file used together with FF_CHINESE aka FF_BIG5
// This is the TTF file being used when the font family is specified as
// either FF_CHINESE or FF_BIG5
DEFINE('CHINESE_TTF_FONT','bkai00mp.ttf');
// Special unicode cyrillic language support
DEFINE("LANGUAGE_CYRILLIC",false);
// If you are setting this config to true the conversion
// will assume that the input text is windows 1251, if
// false it will assume koi8-r
DEFINE("CYRILLIC_FROM_WINDOWS",false);
// Japanese TrueType font used with FF_MINCHO, FF_PMINCHO, FF_GOTHIC, FF_PGOTHIC
DEFINE('MINCHO_TTF_FONT','ipam.ttf');
DEFINE('PMINCHO_TTF_FONT','ipamp.ttf');
DEFINE('GOTHIC_TTF_FONT','ipag.ttf');
DEFINE('PGOTHIC_TTF_FONT','ipagp.ttf');
//------------------------------------------------------------------------
// Various JpGraph Settings. Adjust accordingly to your
// preferences. Note that cache functionality is turned off by
// default (Enable by setting USE_CACHE to true)
//------------------------------------------------------------------------
// Deafult graphic format set to "auto" which will automatically
// choose the best available format in the order png,gif,jpeg
// (The supported format depends on what your PHP installation supports)
DEFINE("DEFAULT_GFORMAT","auto");
// Should the image be a truecolor image?
// Note 1: Has only effect with GD 2.0.1 and above.
// Note 2: GD 2.0.1 + PHP 4.0.6 on Win32 crashes when trying to use
// trucolor.
// Note 3: MUST be enabled to get background images working with GD2
DEFINE('USE_TRUECOLOR',true);
// Specify what version of the GD library is installed.
// If this is set to 'auto' the version will be automatically
// determined.
// However since determining the library takes ~1ms you can also
// manually specify the version if you know what version you have.
// This means that you should
// set this define to true if you have GD 2.x installed to save 1ms.
DEFINE("USE_LIBRARY_GD2",'auto');
// Should the cache be used at all? By setting this to false no
// files will be generated in the cache directory.
// The difference from READ_CACHE being that setting READ_CACHE to
// false will still create the image in the cache directory
// just not use it. By setting USE_CACHE=false no files will even
// be generated in the cache directory.
DEFINE("USE_CACHE",false);
// Should we try to find an image in the cache before generating it?
// Set this define to false to bypass the reading of the cache and always
// regenerate the image. Note that even if reading the cache is
// disabled the cached will still be updated with the newly generated
// image. Set also "USE_CACHE" below.
DEFINE("READ_CACHE",true);
// Determine if the error handler should be image based or purely
// text based. Image based makes it easier since the script will
// always return an image even in case of errors.
DEFINE("USE_IMAGE_ERROR_HANDLER",true);
// Determine if the library should also setup the default PHP
// error handler to generate a graphic error mesage. This is useful
// during development to be able to see the error message as an image
// instead as a "red-cross" in a page where an image is expected.
DEFINE("INSTALL_PHP_ERR_HANDLER",false);
// Should the library examin the global php_errmsg string and convert
// any error in it to a graphical representation. This is handy for the
// occasions when, for example, header files cannot be found and this results
// in the graph not being created and just a "red-cross" image would be seen.
// This should be turned off for a production site.
DEFINE("CATCH_PHPERRMSG",true);
// If the color palette is full should JpGraph try to allocate
// the closest match? If you plan on using background images or
// gradient fills it might be a good idea to enable this.
// If not you will otherwise get an error saying that the color palette is
// exhausted. The drawback of using approximations is that the colors
// might not be exactly what you specified.
// Note1: This does only apply to paletted images, not truecolor
// images since they don't have the limitations of maximum number
// of colors.
DEFINE("USE_APPROX_COLORS",true);
// Should usage of deprecated functions and parameters give a fatal error?
// (Useful to check if code is future proof.)
DEFINE("ERR_DEPRECATED",true);
// Should the time taken to generate each picture be branded to the lower
// left in corner in each generated image? Useful for performace measurements
// generating graphs
DEFINE("BRAND_TIMING",false);
// What format should be used for the timing string?
DEFINE("BRAND_TIME_FORMAT","(%01.3fs)");
//------------------------------------------------------------------------
// The following constants should rarely have to be changed !
//------------------------------------------------------------------------
// What group should the cached file belong to
// (Set to "" will give the default group for the "PHP-user")
// Please note that the Apache user must be a member of the
// specified group since otherwise it is impossible for Apache
// to set the specified group.
DEFINE("CACHE_FILE_GROUP","wwwadmin");
// What permissions should the cached file have
// (Set to "" will give the default persmissions for the "PHP-user")
DEFINE("CACHE_FILE_MOD",0664);
// Decide if we should use the bresenham circle algorithm or the
// built in Arc(). Bresenham gives better visual apperance of circles
// but is more CPU intensive and slower then the built in Arc() function
// in GD. Turned off by default for speed
DEFINE("USE_BRESENHAM",false);
// Special file name to indicate that we only want to calc
// the image map in the call to Graph::Stroke() used
// internally from the GetHTMLCSIM() method.
DEFINE("_CSIM_SPECIALFILE","_csim_special_");
// HTTP GET argument that is used with image map
// to indicate to the script to just generate the image
// and not the full CSIM HTML page.
DEFINE("_CSIM_DISPLAY","_jpg_csimd");
// Special filename for Graph::Stroke(). If this filename is given
// then the image will NOT be streamed to browser of file. Instead the
// Stroke call will return the handler for the created GD image.
DEFINE("_IMG_HANDLER","__handle");
?>

@ -0,0 +1,138 @@
<?php
//=======================================================================
// File: JPG-CONFIG.INC
// Description: Configuration file for JpGraph library
// Created: 2004-03-27
// Ver: $Id: jpg-config.inc.php 1871 2009-09-29 05:56:39Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
//------------------------------------------------------------------------
// Directories for cache and font directory.
//
// CACHE_DIR:
// The full absolute name of the directory to be used to store the
// cached image files. This directory will not be used if the USE_CACHE
// define (further down) is false. If you enable the cache please note that
// this directory MUST be readable and writable for the process running PHP.
// Must end with '/'
//
// TTF_DIR:
// Directory where TTF fonts can be found. Must end with '/'
//
// The default values used if these defines are left commented out are:
//
// UNIX:
// CACHE_DIR /tmp/jpgraph_cache/
// TTF_DIR /usr/share/fonts/truetype/
// MBTTF_DIR /usr/share/fonts/truetype/
//
// WINDOWS:
// CACHE_DIR $SERVER_TEMP/jpgraph_cache/
// TTF_DIR $SERVER_SYSTEMROOT/fonts/
// MBTTF_DIR $SERVER_SYSTEMROOT/fonts/
//
//------------------------------------------------------------------------
// define('CACHE_DIR','/tmp/jpgraph_cache/');
// define('TTF_DIR','/usr/share/fonts/TrueType/');
// define('MBTTF_DIR','/usr/share/fonts/TrueType/');
//-------------------------------------------------------------------------
// Cache directory specification for use with CSIM graphs that are
// using the cache.
// The directory must be the filesysystem name as seen by PHP
// and the 'http' version must be the same directory but as
// seen by the HTTP server relative to the 'htdocs' ddirectory.
// If a relative path is specified it is taken to be relative from where
// the image script is executed.
// Note: The default setting is to create a subdirectory in the
// directory from where the image script is executed and store all files
// there. As ususal this directory must be writeable by the PHP process.
define('CSIMCACHE_DIR','csimcache/');
define('CSIMCACHE_HTTP_DIR','csimcache/');
//------------------------------------------------------------------------
// Various JpGraph Settings. Adjust accordingly to your
// preferences. Note that cache functionality is turned off by
// default (Enable by setting USE_CACHE to true)
//------------------------------------------------------------------------
// Deafult locale for error messages.
// This defaults to English = 'en'
define('DEFAULT_ERR_LOCALE','en');
// Deafult graphic format set to 'auto' which will automatically
// choose the best available format in the order png,gif,jpeg
// (The supported format depends on what your PHP installation supports)
define('DEFAULT_GFORMAT','auto');
// Should the cache be used at all? By setting this to false no
// files will be generated in the cache directory.
// The difference from READ_CACHE being that setting READ_CACHE to
// false will still create the image in the cache directory
// just not use it. By setting USE_CACHE=false no files will even
// be generated in the cache directory.
define('USE_CACHE',false);
// Should we try to find an image in the cache before generating it?
// Set this define to false to bypass the reading of the cache and always
// regenerate the image. Note that even if reading the cache is
// disabled the cached will still be updated with the newly generated
// image. Set also 'USE_CACHE' below.
define('READ_CACHE',true);
// Determine if the error handler should be image based or purely
// text based. Image based makes it easier since the script will
// always return an image even in case of errors.
define('USE_IMAGE_ERROR_HANDLER',true);
// Should the library examine the global php_errmsg string and convert
// any error in it to a graphical representation. This is handy for the
// occasions when, for example, header files cannot be found and this results
// in the graph not being created and just a 'red-cross' image would be seen.
// This should be turned off for a production site.
define('CATCH_PHPERRMSG',true);
// Determine if the library should also setup the default PHP
// error handler to generate a graphic error mesage. This is useful
// during development to be able to see the error message as an image
// instead as a 'red-cross' in a page where an image is expected.
define('INSTALL_PHP_ERR_HANDLER',false);
// Should usage of deprecated functions and parameters give a fatal error?
// (Useful to check if code is future proof.)
define('ERR_DEPRECATED',true);
// The builtin GD function imagettfbbox() fuction which calculates the bounding box for
// text using TTF fonts is buggy. By setting this define to true the library
// uses its own compensation for this bug. However this will give a
// slightly different visual apparance than not using this compensation.
// Enabling this compensation will in general give text a bit more space to more
// truly reflect the actual bounding box which is a bit larger than what the
// GD function thinks.
define('USE_LIBRARY_IMAGETTFBBOX',true);
//------------------------------------------------------------------------
// The following constants should rarely have to be changed !
//------------------------------------------------------------------------
// What group should the cached file belong to
// (Set to '' will give the default group for the 'PHP-user')
// Please note that the Apache user must be a member of the
// specified group since otherwise it is impossible for Apache
// to set the specified group.
define('CACHE_FILE_GROUP','www');
// What permissions should the cached file have
// (Set to '' will give the default persmissions for the 'PHP-user')
define('CACHE_FILE_MOD',0664);
// Default theme class name
define('DEFAULT_THEME_CLASS', 'UniversalTheme');
define('SUPERSAMPLING', true);
define('SUPERSAMPLING_SCALE', 1);
?>

File diff suppressed because it is too large Load Diff

@ -1,205 +1,205 @@
<?php
//=======================================================================
// File: JPGRAPH_ANTISPAM.PHP
// Description: Genarate anti-spam challenge
// Created: 2004-10-07
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: jpgraph_antispam-digits.php,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
class HandDigits {
var $digits_thumb30x30 = array();
var $iHeight=30, $iWidth=30;
function HandDigits() {
//==========================================================
// d6-small.jpg
//==========================================================
$this->digits['6'][0]= 645 ;
$this->digits['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' ;
//==========================================================
// d2-small.jpg
//==========================================================
$this->digits['2'][0]= 606 ;
$this->digits['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' ;
//==========================================================
// d9-small.jpg
//==========================================================
$this->digits['9'][0]= 680 ;
$this->digits['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->digits['5'][0]= 632 ;
$this->digits['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->digits['1'][0]= 646 ;
$this->digits['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==' ;
//==========================================================
// d8-small.jpg
//==========================================================
$this->digits['8'][0]= 694 ;
$this->digits['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==' ;
//==========================================================
// d4-small.jpg
//==========================================================
$this->digits['4'][0]= 643 ;
$this->digits['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==' ;
//==========================================================
// d7-small.jpg
//==========================================================
$this->digits['7'][0]= 658 ;
$this->digits['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==' ;
//==========================================================
// d3-small.jpg
//==========================================================
$this->digits['3'][0]= 662 ;
$this->digits['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=' ;
}
}
class AntiSpam {
var $iNumber='';
function AntiSpam($aNumber='') {
$this->iNumber = $aNumber;
}
function Rand($aLen) {
$d='';
for($i=0; $i < $aLen; ++$i) {
$d .= rand(1,9);
}
$this->iNumber = $d;
return $d;
}
function Stroke() {
$n=strlen($this->iNumber);
for($i=0; $i < $n; ++$i ) {
if( !is_numeric($this->iNumber[$i]) || $this->iNumber[$i]==0 ) {
return false;
}
}
$dd = new HandDigits();
$n = strlen($this->iNumber);
$img = @imagecreatetruecolor($n*$dd->iWidth, $dd->iHeight);
if( $img < 1 ) {
return false;
}
$start=0;
for($i=0; $i < $n; ++$i ) {
$size = $dd->digits[$this->iNumber[$i]][0];
$dimg = imagecreatefromstring(base64_decode($dd->digits[$this->iNumber[$i]][1]));
imagecopy($img,$dimg,$start,0,0,0,imagesx($dimg), $dd->iHeight);
$start += imagesx($dimg);
}
$resimg = @imagecreatetruecolor($start+4, $dd->iHeight+4);
if( $resimg < 1 ) {
return false;
}
imagecopy($resimg,$img,2,2,0,0,$start, $dd->iHeight);
header("Content-type: image/jpeg");
imagejpeg($resimg);
return true;
}
}
?>
<?php
//=======================================================================
// File: JPGRAPH_ANTISPAM.PHP
// Description: Genarate anti-spam challenge
// Created: 2004-10-07
// Ver: $Id: jpgraph_antispam-digits.php 1930 2010-01-22 20:19:27Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
class HandDigits {
public $digits = array();
public $iHeight=30, $iWidth=30;
function __construct() {
//==========================================================
// d6-small.jpg
//==========================================================
$this->digits['6'][0]= 645 ;
$this->digits['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' ;
//==========================================================
// d2-small.jpg
//==========================================================
$this->digits['2'][0]= 606 ;
$this->digits['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' ;
//==========================================================
// d9-small.jpg
//==========================================================
$this->digits['9'][0]= 680 ;
$this->digits['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->digits['5'][0]= 632 ;
$this->digits['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->digits['1'][0]= 646 ;
$this->digits['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==' ;
//==========================================================
// d8-small.jpg
//==========================================================
$this->digits['8'][0]= 694 ;
$this->digits['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==' ;
//==========================================================
// d4-small.jpg
//==========================================================
$this->digits['4'][0]= 643 ;
$this->digits['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==' ;
//==========================================================
// d7-small.jpg
//==========================================================
$this->digits['7'][0]= 658 ;
$this->digits['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==' ;
//==========================================================
// d3-small.jpg
//==========================================================
$this->digits['3'][0]= 662 ;
$this->digits['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=' ;
}
}
class AntiSpam {
private $iNumber='';
function __construct($aNumber='') {
$this->iNumber = $aNumber;
}
function Rand($aLen) {
$d='';
for($i=0; $i < $aLen; ++$i) {
$d .= rand(1,9);
}
$this->iNumber = $d;
return $d;
}
function Stroke() {
$n=strlen($this->iNumber);
for($i=0; $i < $n; ++$i ) {
if( !is_numeric($this->iNumber[$i]) || $this->iNumber[$i]==0 ) {
return false;
}
}
$dd = new HandDigits();
$n = strlen($this->iNumber);
$img = @imagecreatetruecolor($n*$dd->iWidth, $dd->iHeight);
if( $img < 1 ) {
return false;
}
$start=0;
for($i=0; $i < $n; ++$i ) {
$size = $dd->digits[$this->iNumber[$i]][0];
$dimg = imagecreatefromstring(base64_decode($dd->digits[$this->iNumber[$i]][1]));
imagecopy($img,$dimg,$start,0,0,0,imagesx($dimg), $dd->iHeight);
$start += imagesx($dimg);
}
$resimg = @imagecreatetruecolor($start+4, $dd->iHeight+4);
if( $resimg < 1 ) {
return false;
}
imagecopy($resimg,$img,2,2,0,0,$start, $dd->iHeight);
header("Content-type: image/jpeg");
imagejpeg($resimg);
return true;
}
}
?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,77 +1,95 @@
<?php
/*=======================================================================
// File: JPGRAPH_CANVAS.PHP
// Description: Canvas drawing extension for JpGraph
// Created: 2001-01-08
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: jpgraph_canvas.php,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// 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 CanvasGraph($aWidth=300,$aHeight=200,$aCachedName="",$timeout=0,$inline=1) {
$this->Graph($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();
// Should we do any final image transformation
if( $this->iImgTrans ) {
if( !class_exists('ImgTrans') ) {
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 */
?>
<?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) Asial Corporation. 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 */
?>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,587 @@
<?php
/*=======================================================================
// File: JPGRAPH_CONTOUR.PHP
// Description: Contour plot
// Created: 2009-03-08
// Ver: $Id: jpgraph_contour.php 1870 2009-09-29 04:24:18Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
*/
require_once('jpgraph_meshinterpolate.inc.php');
define('HORIZ_EDGE',0);
define('VERT_EDGE',1);
/**
* This class encapsulates the core contour plot algorithm. It will find the path
* of the specified isobars in the data matrix specified. It is assumed that the
* data matrix models an equspaced X-Y mesh of datavalues corresponding to the Z
* values.
*
*/
class Contour {
private $dataPoints = array();
private $nbrCols=0,$nbrRows=0;
private $horizEdges = array(), $vertEdges=array();
private $isobarValues = array();
private $stack = null;
private $isobarCoord = array();
private $nbrIsobars = 10, $isobarColors = array();
private $invert = true;
private $highcontrast = false, $highcontrastbw = false;
/**
* Create a new contour level "algorithm machine".
* @param $aMatrix The values to find the contour from
* @param $aIsobars Mixed. If integer it determines the number of isobars to be used. The levels are determined
* automatically as equdistance between the min and max value of the matrice.
* If $aIsobars is an array then this is interpretated as an array of values to be used as isobars in the
* contour plot.
* @return an instance of the contour algorithm
*/
function __construct($aMatrix,$aIsobars=10, $aColors=null) {
$this->nbrRows = count($aMatrix);
$this->nbrCols = count($aMatrix[0]);
$this->dataPoints = $aMatrix;
if( is_array($aIsobars) ) {
// use the isobar values supplied
$this->nbrIsobars = count($aIsobars);
$this->isobarValues = $aIsobars;
}
else {
// Determine the isobar values automatically
$this->nbrIsobars = $aIsobars;
list($min,$max) = $this->getMinMaxVal();
$stepSize = ($max-$min) / $aIsobars ;
$isobar = $min+$stepSize/2;
for ($i = 0; $i < $aIsobars; $i++) {
$this->isobarValues[$i] = $isobar;
$isobar += $stepSize;
}
}
if( $aColors !== null && count($aColors) > 0 ) {
if( !is_array($aColors) ) {
JpGraphError::RaiseL(28001);
//'Third argument to Contour must be an array of colors.'
}
if( count($aColors) != count($this->isobarValues) ) {
JpGraphError::RaiseL(28002);
//'Number of colors must equal the number of isobar lines specified';
}
$this->isobarColors = $aColors;
}
}
/**
* Flip the plot around the Y-coordinate. This has the same affect as flipping the input
* data matrice
*
* @param $aFlg If true the the vertice in input data matrice position (0,0) corresponds to the top left
* corner of teh plot otherwise it will correspond to the bottom left corner (a horizontal flip)
*/
function SetInvert($aFlg=true) {
$this->invert = $aFlg;
}
/**
* Find the min and max values in the data matrice
*
* @return array(min_value,max_value)
*/
function getMinMaxVal() {
$min = $this->dataPoints[0][0];
$max = $this->dataPoints[0][0];
for ($i = 0; $i < $this->nbrRows; $i++) {
if( ($mi=min($this->dataPoints[$i])) < $min ) $min = $mi;
if( ($ma=max($this->dataPoints[$i])) > $max ) $max = $ma;
}
return array($min,$max);
}
/**
* Reset the two matrices that keeps track on where the isobars crosses the
* horizontal and vertical edges
*/
function resetEdgeMatrices() {
for ($k = 0; $k < 2; $k++) {
for ($i = 0; $i <= $this->nbrRows; $i++) {
for ($j = 0; $j <= $this->nbrCols; $j++) {
$this->edges[$k][$i][$j] = false;
}
}
}
}
/**
* Determine if the specified isobar crosses the horizontal edge specified by its row and column
*
* @param $aRow Row index of edge to be checked
* @param $aCol Col index of edge to be checked
* @param $aIsobar Isobar value
* @return true if the isobar is crossing this edge
*/
function isobarHCrossing($aRow,$aCol,$aIsobar) {
if( $aCol >= $this->nbrCols-1 ) {
JpGraphError::RaiseL(28003,$aCol);
//'ContourPlot Internal Error: isobarHCrossing: Coloumn index too large (%d)'
}
if( $aRow >= $this->nbrRows ) {
JpGraphError::RaiseL(28004,$aRow);
//'ContourPlot Internal Error: isobarHCrossing: Row index too large (%d)'
}
$v1 = $this->dataPoints[$aRow][$aCol];
$v2 = $this->dataPoints[$aRow][$aCol+1];
return ($aIsobar-$v1)*($aIsobar-$v2) < 0 ;
}
/**
* Determine if the specified isobar crosses the vertical edge specified by its row and column
*
* @param $aRow Row index of edge to be checked
* @param $aCol Col index of edge to be checked
* @param $aIsobar Isobar value
* @return true if the isobar is crossing this edge
*/
function isobarVCrossing($aRow,$aCol,$aIsobar) {
if( $aRow >= $this->nbrRows-1) {
JpGraphError::RaiseL(28005,$aRow);
//'isobarVCrossing: Row index too large
}
if( $aCol >= $this->nbrCols ) {
JpGraphError::RaiseL(28006,$aCol);
//'isobarVCrossing: Col index too large
}
$v1 = $this->dataPoints[$aRow][$aCol];
$v2 = $this->dataPoints[$aRow+1][$aCol];
return ($aIsobar-$v1)*($aIsobar-$v2) < 0 ;
}
/**
* Determine all edges, horizontal and vertical that the specified isobar crosses. The crossings
* are recorded in the two edge matrices.
*
* @param $aIsobar The value of the isobar to be checked
*/
function determineIsobarEdgeCrossings($aIsobar) {
$ib = $this->isobarValues[$aIsobar];
for ($i = 0; $i < $this->nbrRows-1; $i++) {
for ($j = 0; $j < $this->nbrCols-1; $j++) {
$this->edges[HORIZ_EDGE][$i][$j] = $this->isobarHCrossing($i,$j,$ib);
$this->edges[VERT_EDGE][$i][$j] = $this->isobarVCrossing($i,$j,$ib);
}
}
// We now have the bottom and rightmost edges unsearched
for ($i = 0; $i < $this->nbrRows-1; $i++) {
$this->edges[VERT_EDGE][$i][$j] = $this->isobarVCrossing($i,$this->nbrCols-1,$ib);
}
for ($j = 0; $j < $this->nbrCols-1; $j++) {
$this->edges[HORIZ_EDGE][$i][$j] = $this->isobarHCrossing($this->nbrRows-1,$j,$ib);
}
}
/**
* Return the normalized coordinates for the crossing of the specified edge with the specified
* isobar- The crossing is simpy detrmined with a linear interpolation between the two vertices
* on each side of the edge and the value of the isobar
*
* @param $aRow Row of edge
* @param $aCol Column of edge
* @param $aEdgeDir Determine if this is a horizontal or vertical edge
* @param $ib The isobar value
* @return unknown_type
*/
function getCrossingCoord($aRow,$aCol,$aEdgeDir,$aIsobarVal) {
// In order to avoid numerical problem when two vertices are very close
// we have to check and avoid dividing by close to zero denumerator.
if( $aEdgeDir == HORIZ_EDGE ) {
$d = abs($this->dataPoints[$aRow][$aCol] - $this->dataPoints[$aRow][$aCol+1]);
if( $d > 0.001 ) {
$xcoord = $aCol + abs($aIsobarVal - $this->dataPoints[$aRow][$aCol]) / $d;
}
else {
$xcoord = $aCol;
}
$ycoord = $aRow;
}
else {
$d = abs($this->dataPoints[$aRow][$aCol] - $this->dataPoints[$aRow+1][$aCol]);
if( $d > 0.001 ) {
$ycoord = $aRow + abs($aIsobarVal - $this->dataPoints[$aRow][$aCol]) / $d;
}
else {
$ycoord = $aRow;
}
$xcoord = $aCol;
}
if( $this->invert ) {
$ycoord = $this->nbrRows-1 - $ycoord;
}
return array($xcoord,$ycoord);
}
/**
* In order to avoid all kinds of unpleasent extra checks and complex boundary
* controls for the degenerated case where the contour levels exactly crosses
* one of the vertices we add a very small delta (0.1%) to the data point value.
* This has no visible affect but it makes the code sooooo much cleaner.
*
*/
function adjustDataPointValues() {
$ni = count($this->isobarValues);
for ($k = 0; $k < $ni; $k++) {
$ib = $this->isobarValues[$k];
for ($row = 0 ; $row < $this->nbrRows-1; ++$row) {
for ($col = 0 ; $col < $this->nbrCols-1; ++$col ) {
if( abs($this->dataPoints[$row][$col] - $ib) < 0.0001 ) {
$this->dataPoints[$row][$col] += $this->dataPoints[$row][$col]*0.001;
}
}
}
}
}
/**
* @param $aFlg
* @param $aBW
* @return unknown_type
*/
function UseHighContrastColor($aFlg=true,$aBW=false) {
$this->highcontrast = $aFlg;
$this->highcontrastbw = $aBW;
}
/**
* Calculate suitable colors for each defined isobar
*
*/
function CalculateColors() {
if ( $this->highcontrast ) {
if ( $this->highcontrastbw ) {
for ($ib = 0; $ib < $this->nbrIsobars; $ib++) {
$this->isobarColors[$ib] = 'black';
}
}
else {
// Use only blue/red scale
$step = round(255/($this->nbrIsobars-1));
for ($ib = 0; $ib < $this->nbrIsobars; $ib++) {
$this->isobarColors[$ib] = array($ib*$step, 50, 255-$ib*$step);
}
}
}
else {
$n = $this->nbrIsobars;
$v = 0; $step = 1 / ($this->nbrIsobars-1);
for ($ib = 0; $ib < $this->nbrIsobars; $ib++) {
$this->isobarColors[$ib] = RGB::GetSpectrum($v);
$v += $step;
}
}
}
/**
* This is where the main work is done. For each isobar the crossing of the edges are determined
* and then each cell is analyzed to find the 0, 2 or 4 crossings. Then the normalized coordinate
* for the crossings are determined and pushed on to the isobar stack. When the method is finished
* the $isobarCoord will hold one arrayfor each isobar where all the line segments that makes
* up the contour plot are stored.
*
* @return array( $isobarCoord, $isobarValues, $isobarColors )
*/
function getIsobars() {
$this->adjustDataPointValues();
for ($isobar = 0; $isobar < $this->nbrIsobars; $isobar++) {
$ib = $this->isobarValues[$isobar];
$this->resetEdgeMatrices();
$this->determineIsobarEdgeCrossings($isobar);
$this->isobarCoord[$isobar] = array();
$ncoord = 0;
for ($row = 0 ; $row < $this->nbrRows-1; ++$row) {
for ($col = 0 ; $col < $this->nbrCols-1; ++$col ) {
// Find out how many crossings around the edges
$n = 0;
if ( $this->edges[HORIZ_EDGE][$row][$col] ) $neigh[$n++] = array($row, $col, HORIZ_EDGE);
if ( $this->edges[HORIZ_EDGE][$row+1][$col] ) $neigh[$n++] = array($row+1,$col, HORIZ_EDGE);
if ( $this->edges[VERT_EDGE][$row][$col] ) $neigh[$n++] = array($row, $col, VERT_EDGE);
if ( $this->edges[VERT_EDGE][$row][$col+1] ) $neigh[$n++] = array($row, $col+1,VERT_EDGE);
if ( $n == 2 ) {
$n1=0; $n2=1;
$this->isobarCoord[$isobar][$ncoord++] = array(
$this->getCrossingCoord($neigh[$n1][0],$neigh[$n1][1],$neigh[$n1][2],$ib),
$this->getCrossingCoord($neigh[$n2][0],$neigh[$n2][1],$neigh[$n2][2],$ib) );
}
elseif ( $n == 4 ) {
// We must determine how to connect the edges either northwest->southeast or
// northeast->southwest. We do that by calculating the imaginary middle value of
// the cell by averaging the for corners. This will compared with the value of the
// top left corner will help determine the orientation of the ridge/creek
$midval = ($this->dataPoints[$row][$col]+$this->dataPoints[$row][$col+1]+$this->dataPoints[$row+1][$col]+$this->dataPoints[$row+1][$col+1])/4;
$v = $this->dataPoints[$row][$col];
if( $midval == $ib ) {
// Orientation "+"
$n1=0; $n2=1; $n3=2; $n4=3;
} elseif ( ($midval > $ib && $v > $ib) || ($midval < $ib && $v < $ib) ) {
// Orientation of ridge/valley = "\"
$n1=0; $n2=3; $n3=2; $n4=1;
} elseif ( ($midval > $ib && $v < $ib) || ($midval < $ib && $v > $ib) ) {
// Orientation of ridge/valley = "/"
$n1=0; $n2=2; $n3=3; $n4=1;
}
$this->isobarCoord[$isobar][$ncoord++] = array(
$this->getCrossingCoord($neigh[$n1][0],$neigh[$n1][1],$neigh[$n1][2],$ib),
$this->getCrossingCoord($neigh[$n2][0],$neigh[$n2][1],$neigh[$n2][2],$ib) );
$this->isobarCoord[$isobar][$ncoord++] = array(
$this->getCrossingCoord($neigh[$n3][0],$neigh[$n3][1],$neigh[$n3][2],$ib),
$this->getCrossingCoord($neigh[$n4][0],$neigh[$n4][1],$neigh[$n4][2],$ib) );
}
}
}
}
if( count($this->isobarColors) == 0 ) {
// No manually specified colors. Calculate them automatically.
$this->CalculateColors();
}
return array( $this->isobarCoord, $this->isobarValues, $this->isobarColors );
}
}
/**
* This class represent a plotting of a contour outline of data given as a X-Y matrice
*
*/
class ContourPlot extends Plot {
private $contour, $contourCoord, $contourVal, $contourColor;
private $nbrCountours = 0 ;
private $dataMatrix = array();
private $invertLegend = false;
private $interpFactor = 1;
private $flipData = false;
private $isobar = 10;
private $showLegend = false;
private $highcontrast = false, $highcontrastbw = false;
private $manualIsobarColors = array();
/**
* Construct a contour plotting algorithm. The end result of the algorithm is a sequence of
* line segments for each isobar given as two vertices.
*
* @param $aDataMatrix The Z-data to be used
* @param $aIsobar A mixed variable, if it is an integer then this specified the number of isobars to use.
* The values of the isobars are automatically detrmined to be equ-spaced between the min/max value of the
* data. If it is an array then it explicetely gives the isobar values
* @param $aInvert By default the matrice with row index 0 corresponds to Y-value 0, i.e. in the bottom of
* the plot. If this argument is true then the row with the highest index in the matrice corresponds to
* Y-value 0. In affect flipping the matrice around an imaginary horizontal axis.
* @param $aHighContrast Use high contrast colors (blue/red:ish)
* @param $aHighContrastBW Use only black colors for contours
* @return an instance of the contour plot algorithm
*/
function __construct($aDataMatrix, $aIsobar=10, $aFactor=1, $aInvert=false, $aIsobarColors=array()) {
$this->dataMatrix = $aDataMatrix;
$this->flipData = $aInvert;
$this->isobar = $aIsobar;
$this->interpFactor = $aFactor;
if ( $this->interpFactor > 1 ) {
if( $this->interpFactor > 5 ) {
JpGraphError::RaiseL(28007);// ContourPlot interpolation factor is too large (>5)
}
$ip = new MeshInterpolate();
$this->dataMatrix = $ip->Linear($this->dataMatrix, $this->interpFactor);
}
$this->contour = new Contour($this->dataMatrix,$this->isobar,$aIsobarColors);
if( is_array($aIsobar) )
$this->nbrContours = count($aIsobar);
else
$this->nbrContours = $aIsobar;
}
/**
* Flipe the data around the center
*
* @param $aFlg
*
*/
function SetInvert($aFlg=true) {
$this->flipData = $aFlg;
}
/**
* Set the colors for the isobar lines
*
* @param $aColorArray
*
*/
function SetIsobarColors($aColorArray) {
$this->manualIsobarColors = $aColorArray;
}
/**
* Show the legend
*
* @param $aFlg true if the legend should be shown
*
*/
function ShowLegend($aFlg=true) {
$this->showLegend = $aFlg;
}
/**
* @param $aFlg true if the legend should start with the lowest isobar on top
* @return unknown_type
*/
function Invertlegend($aFlg=true) {
$this->invertLegend = $aFlg;
}
/* Internal method. Give the min value to be used for the scaling
*
*/
function Min() {
return array(0,0);
}
/* Internal method. Give the max value to be used for the scaling
*
*/
function Max() {
return array(count($this->dataMatrix[0])-1,count($this->dataMatrix)-1);
}
/**
* Internal ramewrok method to setup the legend to be used for this plot.
* @param $aGraph The parent graph class
*/
function Legend($aGraph) {
if( ! $this->showLegend )
return;
if( $this->invertLegend ) {
for ($i = 0; $i < $this->nbrContours; $i++) {
$aGraph->legend->Add(sprintf('%.1f',$this->contourVal[$i]), $this->contourColor[$i]);
}
}
else {
for ($i = $this->nbrContours-1; $i >= 0 ; $i--) {
$aGraph->legend->Add(sprintf('%.1f',$this->contourVal[$i]), $this->contourColor[$i]);
}
}
}
/**
* Framework function which gets called before the Stroke() method is called
*
* @see Plot#PreScaleSetup($aGraph)
*
*/
function PreScaleSetup($aGraph) {
$xn = count($this->dataMatrix[0])-1;
$yn = count($this->dataMatrix)-1;
$aGraph->xaxis->scale->Update($aGraph->img,0,$xn);
$aGraph->yaxis->scale->Update($aGraph->img,0,$yn);
$this->contour->SetInvert($this->flipData);
list($this->contourCoord,$this->contourVal,$this->contourColor) = $this->contour->getIsobars();
}
/**
* Use high contrast color schema
*
* @param $aFlg True, to use high contrast color
* @param $aBW True, Use only black and white color schema
*/
function UseHighContrastColor($aFlg=true,$aBW=false) {
$this->highcontrast = $aFlg;
$this->highcontrastbw = $aBW;
$this->contour->UseHighContrastColor($this->highcontrast,$this->highcontrastbw);
}
/**
* Internal method. Stroke the contour plot to the graph
*
* @param $img Image handler
* @param $xscale Instance of the xscale to use
* @param $yscale Instance of the yscale to use
*/
function Stroke($img,$xscale,$yscale) {
if( count($this->manualIsobarColors) > 0 ) {
$this->contourColor = $this->manualIsobarColors;
if( count($this->manualIsobarColors) != $this->nbrContours ) {
JpGraphError::RaiseL(28002);
}
}
$img->SetLineWeight($this->line_weight);
for ($c = 0; $c < $this->nbrContours; $c++) {
$img->SetColor( $this->contourColor[$c] );
$n = count($this->contourCoord[$c]);
$i = 0;
while ( $i < $n ) {
list($x1,$y1) = $this->contourCoord[$c][$i][0];
$x1t = $xscale->Translate($x1);
$y1t = $yscale->Translate($y1);
list($x2,$y2) = $this->contourCoord[$c][$i++][1];
$x2t = $xscale->Translate($x2);
$y2t = $yscale->Translate($y2);
$img->Line($x1t,$y1t,$x2t,$y2t);
}
}
}
}
// EOF
?>

@ -1,492 +1,505 @@
<?php
/*=======================================================================
// File: JPGRAPH_DATE.PHP
// Description: Classes to handle Date scaling
// Created: 2005-05-02
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: jpgraph_date.php,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
DEFINE('HOURADJ_1',0+30);
DEFINE('HOURADJ_2',1+30);
DEFINE('HOURADJ_3',2+30);
DEFINE('HOURADJ_4',3+30);
DEFINE('HOURADJ_6',4+30);
DEFINE('HOURADJ_12',5+30);
DEFINE('MINADJ_1',0+20);
DEFINE('MINADJ_5',1+20);
DEFINE('MINADJ_10',2+20);
DEFINE('MINADJ_15',3+20);
DEFINE('MINADJ_30',4+20);
DEFINE('SECADJ_1',0);
DEFINE('SECADJ_5',1);
DEFINE('SECADJ_10',2);
DEFINE('SECADJ_15',3);
DEFINE('SECADJ_30',4);
DEFINE('YEARADJ_1',0+30);
DEFINE('YEARADJ_2',1+30);
DEFINE('YEARADJ_5',2+30);
DEFINE('MONTHADJ_1',0+20);
DEFINE('MONTHADJ_6',1+20);
DEFINE('DAYADJ_1',0);
DEFINE('DAYADJ_WEEK',1);
DEFINE('DAYADJ_7',1);
DEFINE('SECPERYEAR',31536000);
DEFINE('SECPERDAY',86400);
DEFINE('SECPERHOUR',3600);
DEFINE('SECPERMIN',60);
class DateScale extends LinearScale {
var $date_format = '';
var $iStartAlign = false, $iEndAlign = false;
var $iStartTimeAlign = false, $iEndTimeAlign = false;
//---------------
// CONSTRUCTOR
function DateScale($aMin=0,$aMax=0,$aType='x') {
assert($aType=="x");
assert($aMin<=$aMax);
$this->type=$aType;
$this->scale=array($aMin,$aMax);
$this->world_size=$aMax-$aMin;
$this->ticks = new LinearTicks();
$this->intscale=true;
}
//------------------------------------------------------------------------------------------
// Utility Function AdjDate()
// Description: Will round a given time stamp to an even year, month or day
// argument.
//------------------------------------------------------------------------------------------
function AdjDate($aTime,$aRound=0,$aYearType=false,$aMonthType=false,$aDayType=false) {
$y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime);
$h=0;$i=0;$s=0;
if( $aYearType !== false ) {
$yearAdj = array(0=>1, 1=>2, 2=>5);
if( $aRound == 0 ) {
$y = floor($y/$yearAdj[$aYearType])*$yearAdj[$aYearType];
}
else {
++$y;
$y = ceil($y/$yearAdj[$aYearType])*$yearAdj[$aYearType];
}
$m=1;$d=1;
}
elseif( $aMonthType !== false ) {
$monthAdj = array(0=>1, 1=>6);
if( $aRound == 0 ) {
$m = floor($m/$monthAdj[$aMonthType])*$monthAdj[$aMonthType];
$d=1;
}
else {
++$m;
$m = ceil($m/$monthAdj[$aMonthType])*$monthAdj[$aMonthType];
$d=1;
}
}
elseif( $aDayType !== false ) {
if( $aDayType == 0 ) {
if( $aRound == 1 ) {
//++$d;
$h=23;$i=59;$s=59;
}
}
else {
// Adjust to an even week boundary.
$w = (int)date('w',$aTime); // Day of week 0=Sun, 6=Sat
if( true ) { // Adjust to start on Mon
if( $w==0 ) $w=6;
else --$w;
}
if( $aRound == 0 ) {
$d -= $w;
}
else {
$d += (7-$w);
$h=23;$i=59;$s=59;
}
}
}
return mktime($h,$i,$s,$m,$d,$y);
}
//------------------------------------------------------------------------------------------
// Wrapper for AdjDate that will round a timestamp to an even date rounding
// it downwards.
//------------------------------------------------------------------------------------------
function AdjStartDate($aTime,$aYearType=false,$aMonthType=false,$aDayType=false) {
return $this->AdjDate($aTime,0,$aYearType,$aMonthType,$aDayType);
}
//------------------------------------------------------------------------------------------
// Wrapper for AdjDate that will round a timestamp to an even date rounding
// it upwards
//------------------------------------------------------------------------------------------
function AdjEndDate($aTime,$aYearType=false,$aMonthType=false,$aDayType=false) {
return $this->AdjDate($aTime,1,$aYearType,$aMonthType,$aDayType);
}
//------------------------------------------------------------------------------------------
// Utility Function AdjTime()
// Description: Will round a given time stamp to an even time according to
// argument.
//------------------------------------------------------------------------------------------
function AdjTime($aTime,$aRound=0,$aHourType=false,$aMinType=false,$aSecType=false) {
$y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime);
$h = (int)date('H',$aTime); $i = (int)date('i',$aTime); $s = (int)date('s',$aTime);
if( $aHourType !== false ) {
$aHourType %= 6;
$hourAdj = array(0=>1, 1=>2, 2=>3, 3=>4, 4=>6, 5=>12);
if( $aRound == 0 )
$h = floor($h/$hourAdj[$aHourType])*$hourAdj[$aHourType];
else {
if( ($h % $hourAdj[$aHourType]==0) && ($i > 0 || $s > 0) ) {
$h++;
}
$h = ceil($h/$hourAdj[$aHourType])*$hourAdj[$aHourType];
if( $h >= 24 ) {
$aTime += 86400;
$y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime);
$h -= 24;
}
}
$i=0;$s=0;
}
elseif( $aMinType !== false ) {
$aMinType %= 5;
$minAdj = array(0=>1, 1=>5, 2=>10, 3=>15, 4=>30);
if( $aRound == 0 ) {
$i = floor($i/$minAdj[$aMinType])*$minAdj[$aMinType];
}
else {
if( ($i % $minAdj[$aMinType]==0) && $s > 0 ) {
$i++;
}
$i = ceil($i/$minAdj[$aMinType])*$minAdj[$aMinType];
if( $i >= 60) {
$aTime += 3600;
$y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime);
$h = (int)date('H',$aTime); $i = 0;
}
}
$s=0;
}
elseif( $aSecType !== false ) {
$aSecType %= 5;
$secAdj = array(0=>1, 1=>5, 2=>10, 3=>15, 4=>30);
if( $aRound == 0 ) {
$s = floor($s/$secAdj[$aSecType])*$secAdj[$aSecType];
}
else {
$s = ceil($s/$secAdj[$aSecType]*1.0)*$secAdj[$aSecType];
if( $s >= 60) {
$s=0;
$aTime += 60;
$y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime);
$h = (int)date('H',$aTime); $i = (int)date('i',$aTime);
}
}
}
return mktime($h,$i,$s,$m,$d,$y);
}
//------------------------------------------------------------------------------------------
// Wrapper for AdjTime that will round a timestamp to an even time rounding
// it downwards.
// Example: AdjStartTime(mktime(18,27,13,2,22,2005),false,2) => 18:20
//------------------------------------------------------------------------------------------
function AdjStartTime($aTime,$aHourType=false,$aMinType=false,$aSecType=false) {
return $this->AdjTime($aTime,0,$aHourType,$aMinType,$aSecType);
}
//------------------------------------------------------------------------------------------
// Wrapper for AdjTime that will round a timestamp to an even time rounding
// it upwards
// Example: AdjEndTime(mktime(18,27,13,2,22,2005),false,2) => 18:30
//------------------------------------------------------------------------------------------
function AdjEndTime($aTime,$aHourType=false,$aMinType=false,$aSecType=false) {
return $this->AdjTime($aTime,1,$aHourType,$aMinType,$aSecType);
}
//------------------------------------------------------------------------------------------
// DateAutoScale
// Autoscale a date axis given start and end time
// Returns an array ($start,$end,$major,$minor,$format)
//------------------------------------------------------------------------------------------
function DoDateAutoScale($aStartTime,$aEndTime,$aDensity=0,$aAdjust=true) {
// Format of array
// array ( Decision point, array( array( Major-scale-step-array ),
// array( Minor-scale-step-array ),
// array( 0=date-adjust, 1=time-adjust, adjustment-alignment) )
//
$scalePoints =
array(
/* Intervall larger than 10 years */
SECPERYEAR*10,array(array(SECPERYEAR*5,SECPERYEAR*2),
array(SECPERYEAR),
array(0,YEARADJ_1, 0,YEARADJ_1) ),
/* Intervall larger than 2 years */
SECPERYEAR*2,array(array(SECPERYEAR),array(SECPERYEAR),
array(0,YEARADJ_1) ),
/* Intervall larger than 90 days (approx 3 month) */
SECPERDAY*90,array(array(SECPERDAY*30,SECPERDAY*14,SECPERDAY*7,SECPERDAY),
array(SECPERDAY*5,SECPERDAY*7,SECPERDAY,SECPERDAY),
array(0,MONTHADJ_1, 0,DAYADJ_WEEK, 0,DAYADJ_1, 0,DAYADJ_1)),
/* Intervall larger than 30 days (approx 1 month) */
SECPERDAY*30,array(array(SECPERDAY*14,SECPERDAY*7,SECPERDAY*2, SECPERDAY),
array(SECPERDAY,SECPERDAY.SECPERDAY,SECPERDAY),
array(0,DAYADJ_WEEK, 0,DAYADJ_1, 0,DAYADJ_1, 0,DAYADJ_1)),
/* Intervall larger than 7 days */
SECPERDAY*7,array(array(SECPERDAY,SECPERHOUR*12,SECPERHOUR*6,SECPERHOUR*2),
array(SECPERHOUR*6,SECPERHOUR*3,SECPERHOUR,SECPERHOUR),
array(0,DAYADJ_1, 1,HOURADJ_12, 1,HOURADJ_6, 1,HOURADJ_1)),
/* Intervall larger than 1 day */
SECPERDAY,array(array(SECPERDAY,SECPERHOUR*12,SECPERHOUR*6,SECPERHOUR*2,SECPERHOUR),
array(SECPERHOUR*6,SECPERHOUR*2,SECPERHOUR,SECPERHOUR,SECPERHOUR),
array(1,HOURADJ_12, 1,HOURADJ_6, 1,HOURADJ_1, 1,HOURADJ_1)),
/* Intervall larger than 12 hours */
SECPERHOUR*12,array(array(SECPERHOUR*2,SECPERHOUR,SECPERMIN*30,900,600),
array(1800,1800,900,300,300),
array(1,HOURADJ_1, 1,MINADJ_30, 1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5) ),
/* Intervall larger than 2 hours */
SECPERHOUR*2,array(array(SECPERHOUR,SECPERMIN*30,900,600,300),
array(1800,900,300,120,60),
array(1,HOURADJ_1, 1,MINADJ_30, 1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5) ),
/* Intervall larger than 1 hours */
SECPERHOUR,array(array(SECPERMIN*30,900,600,300),array(900,300,120,60),
array(1,MINADJ_30, 1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5) ),
/* Intervall larger than 30 min */
SECPERMIN*30,array(array(SECPERMIN*15,SECPERMIN*10,SECPERMIN*5,SECPERMIN),
array(300,300,60,10),
array(1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5, 1,MINADJ_1)),
/* Intervall larger than 1 min */
SECPERMIN,array(array(SECPERMIN,15,10,5),
array(15,5,2,1),
array(1,MINADJ_1, 1,SECADJ_15, 1,SECADJ_10, 1,SECADJ_5)),
/* Intervall larger than 10 sec */
10,array(array(5,2),
array(1,1),
array(1,SECADJ_5, 1,SECADJ_1)),
/* Intervall larger than 1 sec */
1,array(array(1),
array(1),
array(1,SECADJ_1)),
);
$ns = count($scalePoints);
// Establish major and minor scale units for the date scale
$diff = $aEndTime - $aStartTime;
if( $diff < 1 ) return false;
$done=false;
$i=0;
while( ! $done ) {
if( $diff > $scalePoints[2*$i] ) {
// Get major and minor scale for this intervall
$scaleSteps = $scalePoints[2*$i+1];
$major = $scaleSteps[0][min($aDensity,count($scaleSteps[0])-1)];
// Try to find out which minor step looks best
$minor = $scaleSteps[1][min($aDensity,count($scaleSteps[1])-1)];
if( $aAdjust ) {
// Find out how we should align the start and end timestamps
$idx = 2*min($aDensity,floor(count($scaleSteps[2])/2)-1);
if( $scaleSteps[2][$idx] === 0 ) {
// Use date adjustment
$adj = $scaleSteps[2][$idx+1];
if( $adj >= 30 ) {
$start = $this->AdjStartDate($aStartTime,$adj-30);
$end = $this->AdjEndDate($aEndTime,$adj-30);
}
elseif( $adj >= 20 ) {
$start = $this->AdjStartDate($aStartTime,false,$adj-20);
$end = $this->AdjEndDate($aEndTime,false,$adj-20);
}
else {
$start = $this->AdjStartDate($aStartTime,false,false,$adj);
$end = $this->AdjEndDate($aEndTime,false,false,$adj);
// We add 1 second for date adjustment to make sure we end on 00:00 the following day
// This makes the final major tick be srawn when we step day-by-day instead of ending
// on xx:59:59 which would not draw the final major tick
$end++;
}
}
else {
// Use time adjustment
$adj = $scaleSteps[2][$idx+1];
if( $adj >= 30 ) {
$start = $this->AdjStartTime($aStartTime,$adj-30);
$end = $this->AdjEndTime($aEndTime,$adj-30);
}
elseif( $adj >= 20 ) {
$start = $this->AdjStartTime($aStartTime,false,$adj-20);
$end = $this->AdjEndTime($aEndTime,false,$adj-20);
}
else {
$start = $this->AdjStartTime($aStartTime,false,false,$adj);
$end = $this->AdjEndTime($aEndTime,false,false,$adj);
}
}
}
// If the overall date span is larger than 1 day ten we show date
$format = '';
if( ($end-$start) > SECPERDAY ) {
$format = 'Y-m-d ';
}
// If the major step is less than 1 day we need to whow hours + min
if( $major < SECPERDAY ) {
$format .= 'H:i';
}
// If the major step is less than 1 min we need to show sec
if( $major < 60 ) {
$format .= ':s';
}
$done=true;
}
++$i;
}
return array($start,$end,$major,$minor,$format);
}
// Overrides the automatic determined date format. Must be a valid date() format string
function SetDateFormat($aFormat) {
$this->date_format = $aFormat;
}
function SetDateAlign($aStartAlign,$aEndAlign=false) {
if( $aEndAlign === false ) {
$aEndAlign=$aStartAlign;
}
$this->iStartAlign = $aStartAlign;
$this->iEndAlign = $aEndAlign;
}
function SetTimeAlign($aStartAlign,$aEndAlign=false) {
if( $aEndAlign === false ) {
$aEndAlign=$aStartAlign;
}
$this->iStartTimeAlign = $aStartAlign;
$this->iEndTimeAlign = $aEndAlign;
}
function AutoScale(&$img,$aStartTime,$aEndTime,$aNumSteps) {
if( $aStartTime == $aEndTime ) {
// Special case when we only have one data point.
// Create a small artifical intervall to do the autoscaling
$aStartTime -= 10;
$aEndTime += 10;
}
$done=false;
$i=0;
while( ! $done && $i < 5) {
list($adjstart,$adjend,$maj,$min,$format) = $this->DoDateAutoScale($aStartTime,$aEndTime,$i);
$n = floor(($adjend-$adjstart)/$maj);
if( $n * 1.7 > $aNumSteps ) {
$done=true;
}
$i++;
}
/*
if( 0 ) { // DEBUG
echo " Start =".date("Y-m-d H:i:s",$aStartTime)."<br>";
echo " End =".date("Y-m-d H:i:s",$aEndTime)."<br>";
echo "Adj Start =".date("Y-m-d H:i:s",$adjstart)."<br>";
echo "Adj End =".date("Y-m-d H:i:s",$adjend)."<p>";
echo "Major = $maj s, ".floor($maj/60)."min, ".floor($maj/3600)."h, ".floor($maj/86400)."day<br>";
echo "Min = $min s, ".floor($min/60)."min, ".floor($min/3600)."h, ".floor($min/86400)."day<br>";
echo "Format=$format<p>";
}
*/
if( $this->iStartTimeAlign !== false && $this->iStartAlign !== false ) {
JpGraphError::RaiseL(3001);
//('It is only possible to use either SetDateAlign() or SetTimeAlign() but not both');
}
if( $this->iStartTimeAlign !== false ) {
if( $this->iStartTimeAlign >= 30 ) {
$adjstart = $this->AdjStartTime($aStartTime,$this->iStartTimeAlign-30);
}
elseif( $this->iStartTimeAlign >= 20 ) {
$adjstart = $this->AdjStartTime($aStartTime,false,$this->iStartTimeAlign-20);
}
else {
$adjstart = $this->AdjStartTime($aStartTime,false,false,$this->iStartTimeAlign);
}
}
if( $this->iEndTimeAlign !== false ) {
if( $this->iEndTimeAlign >= 30 ) {
$adjend = $this->AdjEndTime($aEndTime,$this->iEndTimeAlign-30);
}
elseif( $this->iEndTimeAlign >= 20 ) {
$adjend = $this->AdjEndTime($aEndTime,false,$this->iEndTimeAlign-20);
}
else {
$adjend = $this->AdjEndTime($aEndTime,false,false,$this->iEndTimeAlign);
}
}
if( $this->iStartAlign !== false ) {
if( $this->iStartAlign >= 30 ) {
$adjstart = $this->AdjStartDate($aStartTime,$this->iStartAlign-30);
}
elseif( $this->iStartAlign >= 20 ) {
$adjstart = $this->AdjStartDate($aStartTime,false,$this->iStartAlign-20);
}
else {
$adjstart = $this->AdjStartDate($aStartTime,false,false,$this->iStartAlign);
}
}
if( $this->iEndAlign !== false ) {
if( $this->iEndAlign >= 30 ) {
$adjend = $this->AdjEndDate($aEndTime,$this->iEndAlign-30);
}
elseif( $this->iEndAlign >= 20 ) {
$adjend = $this->AdjEndDate($aEndTime,false,$this->iEndAlign-20);
}
else {
$adjend = $this->AdjEndDate($aEndTime,false,false,$this->iEndAlign);
}
}
$this->Update($img,$adjstart,$adjend);
if( ! $this->ticks->IsSpecified() )
$this->ticks->Set($maj,$min);
if( $this->date_format == '' )
$this->ticks->SetLabelDateFormat($format);
else
$this->ticks->SetLabelDateFormat($this->date_format);
}
}
?>
<?php
/*=======================================================================
// File: JPGRAPH_DATE.PHP
// Description: Classes to handle Date scaling
// Created: 2005-05-02
// Ver: $Id: jpgraph_date.php 1106 2009-02-22 20:16:35Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
*/
define('HOURADJ_1',0+30);
define('HOURADJ_2',1+30);
define('HOURADJ_3',2+30);
define('HOURADJ_4',3+30);
define('HOURADJ_6',4+30);
define('HOURADJ_12',5+30);
define('MINADJ_1',0+20);
define('MINADJ_5',1+20);
define('MINADJ_10',2+20);
define('MINADJ_15',3+20);
define('MINADJ_30',4+20);
define('SECADJ_1',0);
define('SECADJ_5',1);
define('SECADJ_10',2);
define('SECADJ_15',3);
define('SECADJ_30',4);
define('YEARADJ_1',0+30);
define('YEARADJ_2',1+30);
define('YEARADJ_5',2+30);
define('MONTHADJ_1',0+20);
define('MONTHADJ_6',1+20);
define('DAYADJ_1',0);
define('DAYADJ_WEEK',1);
define('DAYADJ_7',1);
define('SECPERYEAR',31536000);
define('SECPERDAY',86400);
define('SECPERHOUR',3600);
define('SECPERMIN',60);
class DateScale extends LinearScale {
private $date_format = '';
private $iStartAlign = false, $iEndAlign = false;
private $iStartTimeAlign = false, $iEndTimeAlign = false;
//---------------
// CONSTRUCTOR
function __construct($aMin=0,$aMax=0,$aType='x') {
assert($aType=="x");
assert($aMin<=$aMax);
$this->type=$aType;
$this->scale=array($aMin,$aMax);
$this->world_size=$aMax-$aMin;
$this->ticks = new LinearTicks();
$this->intscale=true;
}
//------------------------------------------------------------------------------------------
// Utility Function AdjDate()
// Description: Will round a given time stamp to an even year, month or day
// argument.
//------------------------------------------------------------------------------------------
function AdjDate($aTime,$aRound=0,$aYearType=false,$aMonthType=false,$aDayType=false) {
$y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime);
$h=0;$i=0;$s=0;
if( $aYearType !== false ) {
$yearAdj = array(0=>1, 1=>2, 2=>5);
if( $aRound == 0 ) {
$y = floor($y/$yearAdj[$aYearType])*$yearAdj[$aYearType];
}
else {
++$y;
$y = ceil($y/$yearAdj[$aYearType])*$yearAdj[$aYearType];
}
$m=1;$d=1;
}
elseif( $aMonthType !== false ) {
$monthAdj = array(0=>1, 1=>6);
if( $aRound == 0 ) {
$m = floor($m/$monthAdj[$aMonthType])*$monthAdj[$aMonthType];
$d=1;
}
else {
++$m;
$m = ceil($m/$monthAdj[$aMonthType])*$monthAdj[$aMonthType];
$d=1;
}
}
elseif( $aDayType !== false ) {
if( $aDayType == 0 ) {
if( $aRound == 1 ) {
//++$d;
$h=23;$i=59;$s=59;
}
}
else {
// Adjust to an even week boundary.
$w = (int)date('w',$aTime); // Day of week 0=Sun, 6=Sat
if( true ) { // Adjust to start on Mon
if( $w==0 ) $w=6;
else --$w;
}
if( $aRound == 0 ) {
$d -= $w;
}
else {
$d += (7-$w);
$h=23;$i=59;$s=59;
}
}
}
return mktime($h,$i,$s,$m,$d,$y);
}
//------------------------------------------------------------------------------------------
// Wrapper for AdjDate that will round a timestamp to an even date rounding
// it downwards.
//------------------------------------------------------------------------------------------
function AdjStartDate($aTime,$aYearType=false,$aMonthType=false,$aDayType=false) {
return $this->AdjDate($aTime,0,$aYearType,$aMonthType,$aDayType);
}
//------------------------------------------------------------------------------------------
// Wrapper for AdjDate that will round a timestamp to an even date rounding
// it upwards
//------------------------------------------------------------------------------------------
function AdjEndDate($aTime,$aYearType=false,$aMonthType=false,$aDayType=false) {
return $this->AdjDate($aTime,1,$aYearType,$aMonthType,$aDayType);
}
//------------------------------------------------------------------------------------------
// Utility Function AdjTime()
// Description: Will round a given time stamp to an even time according to
// argument.
//------------------------------------------------------------------------------------------
function AdjTime($aTime,$aRound=0,$aHourType=false,$aMinType=false,$aSecType=false) {
$y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime);
$h = (int)date('H',$aTime); $i = (int)date('i',$aTime); $s = (int)date('s',$aTime);
if( $aHourType !== false ) {
$aHourType %= 6;
$hourAdj = array(0=>1, 1=>2, 2=>3, 3=>4, 4=>6, 5=>12);
if( $aRound == 0 )
$h = floor($h/$hourAdj[$aHourType])*$hourAdj[$aHourType];
else {
if( ($h % $hourAdj[$aHourType]==0) && ($i > 0 || $s > 0) ) {
$h++;
}
$h = ceil($h/$hourAdj[$aHourType])*$hourAdj[$aHourType];
if( $h >= 24 ) {
$aTime += 86400;
$y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime);
$h -= 24;
}
}
$i=0;$s=0;
}
elseif( $aMinType !== false ) {
$aMinType %= 5;
$minAdj = array(0=>1, 1=>5, 2=>10, 3=>15, 4=>30);
if( $aRound == 0 ) {
$i = floor($i/$minAdj[$aMinType])*$minAdj[$aMinType];
}
else {
if( ($i % $minAdj[$aMinType]==0) && $s > 0 ) {
$i++;
}
$i = ceil($i/$minAdj[$aMinType])*$minAdj[$aMinType];
if( $i >= 60) {
$aTime += 3600;
$y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime);
$h = (int)date('H',$aTime); $i = 0;
}
}
$s=0;
}
elseif( $aSecType !== false ) {
$aSecType %= 5;
$secAdj = array(0=>1, 1=>5, 2=>10, 3=>15, 4=>30);
if( $aRound == 0 ) {
$s = floor($s/$secAdj[$aSecType])*$secAdj[$aSecType];
}
else {
$s = ceil($s/$secAdj[$aSecType]*1.0)*$secAdj[$aSecType];
if( $s >= 60) {
$s=0;
$aTime += 60;
$y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime);
$h = (int)date('H',$aTime); $i = (int)date('i',$aTime);
}
}
}
return mktime($h,$i,$s,$m,$d,$y);
}
//------------------------------------------------------------------------------------------
// Wrapper for AdjTime that will round a timestamp to an even time rounding
// it downwards.
// Example: AdjStartTime(mktime(18,27,13,2,22,2005),false,2) => 18:20
//------------------------------------------------------------------------------------------
function AdjStartTime($aTime,$aHourType=false,$aMinType=false,$aSecType=false) {
return $this->AdjTime($aTime,0,$aHourType,$aMinType,$aSecType);
}
//------------------------------------------------------------------------------------------
// Wrapper for AdjTime that will round a timestamp to an even time rounding
// it upwards
// Example: AdjEndTime(mktime(18,27,13,2,22,2005),false,2) => 18:30
//------------------------------------------------------------------------------------------
function AdjEndTime($aTime,$aHourType=false,$aMinType=false,$aSecType=false) {
return $this->AdjTime($aTime,1,$aHourType,$aMinType,$aSecType);
}
//------------------------------------------------------------------------------------------
// DateAutoScale
// Autoscale a date axis given start and end time
// Returns an array ($start,$end,$major,$minor,$format)
//------------------------------------------------------------------------------------------
function DoDateAutoScale($aStartTime,$aEndTime,$aDensity=0,$aAdjust=true) {
// Format of array
// array ( Decision point, array( array( Major-scale-step-array ),
// array( Minor-scale-step-array ),
// array( 0=date-adjust, 1=time-adjust, adjustment-alignment) )
//
$scalePoints =
array(
/* Intervall larger than 10 years */
SECPERYEAR*10,array(array(SECPERYEAR*5,SECPERYEAR*2),
array(SECPERYEAR),
array(0,YEARADJ_1, 0,YEARADJ_1) ),
/* Intervall larger than 2 years */
SECPERYEAR*2,array(array(SECPERYEAR),array(SECPERYEAR),
array(0,YEARADJ_1) ),
/* Intervall larger than 90 days (approx 3 month) */
SECPERDAY*90,array(array(SECPERDAY*30,SECPERDAY*14,SECPERDAY*7,SECPERDAY),
array(SECPERDAY*5,SECPERDAY*7,SECPERDAY,SECPERDAY),
array(0,MONTHADJ_1, 0,DAYADJ_WEEK, 0,DAYADJ_1, 0,DAYADJ_1)),
/* Intervall larger than 30 days (approx 1 month) */
SECPERDAY*30,array(array(SECPERDAY*14,SECPERDAY*7,SECPERDAY*2, SECPERDAY),
array(SECPERDAY,SECPERDAY,SECPERDAY,SECPERDAY),
array(0,DAYADJ_WEEK, 0,DAYADJ_1, 0,DAYADJ_1, 0,DAYADJ_1)),
/* Intervall larger than 7 days */
SECPERDAY*7,array(array(SECPERDAY,SECPERHOUR*12,SECPERHOUR*6,SECPERHOUR*2),
array(SECPERHOUR*6,SECPERHOUR*3,SECPERHOUR,SECPERHOUR),
array(0,DAYADJ_1, 1,HOURADJ_12, 1,HOURADJ_6, 1,HOURADJ_1)),
/* Intervall larger than 1 day */
SECPERDAY,array(array(SECPERDAY,SECPERHOUR*12,SECPERHOUR*6,SECPERHOUR*2,SECPERHOUR),
array(SECPERHOUR*6,SECPERHOUR*2,SECPERHOUR,SECPERHOUR,SECPERHOUR),
array(1,HOURADJ_12, 1,HOURADJ_6, 1,HOURADJ_1, 1,HOURADJ_1)),
/* Intervall larger than 12 hours */
SECPERHOUR*12,array(array(SECPERHOUR*2,SECPERHOUR,SECPERMIN*30,900,600),
array(1800,1800,900,300,300),
array(1,HOURADJ_1, 1,MINADJ_30, 1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5) ),
/* Intervall larger than 2 hours */
SECPERHOUR*2,array(array(SECPERHOUR,SECPERMIN*30,900,600,300),
array(1800,900,300,120,60),
array(1,HOURADJ_1, 1,MINADJ_30, 1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5) ),
/* Intervall larger than 1 hours */
SECPERHOUR,array(array(SECPERMIN*30,900,600,300),array(900,300,120,60),
array(1,MINADJ_30, 1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5) ),
/* Intervall larger than 30 min */
SECPERMIN*30,array(array(SECPERMIN*15,SECPERMIN*10,SECPERMIN*5,SECPERMIN),
array(300,300,60,10),
array(1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5, 1,MINADJ_1)),
/* Intervall larger than 1 min */
SECPERMIN,array(array(SECPERMIN,15,10,5),
array(15,5,2,1),
array(1,MINADJ_1, 1,SECADJ_15, 1,SECADJ_10, 1,SECADJ_5)),
/* Intervall larger than 10 sec */
10,array(array(5,2),
array(1,1),
array(1,SECADJ_5, 1,SECADJ_1)),
/* Intervall larger than 1 sec */
1,array(array(1),
array(1),
array(1,SECADJ_1)),
);
$ns = count($scalePoints);
// Establish major and minor scale units for the date scale
$diff = $aEndTime - $aStartTime;
if( $diff < 1 ) return false;
$done=false;
$i=0;
while( ! $done ) {
if( $diff > $scalePoints[2*$i] ) {
// Get major and minor scale for this intervall
$scaleSteps = $scalePoints[2*$i+1];
$major = $scaleSteps[0][min($aDensity,count($scaleSteps[0])-1)];
// Try to find out which minor step looks best
$minor = $scaleSteps[1][min($aDensity,count($scaleSteps[1])-1)];
if( $aAdjust ) {
// Find out how we should align the start and end timestamps
$idx = 2*min($aDensity,floor(count($scaleSteps[2])/2)-1);
if( $scaleSteps[2][$idx] === 0 ) {
// Use date adjustment
$adj = $scaleSteps[2][$idx+1];
if( $adj >= 30 ) {
$start = $this->AdjStartDate($aStartTime,$adj-30);
$end = $this->AdjEndDate($aEndTime,$adj-30);
}
elseif( $adj >= 20 ) {
$start = $this->AdjStartDate($aStartTime,false,$adj-20);
$end = $this->AdjEndDate($aEndTime,false,$adj-20);
}
else {
$start = $this->AdjStartDate($aStartTime,false,false,$adj);
$end = $this->AdjEndDate($aEndTime,false,false,$adj);
// We add 1 second for date adjustment to make sure we end on 00:00 the following day
// This makes the final major tick be srawn when we step day-by-day instead of ending
// on xx:59:59 which would not draw the final major tick
$end++;
}
}
else {
// Use time adjustment
$adj = $scaleSteps[2][$idx+1];
if( $adj >= 30 ) {
$start = $this->AdjStartTime($aStartTime,$adj-30);
$end = $this->AdjEndTime($aEndTime,$adj-30);
}
elseif( $adj >= 20 ) {
$start = $this->AdjStartTime($aStartTime,false,$adj-20);
$end = $this->AdjEndTime($aEndTime,false,$adj-20);
}
else {
$start = $this->AdjStartTime($aStartTime,false,false,$adj);
$end = $this->AdjEndTime($aEndTime,false,false,$adj);
}
}
}
// If the overall date span is larger than 1 day ten we show date
$format = '';
if( ($end-$start) > SECPERDAY ) {
$format = 'Y-m-d ';
}
// If the major step is less than 1 day we need to whow hours + min
if( $major < SECPERDAY ) {
$format .= 'H:i';
}
// If the major step is less than 1 min we need to show sec
if( $major < 60 ) {
$format .= ':s';
}
$done=true;
}
++$i;
}
return array($start,$end,$major,$minor,$format);
}
// Overrides the automatic determined date format. Must be a valid date() format string
function SetDateFormat($aFormat) {
$this->date_format = $aFormat;
$this->ticks->SetLabelDateFormat($this->date_format);
}
function AdjustForDST($aFlg=true) {
$this->ticks->AdjustForDST($aFlg);
}
function SetDateAlign($aStartAlign,$aEndAlign=false) {
if( $aEndAlign === false ) {
$aEndAlign=$aStartAlign;
}
$this->iStartAlign = $aStartAlign;
$this->iEndAlign = $aEndAlign;
}
function SetTimeAlign($aStartAlign,$aEndAlign=false) {
if( $aEndAlign === false ) {
$aEndAlign=$aStartAlign;
}
$this->iStartTimeAlign = $aStartAlign;
$this->iEndTimeAlign = $aEndAlign;
}
function AutoScale($img,$aStartTime,$aEndTime,$aNumSteps,$_adummy=false) {
// We need to have one dummy argument to make the signature of AutoScale()
// identical to LinearScale::AutoScale
if( $aStartTime == $aEndTime ) {
// Special case when we only have one data point.
// Create a small artificial interval to do the autoscaling
$aStartTime -= 10;
$aEndTime += 10;
}
if( abs($aEndTime - $aStartTime) <= 1 ) {
// Special case when we only have one second.
// Create a small artificial interval to do the autoscaling
$aStartTime -= 1;
$aEndTime += 1;
}
$done=false;
$i=0;
while( ! $done && $i < 5) {
list($adjstart,$adjend,$maj,$min,$format) = $this->DoDateAutoScale($aStartTime,$aEndTime,$i);
$n = floor(($adjend-$adjstart)/$maj);
if( $n * 1.7 > $aNumSteps ) {
$done=true;
}
$i++;
}
/*
if( 0 ) { // DEBUG
echo " Start =".date("Y-m-d H:i:s",$aStartTime)."<br>";
echo " End =".date("Y-m-d H:i:s",$aEndTime)."<br>";
echo "Adj Start =".date("Y-m-d H:i:s",$adjstart)."<br>";
echo "Adj End =".date("Y-m-d H:i:s",$adjend)."<p>";
echo "Major = $maj s, ".floor($maj/60)."min, ".floor($maj/3600)."h, ".floor($maj/86400)."day<br>";
echo "Min = $min s, ".floor($min/60)."min, ".floor($min/3600)."h, ".floor($min/86400)."day<br>";
echo "Format=$format<p>";
}
*/
if( $this->iStartTimeAlign !== false && $this->iStartAlign !== false ) {
JpGraphError::RaiseL(3001);
//('It is only possible to use either SetDateAlign() or SetTimeAlign() but not both');
}
if( $this->iStartTimeAlign !== false ) {
if( $this->iStartTimeAlign >= 30 ) {
$adjstart = $this->AdjStartTime($aStartTime,$this->iStartTimeAlign-30);
}
elseif( $this->iStartTimeAlign >= 20 ) {
$adjstart = $this->AdjStartTime($aStartTime,false,$this->iStartTimeAlign-20);
}
else {
$adjstart = $this->AdjStartTime($aStartTime,false,false,$this->iStartTimeAlign);
}
}
if( $this->iEndTimeAlign !== false ) {
if( $this->iEndTimeAlign >= 30 ) {
$adjend = $this->AdjEndTime($aEndTime,$this->iEndTimeAlign-30);
}
elseif( $this->iEndTimeAlign >= 20 ) {
$adjend = $this->AdjEndTime($aEndTime,false,$this->iEndTimeAlign-20);
}
else {
$adjend = $this->AdjEndTime($aEndTime,false,false,$this->iEndTimeAlign);
}
}
if( $this->iStartAlign !== false ) {
if( $this->iStartAlign >= 30 ) {
$adjstart = $this->AdjStartDate($aStartTime,$this->iStartAlign-30);
}
elseif( $this->iStartAlign >= 20 ) {
$adjstart = $this->AdjStartDate($aStartTime,false,$this->iStartAlign-20);
}
else {
$adjstart = $this->AdjStartDate($aStartTime,false,false,$this->iStartAlign);
}
}
if( $this->iEndAlign !== false ) {
if( $this->iEndAlign >= 30 ) {
$adjend = $this->AdjEndDate($aEndTime,$this->iEndAlign-30);
}
elseif( $this->iEndAlign >= 20 ) {
$adjend = $this->AdjEndDate($aEndTime,false,$this->iEndAlign-20);
}
else {
$adjend = $this->AdjEndDate($aEndTime,false,false,$this->iEndAlign);
}
}
$this->Update($img,$adjstart,$adjend);
if( ! $this->ticks->IsSpecified() )
$this->ticks->Set($maj,$min);
if( $this->date_format == '' )
$this->ticks->SetLabelDateFormat($format);
else
$this->ticks->SetLabelDateFormat($this->date_format);
}
}
?>

@ -0,0 +1,369 @@
<?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(Throwable $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->SetFont(FF_FONT1);
$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);
}
?>

@ -1,157 +1,157 @@
<?php
/*=======================================================================
// File: JPGRAPH_ERROR.PHP
// Description: Error plot extension for JpGraph
// Created: 2001-01-08
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: jpgraph_error.php,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
//===================================================
// CLASS ErrorPlot
// Description: Error plot with min/max value for
// each datapoint
//===================================================
class ErrorPlot extends Plot {
var $errwidth=2;
//---------------
// CONSTRUCTOR
function ErrorPlot(&$datay,$datax=false) {
$this->Plot($datay,$datax);
$this->numpoints /= 2;
}
//---------------
// PUBLIC METHODS
// Gets called before any axis are stroked
function PreStrokeAdjust(&$graph) {
if( $this->center ) {
$a=0.5; $b=0.5;
++$this->numpoints;
} else {
$a=0; $b=0;
}
$graph->xaxis->scale->ticks->SetXLabelOffset($a);
$graph->SetTextScaleOff($b);
//$graph->xaxis->scale->ticks->SupressMinorTickMarks();
}
// Method description
function Stroke(&$img,&$xscale,&$yscale) {
$numpoints=count($this->coords[0])/2;
$img->SetColor($this->color);
$img->SetLineWeight($this->weight);
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;
for( $i=0; $i<$numpoints; ++$i) {
if( $exist_x )
$x=$this->coords[1][$i];
else
$x=$i;
if( !is_numeric($x) ||
!is_numeric($this->coords[0][$i*2]) || !is_numeric($this->coords[0][$i*2+1]) ) {
continue;
}
$xt = $xscale->Translate($x);
$yt1 = $yscale->Translate($this->coords[0][$i*2]);
$yt2 = $yscale->Translate($this->coords[0][$i*2+1]);
$img->Line($xt,$yt1,$xt,$yt2);
$img->Line($xt-$this->errwidth,$yt1,$xt+$this->errwidth,$yt1);
$img->Line($xt-$this->errwidth,$yt2,$xt+$this->errwidth,$yt2);
}
return true;
}
} // Class
//===================================================
// CLASS ErrorLinePlot
// Description: Combine a line and error plot
// THIS IS A DEPRECATED PLOT TYPE JUST KEPT FOR
// BACKWARD COMPATIBILITY
//===================================================
class ErrorLinePlot extends ErrorPlot {
var $line=null;
//---------------
// CONSTRUCTOR
function ErrorLinePlot(&$datay,$datax=false) {
$this->ErrorPlot($datay,$datax);
// Calculate line coordinates as the average of the error limits
$n = count($datay);
for($i=0; $i < $n; $i+=2 ) {
$ly[]=($datay[$i]+$datay[$i+1])/2;
}
$this->line=new LinePlot($ly,$datax);
}
//---------------
// PUBLIC METHODS
function Legend(&$graph) {
if( $this->legend != "" )
$graph->legend->Add($this->legend,$this->color);
$this->line->Legend($graph);
}
function Stroke(&$img,&$xscale,&$yscale) {
parent::Stroke($img,$xscale,$yscale);
$this->line->Stroke($img,$xscale,$yscale);
}
} // Class
//===================================================
// CLASS LineErrorPlot
// Description: Combine a line and error plot
//===================================================
class LineErrorPlot extends ErrorPlot {
var $line=null;
//---------------
// CONSTRUCTOR
// Data is (val, errdeltamin, errdeltamax)
function LineErrorPlot(&$datay,$datax=false) {
$ly=array(); $ey=array();
$n = count($datay);
if( $n % 3 != 0 ) {
JpGraphError::RaiseL(4002);
//('Error in input data to LineErrorPlot. Number of data points must be a multiple of 3');
}
for($i=0; $i < $n; $i+=3 ) {
$ly[]=$datay[$i];
$ey[]=$datay[$i]+$datay[$i+1];
$ey[]=$datay[$i]+$datay[$i+2];
}
$this->ErrorPlot($ey,$datax);
$this->line=new LinePlot($ly,$datax);
}
//---------------
// PUBLIC METHODS
function Legend(&$graph) {
if( $this->legend != "" )
$graph->legend->Add($this->legend,$this->color);
$this->line->Legend($graph);
}
function Stroke(&$img,&$xscale,&$yscale) {
parent::Stroke($img,$xscale,$yscale);
$this->line->Stroke($img,$xscale,$yscale);
}
} // Class
/* EOF */
?>
<?php
/*=======================================================================
// File: JPGRAPH_ERROR.PHP
// Description: Error plot extension for JpGraph
// Created: 2001-01-08
// Ver: $Id: jpgraph_error.php 1106 2009-02-22 20:16:35Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
*/
//===================================================
// CLASS ErrorPlot
// Description: Error plot with min/max value for
// each datapoint
//===================================================
class ErrorPlot extends Plot {
private $errwidth=2;
//---------------
// CONSTRUCTOR
function __construct($datay,$datax=false) {
parent::__construct($datay,$datax);
$this->numpoints /= 2;
}
//---------------
// PUBLIC METHODS
// Gets called before any axis are stroked
function PreStrokeAdjust($graph) {
if( $this->center ) {
$a=0.5; $b=0.5;
++$this->numpoints;
} else {
$a=0; $b=0;
}
$graph->xaxis->scale->ticks->SetXLabelOffset($a);
$graph->SetTextScaleOff($b);
//$graph->xaxis->scale->ticks->SupressMinorTickMarks();
}
// Method description
function Stroke($img,$xscale,$yscale) {
$numpoints=count($this->coords[0])/2;
$img->SetColor($this->color);
$img->SetLineWeight($this->weight);
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;
for( $i=0; $i<$numpoints; ++$i) {
if( $exist_x )
$x=$this->coords[1][$i];
else
$x=$i;
if( !is_numeric($x) ||
!is_numeric($this->coords[0][$i*2]) || !is_numeric($this->coords[0][$i*2+1]) ) {
continue;
}
$xt = $xscale->Translate($x);
$yt1 = $yscale->Translate($this->coords[0][$i*2]);
$yt2 = $yscale->Translate($this->coords[0][$i*2+1]);
$img->Line($xt,$yt1,$xt,$yt2);
$img->Line($xt-$this->errwidth,$yt1,$xt+$this->errwidth,$yt1);
$img->Line($xt-$this->errwidth,$yt2,$xt+$this->errwidth,$yt2);
}
return true;
}
} // Class
//===================================================
// CLASS ErrorLinePlot
// Description: Combine a line and error plot
// THIS IS A DEPRECATED PLOT TYPE JUST KEPT FOR
// BACKWARD COMPATIBILITY
//===================================================
class ErrorLinePlot extends ErrorPlot {
public $line=null;
//---------------
// CONSTRUCTOR
function __construct($datay,$datax=false) {
parent::__construct($datay,$datax);
// Calculate line coordinates as the average of the error limits
$n = count($datay);
for($i=0; $i < $n; $i+=2 ) {
$ly[]=($datay[$i]+$datay[$i+1])/2;
}
$this->line=new LinePlot($ly,$datax);
}
//---------------
// PUBLIC METHODS
function Legend($graph) {
if( $this->legend != "" )
$graph->legend->Add($this->legend,$this->color);
$this->line->Legend($graph);
}
function Stroke($img,$xscale,$yscale) {
parent::Stroke($img,$xscale,$yscale);
$this->line->Stroke($img,$xscale,$yscale);
}
} // Class
//===================================================
// CLASS LineErrorPlot
// Description: Combine a line and error plot
//===================================================
class LineErrorPlot extends ErrorPlot {
public $line=null;
//---------------
// CONSTRUCTOR
// Data is (val, errdeltamin, errdeltamax)
function __construct($datay,$datax=false) {
$ly=array(); $ey=array();
$n = count($datay);
if( $n % 3 != 0 ) {
JpGraphError::RaiseL(4002);
//('Error in input data to LineErrorPlot. Number of data points must be a multiple of 3');
}
for($i=0; $i < $n; $i+=3 ) {
$ly[]=$datay[$i];
$ey[]=$datay[$i]+$datay[$i+1];
$ey[]=$datay[$i]+$datay[$i+2];
}
parent::__construct($ey,$datax);
$this->line=new LinePlot($ly,$datax);
}
//---------------
// PUBLIC METHODS
function Legend($graph) {
if( $this->legend != "" )
$graph->legend->Add($this->legend,$this->color);
$this->line->Legend($graph);
}
function Stroke($img,$xscale,$yscale) {
parent::Stroke($img,$xscale,$yscale);
$this->line->Stroke($img,$xscale,$yscale);
}
} // Class
/* EOF */
?>

@ -1,374 +1,373 @@
<?php
//=======================================================================
// File: JPGRAPH_FLAGS.PHP
// Description: Class Jpfile. Handles plotmarks
// Created: 2003-06-28
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: jpgraph_flags.php,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
//------------------------------------------------------------
// Defines for the different basic sizes of flags
//------------------------------------------------------------
DEFINE('FLAGSIZE1',1);
DEFINE('FLAGSIZE2',2);
DEFINE('FLAGSIZE3',3);
DEFINE('FLAGSIZE4',4);
class FlagImages {
var $iCountryNameMap = array(
'Afghanistan' => 'afgh',
'Republic of Angola' => 'agla',
'Republic of Albania' => 'alba',
'Alderney' => 'alde',
'Democratic and Popular Republic of Algeria' => 'alge',
'Territory of American Samoa' => 'amsa',
'Principality of Andorra' => 'andr',
'British Overseas Territory of Anguilla' => 'angu',
'Antarctica' => 'anta',
'Argentine Republic' => 'arge',
'League of Arab States' => 'arle',
'Republic of Armenia' => 'arme',
'Aruba' => 'arub',
'Commonwealth of Australia' => 'astl',
'Republic of Austria' => 'aust',
'Azerbaijani Republic' => 'azer',
'British Antarctic Territory' => 'bant',
'Kingdom of Belgium' => 'belg',
'British Overseas Territory of Bermuda' => 'berm',
'Commonwealth of the Bahamas' => 'bhms',
'Kingdom of Bahrain' => 'bhrn',
'Republic of Belarus' => 'blru',
'Republic of Bolivia' => 'blva',
'Belize' => 'blze',
'Republic of Benin' => 'bnin',
'Republic of Botswana' => 'bots',
'Federative Republic of Brazil' => 'braz',
'Barbados' => 'brbd',
'British Indian Ocean Territory' => 'brin',
'Brunei Darussalam' => 'brun',
'Republic of Burkina' => 'bufa',
'Republic of Bulgaria' => 'bulg',
'Republic of Burundi' => 'buru',
'Overseas Territory of the British Virgin Islands' => 'bvis',
'Central African Republic' => 'cafr',
'Kingdom of Cambodia' => 'camb',
'Republic of Cameroon' => 'came',
'Dominion of Canada' => 'cana',
'Caribbean Community' => 'cari',
'Republic of Cape Verde' => 'cave',
'Republic of Chad' => 'chad',
'Republic of Chile' => 'chil',
'Peoples Republic of China' => 'chin',
'Territory of Christmas Island' => 'chms',
'Commonwealth of Independent States' => 'cins',
'Cook Islands' => 'ckis',
'Republic of Colombia' => 'clmb',
'Territory of Cocos Islands' => 'cois',
'Commonwealth' => 'comn',
'Union of the Comoros' => 'como',
'Republic of the Congo' => 'cong',
'Republic of Costa Rica' => 'corc',
'Republic of Croatia' => 'croa',
'Republic of Cuba' => 'cuba',
'British Overseas Territory of the Cayman Islands' => 'cyis',
'Republic of Cyprus' => 'cypr',
'The Czech Republic' => 'czec',
'Kingdom of Denmark' => 'denm',
'Republic of Djibouti' => 'djib',
'Commonwealth of Dominica' => 'domn',
'Dominican Republic' => 'dore',
'Republic of Ecuador' => 'ecua',
'Arab Republic of Egypt' => 'egyp',
'Republic of El Salvador' => 'elsa',
'England' => 'engl',
'Republic of Equatorial Guinea' => 'eqgu',
'State of Eritrea' => 'erit',
'Republic of Estonia' => 'estn',
'Ethiopia' => 'ethp',
'European Union' => 'euun',
'British Overseas Territory of the Falkland Islands' => 'fais',
'International Federation of Vexillological Associations' => 'fiav',
'Republic of Fiji' => 'fiji',
'Republic of Finland' => 'finl',
'Territory of French Polynesia' => 'fpol',
'French Republic' => 'fran',
'Overseas Department of French Guiana' => 'frgu',
'Gabonese Republic' => 'gabn',
'Republic of the Gambia' => 'gamb',
'Republic of Georgia' => 'geor',
'Federal Republic of Germany' => 'germ',
'Republic of Ghana' => 'ghan',
'Gibraltar' => 'gibr',
'Hellenic Republic' => 'grec',
'State of Grenada' => 'gren',
'Overseas Department of Guadeloupe' => 'guad',
'Territory of Guam' => 'guam',
'Republic of Guatemala' => 'guat',
'The Bailiwick of Guernsey' => 'guer',
'Republic of Guinea' => 'guin',
'Republic of Haiti' => 'hait',
'Hong Kong Special Administrative Region' => 'hokn',
'Republic of Honduras' => 'hond',
'Republic of Hungary' => 'hung',
'Republic of Iceland' => 'icel',
'International Committee of the Red Cross' => 'icrc',
'Republic of India' => 'inda',
'Republic of Indonesia' => 'indn',
'Republic of Iraq' => 'iraq',
'Republic of Ireland' => 'irel',
'Organization of the Islamic Conference' => 'isco',
'Isle of Man' => 'isma',
'State of Israel' => 'isra',
'Italian Republic' => 'ital',
'Jamaica' => 'jama',
'Japan' => 'japa',
'The Bailiwick of Jersey' => 'jers',
'Hashemite Kingdom of Jordan' => 'jord',
'Republic of Kazakhstan' => 'kazk',
'Republic of Kenya' => 'keny',
'Republic of Kiribati' => 'kirb',
'State of Kuwait' => 'kuwa',
'Kyrgyz Republic' => 'kyrg',
'Republic of Latvia' => 'latv',
'Lebanese Republic' => 'leba',
'Kingdom of Lesotho' => 'lest',
'Republic of Liberia' => 'libe',
'Principality of Liechtenstein' => 'liec',
'Republic of Lithuania' => 'lith',
'Grand Duchy of Luxembourg' => 'luxe',
'Macao Special Administrative Region' => 'maca',
'Republic of Macedonia' => 'mace',
'Republic of Madagascar' => 'mada',
'Republic of the Marshall Islands' => 'mais',
'Republic of Mali' => 'mali',
'Federation of Malaysia' => 'mals',
'Republic of Malta' => 'malt',
'Republic of Malawi' => 'malw',
'Overseas Department of Martinique' => 'mart',
'Islamic Republic of Mauritania' => 'maur',
'Territorial Collectivity of Mayotte' => 'mayt',
'United Mexican States' => 'mexc',
'Federated States of Micronesia' => 'micr',
'Midway Islands' => 'miis',
'Republic of Moldova' => 'mold',
'Principality of Monaco' => 'mona',
'Republic of Mongolia' => 'mong',
'British Overseas Territory of Montserrat' => 'mont',
'Kingdom of Morocco' => 'morc',
'Republic of Mozambique' => 'moza',
'Republic of Mauritius' => 'mrts',
'Union of Myanmar' => 'myan',
'Republic of Namibia' => 'namb',
'North Atlantic Treaty Organization' => 'nato',
'Republic of Nauru' => 'naur',
'Turkish Republic of Northern Cyprus' => 'ncyp',
'Netherlands Antilles' => 'nean',
'Kingdom of Nepal' => 'nepa',
'Kingdom of the Netherlands' => 'neth',
'Territory of Norfolk Island' => 'nfis',
'Federal Republic of Nigeria' => 'ngra',
'Republic of Nicaragua' => 'nica',
'Republic of Niger' => 'nigr',
'Niue' => 'niue',
'Commonwealth of the Northern Mariana Islands' => 'nmar',
'Province of Northern Ireland' => 'noir',
'Nordic Council' => 'nord',
'Kingdom of Norway' => 'norw',
'Territory of New Caledonia and Dependencies' => 'nwca',
'New Zealand' => 'nwze',
'Organization of American States' => 'oast',
'Organization of African Unity' => 'oaun',
'International Olympic Committee' => 'olym',
'Sultanate of Oman' => 'oman',
'Islamic Republic of Pakistan' => 'paks',
'Republic of Palau' => 'pala',
'Independent State of Papua New Guinea' => 'pang',
'Republic of Paraguay' => 'para',
'Republic of Peru' => 'peru',
'Republic of the Philippines' => 'phil',
'British Overseas Territory of the Pitcairn Islands' => 'piis',
'Republic of Poland' => 'pola',
'Republic of Portugal' => 'port',
'Commonwealth of Puerto Rico' => 'purc',
'State of Qatar' => 'qata',
'Russian Federation' => 'russ',
'Republic of Rwanda' => 'rwan',
'Kingdom of Saudi Arabia' => 'saar',
'Republic of San Marino' => 'sama',
'Nordic Sami Conference' => 'sami',
'Sark' => 'sark',
'Scotland' => 'scot',
'Principality of Seborga' => 'sebo',
'Republic of Sierra Leone' => 'sile',
'Republic of Singapore' => 'sing',
'Republic of Korea' => 'skor',
'Republic of Slovenia' => 'slva',
'Somali Republic' => 'smla',
'Republic of Somaliland' => 'smld',
'Republic of South Africa' => 'soaf',
'Solomon Islands' => 'sois',
'Kingdom of Spain' => 'span',
'Secretariat of the Pacific Community' => 'spco',
'Democratic Socialist Republic of Sri Lanka' => 'srla',
'Saint Lucia' => 'stlu',
'Republic of the Sudan' => 'suda',
'Republic of Suriname' => 'surn',
'Slovak Republic' => 'svka',
'Kingdom of Sweden' => 'swdn',
'Swiss Confederation' => 'swit',
'Syrian Arab Republic' => 'syra',
'Kingdom of Swaziland' => 'szld',
'Republic of China' => 'taiw',
'Taiwan' => 'taiw',
'Republic of Tajikistan' => 'tajk',
'United Republic of Tanzania' => 'tanz',
'Kingdom of Thailand' => 'thal',
'Autonomous Region of Tibet' => 'tibe',
'Turkmenistan' => 'tkst',
'Togolese Republic' => 'togo',
'Tokelau' => 'toke',
'Kingdom of Tonga' => 'tong',
'Tristan da Cunha' => 'trdc',
'Tromelin' => 'tris',
'Republic of Tunisia' => 'tuns',
'Republic of Turkey' => 'turk',
'Tuvalu' => 'tuva',
'United Arab Emirates' => 'uaem',
'Republic of Uganda' => 'ugan',
'Ukraine' => 'ukrn',
'United Kingdom of Great Britain' => 'unkg',
'United Nations' => 'unna',
'United States of America' => 'unst',
'Oriental Republic of Uruguay' => 'urgy',
'Virgin Islands of the United States' => 'usvs',
'Republic of Uzbekistan' => 'uzbk',
'State of the Vatican City' => 'vacy',
'Republic of Vanuatu' => 'vant',
'Bolivarian Republic of Venezuela' => 'venz',
'Republic of Yemen' => 'yemn',
'Democratic Republic of Congo' => 'zare',
'Republic of Zimbabwe' => 'zbwe' ) ;
var $iFlagCount = -1;
var $iFlagSetMap = array(
FLAGSIZE1 => 'flags_thumb35x35',
FLAGSIZE2 => 'flags_thumb60x60',
FLAGSIZE3 => 'flags_thumb100x100',
FLAGSIZE4 => 'flags'
);
var $iFlagData ;
var $iOrdIdx=array();
function FlagImages($aSize=FLAGSIZE1) {
switch($aSize) {
case FLAGSIZE1 :
case FLAGSIZE2 :
case FLAGSIZE3 :
case FLAGSIZE4 :
$file = dirname(__FILE__).'/'.$this->iFlagSetMap[$aSize].'.dat';
$fp = fopen($file,'rb');
$rawdata = fread($fp,filesize($file));
$this->iFlagData = unserialize($rawdata);
break;
default:
JpGraphError::RaiseL(5001,$aSize);
//('Unknown flag size. ('.$aSize.')');
}
$this->iFlagCount = count($this->iCountryNameMap);
}
function GetNum() {
return $this->iFlagCount;
}
function GetImgByName($aName,&$outFullName) {
$idx = $this->GetIdxByName($aName,$outFullName);
return $this->GetImgByIdx($idx);
}
function GetImgByIdx($aIdx) {
if( array_key_exists($aIdx,$this->iFlagData) ) {
$d = $this->iFlagData[$aIdx][1];
return Image::CreateFromString($d);
}
else {
JpGraphError::RaiseL(5002,$aIdx);
//("Flag index \" $aIdx\" does not exist.");
}
}
function GetIdxByOrdinal($aOrd,&$outFullName) {
$aOrd--;
$n = count($this->iOrdIdx);
if( $n == 0 ) {
reset($this->iCountryNameMap);
$this->iOrdIdx=array();
$i=0;
while( list($key,$val) = each($this->iCountryNameMap) ) {
$this->iOrdIdx[$i++] = array($val,$key);
}
$tmp=$this->iOrdIdx[$aOrd];
$outFullName = $tmp[1];
return $tmp[0];
}
elseif( $aOrd >= 0 && $aOrd < $n ) {
$tmp=$this->iOrdIdx[$aOrd];
$outFullName = $tmp[1];
return $tmp[0];
}
else {
JpGraphError::RaiseL(5003,$aOrd);
//('Invalid ordinal number specified for flag index.');
}
}
function GetIdxByName($aName,&$outFullName) {
if( is_integer($aName) ) {
$idx = $this->GetIdxByOrdinal($aName,$outFullName);
return $idx;
}
$found=false;
$aName = strtolower($aName);
$nlen = strlen($aName);
reset($this->iCountryNameMap);
// Start by trying to match exact index name
while( list($key,$val) = each($this->iCountryNameMap) ) {
if( $nlen == strlen($val) && $val == $aName ) {
$found=true;
break;
}
}
if( !$found ) {
reset($this->iCountryNameMap);
// If the exact index doesn't work try a (partial) full name
while( list($key,$val) = each($this->iCountryNameMap) ) {
if( strpos(strtolower($key), $aName) !== false ) {
$found=true;
break;
}
}
}
if( $found ) {
$outFullName = $key;
return $val;
}
else {
JpGraphError::RaiseL(5004,$aName);
//("The (partial) country name \"$aName\" does not have a cooresponding flag image. The flag may still exist but under another name, e.g. insted of \"usa\" try \"united states\".");
}
}
}
?>
<?php
//=======================================================================
// File: JPGRAPH_FLAGS.PHP
// Description: Class Jpfile. Handles plotmarks
// Created: 2003-06-28
// Ver: $Id: jpgraph_flags.php 1106 2009-02-22 20:16:35Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
//------------------------------------------------------------
// Defines for the different basic sizes of flags
//------------------------------------------------------------
DEFINE('FLAGSIZE1',1);
DEFINE('FLAGSIZE2',2);
DEFINE('FLAGSIZE3',3);
DEFINE('FLAGSIZE4',4);
class FlagImages {
public $iCountryNameMap = array(
'Afghanistan' => 'afgh',
'Republic of Angola' => 'agla',
'Republic of Albania' => 'alba',
'Alderney' => 'alde',
'Democratic and Popular Republic of Algeria' => 'alge',
'Territory of American Samoa' => 'amsa',
'Principality of Andorra' => 'andr',
'British Overseas Territory of Anguilla' => 'angu',
'Antarctica' => 'anta',
'Argentine Republic' => 'arge',
'League of Arab States' => 'arle',
'Republic of Armenia' => 'arme',
'Aruba' => 'arub',
'Commonwealth of Australia' => 'astl',
'Republic of Austria' => 'aust',
'Azerbaijani Republic' => 'azer',
'Bangladesh' => 'bngl',
'British Antarctic Territory' => 'bant',
'Kingdom of Belgium' => 'belg',
'British Overseas Territory of Bermuda' => 'berm',
'Commonwealth of the Bahamas' => 'bhms',
'Kingdom of Bahrain' => 'bhrn',
'Republic of Belarus' => 'blru',
'Republic of Bolivia' => 'blva',
'Belize' => 'blze',
'Republic of Benin' => 'bnin',
'Republic of Botswana' => 'bots',
'Federative Republic of Brazil' => 'braz',
'Barbados' => 'brbd',
'British Indian Ocean Territory' => 'brin',
'Brunei Darussalam' => 'brun',
'Republic of Burkina' => 'bufa',
'Republic of Bulgaria' => 'bulg',
'Republic of Burundi' => 'buru',
'Overseas Territory of the British Virgin Islands' => 'bvis',
'Central African Republic' => 'cafr',
'Kingdom of Cambodia' => 'camb',
'Republic of Cameroon' => 'came',
'Dominion of Canada' => 'cana',
'Caribbean Community' => 'cari',
'Republic of Cape Verde' => 'cave',
'Republic of Chad' => 'chad',
'Republic of Chile' => 'chil',
'Peoples Republic of China' => 'chin',
'Territory of Christmas Island' => 'chms',
'Commonwealth of Independent States' => 'cins',
'Cook Islands' => 'ckis',
'Republic of Colombia' => 'clmb',
'Territory of Cocos Islands' => 'cois',
'Commonwealth' => 'comn',
'Union of the Comoros' => 'como',
'Republic of the Congo' => 'cong',
'Republic of Costa Rica' => 'corc',
'Republic of Croatia' => 'croa',
'Republic of Cuba' => 'cuba',
'British Overseas Territory of the Cayman Islands' => 'cyis',
'Republic of Cyprus' => 'cypr',
'The Czech Republic' => 'czec',
'Kingdom of Denmark' => 'denm',
'Republic of Djibouti' => 'djib',
'Commonwealth of Dominica' => 'domn',
'Dominican Republic' => 'dore',
'Republic of Ecuador' => 'ecua',
'Arab Republic of Egypt' => 'egyp',
'Republic of El Salvador' => 'elsa',
'England' => 'engl',
'Republic of Equatorial Guinea' => 'eqgu',
'State of Eritrea' => 'erit',
'Republic of Estonia' => 'estn',
'Ethiopia' => 'ethp',
'European Union' => 'euun',
'British Overseas Territory of the Falkland Islands' => 'fais',
'International Federation of Vexillological Associations' => 'fiav',
'Republic of Fiji' => 'fiji',
'Republic of Finland' => 'finl',
'Territory of French Polynesia' => 'fpol',
'French Republic' => 'fran',
'Overseas Department of French Guiana' => 'frgu',
'Gabonese Republic' => 'gabn',
'Republic of the Gambia' => 'gamb',
'Republic of Georgia' => 'geor',
'Federal Republic of Germany' => 'germ',
'Republic of Ghana' => 'ghan',
'Gibraltar' => 'gibr',
'Hellenic Republic' => 'grec',
'State of Grenada' => 'gren',
'Overseas Department of Guadeloupe' => 'guad',
'Territory of Guam' => 'guam',
'Republic of Guatemala' => 'guat',
'The Bailiwick of Guernsey' => 'guer',
'Republic of Guinea' => 'guin',
'Republic of Haiti' => 'hait',
'Hong Kong Special Administrative Region' => 'hokn',
'Republic of Honduras' => 'hond',
'Republic of Hungary' => 'hung',
'Republic of Iceland' => 'icel',
'International Committee of the Red Cross' => 'icrc',
'Republic of India' => 'inda',
'Republic of Indonesia' => 'indn',
'Republic of Iraq' => 'iraq',
'Republic of Ireland' => 'irel',
'Organization of the Islamic Conference' => 'isco',
'Isle of Man' => 'isma',
'State of Israel' => 'isra',
'Italian Republic' => 'ital',
'Jamaica' => 'jama',
'Japan' => 'japa',
'The Bailiwick of Jersey' => 'jers',
'Hashemite Kingdom of Jordan' => 'jord',
'Republic of Kazakhstan' => 'kazk',
'Republic of Kenya' => 'keny',
'Republic of Kiribati' => 'kirb',
'State of Kuwait' => 'kuwa',
'Kyrgyz Republic' => 'kyrg',
'Republic of Latvia' => 'latv',
'Lebanese Republic' => 'leba',
'Kingdom of Lesotho' => 'lest',
'Republic of Liberia' => 'libe',
'Principality of Liechtenstein' => 'liec',
'Republic of Lithuania' => 'lith',
'Grand Duchy of Luxembourg' => 'luxe',
'Macao Special Administrative Region' => 'maca',
'Republic of Macedonia' => 'mace',
'Republic of Madagascar' => 'mada',
'Republic of the Marshall Islands' => 'mais',
'Republic of Mali' => 'mali',
'Federation of Malaysia' => 'mals',
'Republic of Malta' => 'malt',
'Republic of Malawi' => 'malw',
'Overseas Department of Martinique' => 'mart',
'Islamic Republic of Mauritania' => 'maur',
'Territorial Collectivity of Mayotte' => 'mayt',
'United Mexican States' => 'mexc',
'Federated States of Micronesia' => 'micr',
'Midway Islands' => 'miis',
'Republic of Moldova' => 'mold',
'Principality of Monaco' => 'mona',
'Republic of Mongolia' => 'mong',
'British Overseas Territory of Montserrat' => 'mont',
'Kingdom of Morocco' => 'morc',
'Republic of Mozambique' => 'moza',
'Republic of Mauritius' => 'mrts',
'Union of Myanmar' => 'myan',
'Republic of Namibia' => 'namb',
'North Atlantic Treaty Organization' => 'nato',
'Republic of Nauru' => 'naur',
'Turkish Republic of Northern Cyprus' => 'ncyp',
'Netherlands Antilles' => 'nean',
'Kingdom of Nepal' => 'nepa',
'Kingdom of the Netherlands' => 'neth',
'Territory of Norfolk Island' => 'nfis',
'Federal Republic of Nigeria' => 'ngra',
'Republic of Nicaragua' => 'nica',
'Republic of Niger' => 'nigr',
'Niue' => 'niue',
'Commonwealth of the Northern Mariana Islands' => 'nmar',
'Province of Northern Ireland' => 'noir',
'Nordic Council' => 'nord',
'Kingdom of Norway' => 'norw',
'Territory of New Caledonia and Dependencies' => 'nwca',
'New Zealand' => 'nwze',
'Organization of American States' => 'oast',
'Organization of African Unity' => 'oaun',
'International Olympic Committee' => 'olym',
'Sultanate of Oman' => 'oman',
'Islamic Republic of Pakistan' => 'paks',
'Republic of Palau' => 'pala',
'Independent State of Papua New Guinea' => 'pang',
'Republic of Paraguay' => 'para',
'Republic of Peru' => 'peru',
'Republic of the Philippines' => 'phil',
'British Overseas Territory of the Pitcairn Islands' => 'piis',
'Republic of Poland' => 'pola',
'Republic of Portugal' => 'port',
'Commonwealth of Puerto Rico' => 'purc',
'State of Qatar' => 'qata',
'Russian Federation' => 'russ',
'Romania' => 'rmna',
'Republic of Rwanda' => 'rwan',
'Kingdom of Saudi Arabia' => 'saar',
'Republic of San Marino' => 'sama',
'Nordic Sami Conference' => 'sami',
'Sark' => 'sark',
'Scotland' => 'scot',
'Principality of Seborga' => 'sebo',
'Republic of Serbia' => 'serb',
'Republic of Sierra Leone' => 'sile',
'Republic of Singapore' => 'sing',
'Republic of Korea' => 'skor',
'Republic of Slovenia' => 'slva',
'Somali Republic' => 'smla',
'Republic of Somaliland' => 'smld',
'Republic of South Africa' => 'soaf',
'Solomon Islands' => 'sois',
'Kingdom of Spain' => 'span',
'Secretariat of the Pacific Community' => 'spco',
'Democratic Socialist Republic of Sri Lanka' => 'srla',
'Saint Lucia' => 'stlu',
'Republic of the Sudan' => 'suda',
'Republic of Suriname' => 'surn',
'Slovak Republic' => 'svka',
'Kingdom of Sweden' => 'swdn',
'Swiss Confederation' => 'swit',
'Syrian Arab Republic' => 'syra',
'Kingdom of Swaziland' => 'szld',
'Republic of China' => 'taiw',
'Taiwan' => 'taiw',
'Republic of Tajikistan' => 'tajk',
'United Republic of Tanzania' => 'tanz',
'Kingdom of Thailand' => 'thal',
'Autonomous Region of Tibet' => 'tibe',
'Turkmenistan' => 'tkst',
'Togolese Republic' => 'togo',
'Tokelau' => 'toke',
'Kingdom of Tonga' => 'tong',
'Tristan da Cunha' => 'trdc',
'Tromelin' => 'tris',
'Republic of Tunisia' => 'tuns',
'Republic of Turkey' => 'turk',
'Tuvalu' => 'tuva',
'United Arab Emirates' => 'uaem',
'Republic of Uganda' => 'ugan',
'Ukraine' => 'ukrn',
'United Kingdom of Great Britain' => 'unkg',
'United Nations' => 'unna',
'United States of America' => 'unst',
'Oriental Republic of Uruguay' => 'urgy',
'Virgin Islands of the United States' => 'usvs',
'Republic of Uzbekistan' => 'uzbk',
'State of the Vatican City' => 'vacy',
'Republic of Vanuatu' => 'vant',
'Bolivarian Republic of Venezuela' => 'venz',
'Republic of Yemen' => 'yemn',
'Democratic Republic of Congo' => 'zare',
'Republic of Zimbabwe' => 'zbwe' ) ;
private $iFlagCount = -1;
private $iFlagSetMap = array(
FLAGSIZE1 => 'flags_thumb35x35',
FLAGSIZE2 => 'flags_thumb60x60',
FLAGSIZE3 => 'flags_thumb100x100',
FLAGSIZE4 => 'flags'
);
private $iFlagData ;
private $iOrdIdx=array();
function __construct($aSize=FLAGSIZE1) {
switch($aSize) {
case FLAGSIZE1 :
case FLAGSIZE2 :
case FLAGSIZE3 :
case FLAGSIZE4 :
$file = dirname(__FILE__).'/'.$this->iFlagSetMap[$aSize].'.dat';
$fp = fopen($file,'rb');
$rawdata = fread($fp,filesize($file));
$this->iFlagData = unserialize($rawdata);
break;
default:
JpGraphError::RaiseL(5001,$aSize);
//('Unknown flag size. ('.$aSize.')');
}
$this->iFlagCount = count($this->iCountryNameMap);
}
function GetNum() {
return $this->iFlagCount;
}
function GetImgByName($aName,&$outFullName) {
$idx = $this->GetIdxByName($aName,$outFullName);
return $this->GetImgByIdx($idx);
}
function GetImgByIdx($aIdx) {
if( array_key_exists($aIdx,$this->iFlagData) ) {
$d = $this->iFlagData[$aIdx][1];
return Image::CreateFromString($d);
}
else {
JpGraphError::RaiseL(5002,$aIdx);
//("Flag index \"<22>$aIdx\" does not exist.");
}
}
function GetIdxByOrdinal($aOrd,&$outFullName) {
$aOrd--;
$n = count($this->iOrdIdx);
if( $n == 0 ) {
$this->iOrdIdx=array();
$i=0;
foreach( $this->iCountryNameMap as $key => $val ) {
$this->iOrdIdx[$i++] = array($val,$key);
}
$tmp=$this->iOrdIdx[$aOrd];
$outFullName = $tmp[1];
return $tmp[0];
}
elseif( $aOrd >= 0 && $aOrd < $n ) {
$tmp=$this->iOrdIdx[$aOrd];
$outFullName = $tmp[1];
return $tmp[0];
}
else {
JpGraphError::RaiseL(5003,$aOrd);
//('Invalid ordinal number specified for flag index.');
}
}
function GetIdxByName($aName,&$outFullName) {
if( is_integer($aName) ) {
$idx = $this->GetIdxByOrdinal($aName,$outFullName);
return $idx;
}
$found=false;
$aName = strtolower($aName);
$nlen = strlen($aName);
// Start by trying to match exact index name
foreach( $this->iCountryNameMap as $key => $val ) {
if( $nlen == strlen($val) && $val == $aName ) {
$found=true;
break;
}
}
if( !$found ) {
// If the exact index doesn't work try a (partial) full name
foreach( $this->iCountryNameMap as $key => $val ) {
if( strpos(strtolower($key), $aName) !== false ) {
$found=true;
break;
}
}
}
if( $found ) {
$outFullName = $key;
return $val;
}
else {
JpGraphError::RaiseL(5004,$aName);
//("The (partial) country name \"$aName\" does not have a cooresponding flag image. The flag may still exist but under another name, e.g. insted of \"usa\" try \"united states\".");
}
}
}
?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,377 +1,434 @@
<?php
/*=======================================================================
// File: JPGRAPH_GRADIENT.PHP
// Description: Create a color gradient
// Created: 2003-02-01
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: jpgraph_gradient.php,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// 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);
//===================================================
// CLASS Gradient
// Description: Handles gradient fills. This is to be
// considered a "friend" class of Class Image.
//===================================================
class Gradient {
var $img=null;
var $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) {
switch( $style ) {
case GRAD_VER:
$steps = round(abs($xr-$xl));
$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 = round(abs($yb-$yt));
$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 = round(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 = round(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 = round(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 = round(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 = round(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,round(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 = round(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,round(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;
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
?>
<?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) Asial Corporation. 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 = floatval($from_color[3]);
$to_alpha = floatval($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
?>

@ -1,190 +1,190 @@
<?php
//=======================================================================
// File: JPGRAPH_ICONPLOT.PHP
// Description: PHP4 Graph Plotting library. Extension module.
// Created: 2004-02-18
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: jpgraph_iconplot.php,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
//===================================================
// CLASS IconPlot
// Description: Make it possible to add a (small) image
// to the graph
//===================================================
class IconPlot {
var $iHorAnchor='left',$iVertAnchor='top';
var $iX=0,$iY=0;
var $iFile='';
var $iScale=1.0,$iMix=100;
var $iAnchors = array('left','right','top','bottom','center');
var $iCountryFlag='',$iCountryStdSize=3;
var $iScalePosY=null,$iScalePosX=null;
var $iImgString='';
function IconPlot($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 CreateFromString($aStr) {
$this->iImgString = $aStr;
}
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 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,$ayscale) {
$this->StrokeWithScale($aImg,$axscale,$ayscale);
}
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 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') ) {
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);
}
}
?>
<?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) Asial Corporation. 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);
}
}
?>

@ -1,224 +1,223 @@
<?php
//=======================================================================
// File: JPGRAPH_IMGTRANS.PHP
// Description: Extension for JpGraph to do some simple img transformations
// Created: 2003-09-06
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: jpgraph_imgtrans.php,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
//------------------------------------------------------------------------
// Class ImgTrans
// Perform some simple image transformations.
//------------------------------------------------------------------------
class ImgTrans {
var $gdImg=null;
function ImgTrans($aGdImg) {
// Constructor
$this->gdImg = $aGdImg;
}
// --------------------------------------------------------------------
// _TransVert3D() and _TransHor3D() are helper methods to
// Skew3D().
// --------------------------------------------------------------------
function _TransVert3D($aGdImg,$aHorizon=100,$aSkewDist=120,$aDir=SKEW3D_DOWN,$aMinSize=true,$aFillColor='#FFFFFF',$aQuality=false,$aBorder=false,$aHorizonPos=0.5) {
// Parameter check
if( $aHorizonPos < 0 || $aHorizonPos > 1.0 ) {
JpGraphError::RaiseL(9001);
//("Value for image transformation out of bounds.\nVanishing point on horizon must be specified as a value between 0 and 1.");
}
$w = imagesx($aGdImg);
$h = imagesy($aGdImg);
// Create new image
$ww = $w;
if( $aMinSize )
$hh = ceil($h * $aHorizon / ($aSkewDist+$h));
else
$hh = $h;
$newgdh = imagecreatetruecolor($ww,$hh);
$crgb = new RGB( $newgdh );
$fillColor = $crgb->Allocate($aFillColor);
imagefilledrectangle($newgdh,0,0,$ww-1,$hh-1,$fillColor);
if( $aBorder ) {
$colidx = $crgb->Allocate($aBorder);
imagerectangle($newgdh,0,0,$ww-1,$hh-1,$colidx);
}
$mid = round($w * $aHorizonPos);
$last=$h;
for($y=0; $y < $h; ++$y) {
$yp = $h-$y-1;
$yt = floor($yp * $aHorizon / ($aSkewDist + $yp));
if( !$aQuality ) {
if( $last <= $yt ) continue ;
$last = $yt;
}
for($x=0; $x < $w; ++$x) {
$xt = ($x-$mid) * $aSkewDist / ($aSkewDist + $yp);
if( $aDir == SKEW3D_UP )
$rgb = imagecolorat($aGdImg,$x,$h-$y-1);
else
$rgb = imagecolorat($aGdImg,$x,$y);
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> 8) & 0xFF;
$b = $rgb & 0xFF;
$colidx = imagecolorallocate($newgdh,$r,$g,$b);
$xt = round($xt+$mid);
if( $aDir == SKEW3D_UP ) {
$syt = $yt;
}
else {
$syt = $hh-$yt-1;
}
if( !empty($set[$yt]) ) {
$nrgb = imagecolorat($newgdh,$xt,$syt);
$nr = ($nrgb >> 16) & 0xFF;
$ng = ($nrgb >> 8) & 0xFF;
$nb = $nrgb & 0xFF;
$colidx = imagecolorallocate($newgdh,floor(($r+$nr)/2),
floor(($g+$ng)/2),floor(($b+$nb)/2));
}
imagesetpixel($newgdh,$xt,$syt,$colidx);
}
$set[$yt] = true;
}
return $newgdh;
}
// --------------------------------------------------------------------
// _TransVert3D() and _TransHor3D() are helper methods to
// Skew3D().
// --------------------------------------------------------------------
function _TransHor3D($aGdImg,$aHorizon=100,$aSkewDist=120,$aDir=SKEW3D_LEFT,$aMinSize=true,$aFillColor='#FFFFFF',$aQuality=false,$aBorder=false,$aHorizonPos=0.5) {
$w = imagesx($aGdImg);
$h = imagesy($aGdImg);
// Create new image
$hh = $h;
if( $aMinSize )
$ww = ceil($w * $aHorizon / ($aSkewDist+$w));
else
$ww = $w;
$newgdh = imagecreatetruecolor($ww,$hh);
$crgb = new RGB( $newgdh );
$fillColor = $crgb->Allocate($aFillColor);
imagefilledrectangle($newgdh,0,0,$ww-1,$hh-1,$fillColor);
if( $aBorder ) {
$colidx = $crgb->Allocate($aBorder);
imagerectangle($newgdh,0,0,$ww-1,$hh-1,$colidx);
}
$mid = round($h * $aHorizonPos);
$last = -1;
for($x=0; $x < $w-1; ++$x) {
$xt = floor($x * $aHorizon / ($aSkewDist + $x));
if( !$aQuality ) {
if( $last >= $xt ) continue ;
$last = $xt;
}
for($y=0; $y < $h; ++$y) {
$yp = $h-$y-1;
$yt = ($yp-$mid) * $aSkewDist / ($aSkewDist + $x);
if( $aDir == SKEW3D_RIGHT )
$rgb = imagecolorat($aGdImg,$w-$x-1,$y);
else
$rgb = imagecolorat($aGdImg,$x,$y);
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> 8) & 0xFF;
$b = $rgb & 0xFF;
$colidx = imagecolorallocate($newgdh,$r,$g,$b);
$yt = floor($hh-$yt-$mid-1);
if( $aDir == SKEW3D_RIGHT ) {
$sxt = $ww-$xt-1;
}
else
$sxt = $xt ;
if( !empty($set[$xt]) ) {
$nrgb = imagecolorat($newgdh,$sxt,$yt);
$nr = ($nrgb >> 16) & 0xFF;
$ng = ($nrgb >> 8) & 0xFF;
$nb = $nrgb & 0xFF;
$colidx = imagecolorallocate($newgdh,floor(($r+$nr)/2),
floor(($g+$ng)/2),floor(($b+$nb)/2));
}
imagesetpixel($newgdh,$sxt,$yt,$colidx);
}
$set[$xt] = true;
}
return $newgdh;
}
// --------------------------------------------------------------------
// Skew image for the apperance of a 3D effect
// This transforms an image into a 3D-skewed version
// of the image. The transformation is specified by giving the height
// of the artificial horizon and specifying a "skew" factor which
// is the distance on the horizon line between the point of
// convergence and perspective line.
//
// The function returns the GD handle of the transformed image
// leaving the original image untouched.
//
// Parameters:
// * $aGdImg, GD handle to the image to be transformed
// * $aHorizon, Distance to the horizon
// * $aSkewDist, Distance from the horizon point of convergence
// on the horizon line to the perspective points. A larger
// value will fore-shorten the image more
// * $aDir, parameter specifies type of convergence. This of this
// as the walls in a room you are looking at. This specifies if the
// image should be applied on the left,right,top or bottom walls.
// * $aMinSize, true=make the new image just as big as needed,
// false = keep the image the same size as the original image
// * $aFillColor, Background fill color in the image
// * $aHiQuality, true=performa some interpolation that improves
// the image quality but at the expense of performace. Enabling
// high quality will have a dramatic effect on the time it takes
// to transform an image.
// * $aBorder, if set to anything besides false this will draw a
// a border of the speciied color around the image
// --------------------------------------------------------------------
function Skew3D($aHorizon=120,$aSkewDist=150,$aDir=SKEW3D_DOWN,$aHiQuality=false,$aMinSize=true,$aFillColor='#FFFFFF',$aBorder=false) {
return $this->_Skew3D($this->gdImg,$aHorizon,$aSkewDist,$aDir,$aHiQuality,
$aMinSize,$aFillColor,$aBorder);
}
function _Skew3D($aGdImg,$aHorizon=120,$aSkewDist=150,$aDir=SKEW3D_DOWN,$aHiQuality=false,$aMinSize=true,$aFillColor='#FFFFFF',$aBorder=false) {
if( $aDir == SKEW3D_DOWN || $aDir == SKEW3D_UP )
return $this->_TransVert3D($aGdImg,$aHorizon,$aSkewDist,$aDir,$aMinSize,$aFillColor,$aHiQuality,$aBorder);
else
return $this->_TransHor3D($aGdImg,$aHorizon,$aSkewDist,$aDir,$aMinSize,$aFillColor,$aHiQuality,$aBorder);
}
}
?>
<?php
//=======================================================================
// File: JPGRAPH_IMGTRANS.PHP
// Description: Extension for JpGraph to do some simple img transformations
// Created: 2003-09-06
// Ver: $Id: jpgraph_imgtrans.php 1106 2009-02-22 20:16:35Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
//------------------------------------------------------------------------
// Class ImgTrans
// Perform some simple image transformations.
//------------------------------------------------------------------------
class ImgTrans {
private $gdImg=null;
function __construct($aGdImg) {
// Constructor
$this->gdImg = $aGdImg;
}
// --------------------------------------------------------------------
// _TransVert3D() and _TransHor3D() are helper methods to
// Skew3D().
// --------------------------------------------------------------------
function _TransVert3D($aGdImg,$aHorizon=100,$aSkewDist=120,$aDir=SKEW3D_DOWN,$aMinSize=true,$aFillColor='#FFFFFF',$aQuality=false,$aBorder=false,$aHorizonPos=0.5) {
// Parameter check
if( $aHorizonPos < 0 || $aHorizonPos > 1.0 ) {
JpGraphError::RaiseL(9001);
//("Value for image transformation out of bounds.\nVanishing point on horizon must be specified as a value between 0 and 1.");
}
$w = imagesx($aGdImg);
$h = imagesy($aGdImg);
// Create new image
$ww = $w;
if( $aMinSize )
$hh = ceil($h * $aHorizon / ($aSkewDist+$h));
else
$hh = $h;
$newgdh = imagecreatetruecolor($ww,$hh);
$crgb = new RGB( $newgdh );
$fillColor = $crgb->Allocate($aFillColor);
imagefilledrectangle($newgdh,0,0,$ww-1,$hh-1,$fillColor);
if( $aBorder ) {
$colidx = $crgb->Allocate($aBorder);
imagerectangle($newgdh,0,0,$ww-1,$hh-1,$colidx);
}
$mid = round($w * $aHorizonPos);
$last=$h;
for($y=0; $y < $h; ++$y) {
$yp = $h-$y-1;
$yt = floor($yp * $aHorizon / ($aSkewDist + $yp));
if( !$aQuality ) {
if( $last <= $yt ) continue ;
$last = $yt;
}
for($x=0; $x < $w; ++$x) {
$xt = ($x-$mid) * $aSkewDist / ($aSkewDist + $yp);
if( $aDir == SKEW3D_UP )
$rgb = imagecolorat($aGdImg,$x,$h-$y-1);
else
$rgb = imagecolorat($aGdImg,$x,$y);
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> 8) & 0xFF;
$b = $rgb & 0xFF;
$colidx = imagecolorallocate($newgdh,$r,$g,$b);
$xt = round($xt+$mid);
if( $aDir == SKEW3D_UP ) {
$syt = $yt;
}
else {
$syt = $hh-$yt-1;
}
if( !empty($set[$yt]) ) {
$nrgb = imagecolorat($newgdh,$xt,$syt);
$nr = ($nrgb >> 16) & 0xFF;
$ng = ($nrgb >> 8) & 0xFF;
$nb = $nrgb & 0xFF;
$colidx = imagecolorallocate($newgdh,floor(($r+$nr)/2),
floor(($g+$ng)/2),floor(($b+$nb)/2));
}
imagesetpixel($newgdh,$xt,$syt,$colidx);
}
$set[$yt] = true;
}
return $newgdh;
}
// --------------------------------------------------------------------
// _TransVert3D() and _TransHor3D() are helper methods to
// Skew3D().
// --------------------------------------------------------------------
function _TransHor3D($aGdImg,$aHorizon=100,$aSkewDist=120,$aDir=SKEW3D_LEFT,$aMinSize=true,$aFillColor='#FFFFFF',$aQuality=false,$aBorder=false,$aHorizonPos=0.5) {
$w = imagesx($aGdImg);
$h = imagesy($aGdImg);
// Create new image
$hh = $h;
if( $aMinSize )
$ww = ceil($w * $aHorizon / ($aSkewDist+$w));
else
$ww = $w;
$newgdh = imagecreatetruecolor($ww,$hh);
$crgb = new RGB( $newgdh );
$fillColor = $crgb->Allocate($aFillColor);
imagefilledrectangle($newgdh,0,0,$ww-1,$hh-1,$fillColor);
if( $aBorder ) {
$colidx = $crgb->Allocate($aBorder);
imagerectangle($newgdh,0,0,$ww-1,$hh-1,$colidx);
}
$mid = round($h * $aHorizonPos);
$last = -1;
for($x=0; $x < $w-1; ++$x) {
$xt = floor($x * $aHorizon / ($aSkewDist + $x));
if( !$aQuality ) {
if( $last >= $xt ) continue ;
$last = $xt;
}
for($y=0; $y < $h; ++$y) {
$yp = $h-$y-1;
$yt = ($yp-$mid) * $aSkewDist / ($aSkewDist + $x);
if( $aDir == SKEW3D_RIGHT )
$rgb = imagecolorat($aGdImg,$w-$x-1,$y);
else
$rgb = imagecolorat($aGdImg,$x,$y);
$r = ($rgb >> 16) & 0xFF;
$g = ($rgb >> 8) & 0xFF;
$b = $rgb & 0xFF;
$colidx = imagecolorallocate($newgdh,$r,$g,$b);
$yt = floor($hh-$yt-$mid-1);
if( $aDir == SKEW3D_RIGHT ) {
$sxt = $ww-$xt-1;
}
else
$sxt = $xt ;
if( !empty($set[$xt]) ) {
$nrgb = imagecolorat($newgdh,$sxt,$yt);
$nr = ($nrgb >> 16) & 0xFF;
$ng = ($nrgb >> 8) & 0xFF;
$nb = $nrgb & 0xFF;
$colidx = imagecolorallocate($newgdh,floor(($r+$nr)/2),
floor(($g+$ng)/2),floor(($b+$nb)/2));
}
imagesetpixel($newgdh,$sxt,$yt,$colidx);
}
$set[$xt] = true;
}
return $newgdh;
}
// --------------------------------------------------------------------
// Skew image for the apperance of a 3D effect
// This transforms an image into a 3D-skewed version
// of the image. The transformation is specified by giving the height
// of the artificial horizon and specifying a "skew" factor which
// is the distance on the horizon line between the point of
// convergence and perspective line.
//
// The function returns the GD handle of the transformed image
// leaving the original image untouched.
//
// Parameters:
// * $aGdImg, GD handle to the image to be transformed
// * $aHorizon, Distance to the horizon
// * $aSkewDist, Distance from the horizon point of convergence
// on the horizon line to the perspective points. A larger
// value will fore-shorten the image more
// * $aDir, parameter specifies type of convergence. This of this
// as the walls in a room you are looking at. This specifies if the
// image should be applied on the left,right,top or bottom walls.
// * $aMinSize, true=make the new image just as big as needed,
// false = keep the image the same size as the original image
// * $aFillColor, Background fill color in the image
// * $aHiQuality, true=performa some interpolation that improves
// the image quality but at the expense of performace. Enabling
// high quality will have a dramatic effect on the time it takes
// to transform an image.
// * $aBorder, if set to anything besides false this will draw a
// a border of the speciied color around the image
// --------------------------------------------------------------------
function Skew3D($aHorizon=120,$aSkewDist=150,$aDir=SKEW3D_DOWN,$aHiQuality=false,$aMinSize=true,$aFillColor='#FFFFFF',$aBorder=false) {
return $this->_Skew3D($this->gdImg,$aHorizon,$aSkewDist,$aDir,$aHiQuality,
$aMinSize,$aFillColor,$aBorder);
}
function _Skew3D($aGdImg,$aHorizon=120,$aSkewDist=150,$aDir=SKEW3D_DOWN,$aHiQuality=false,$aMinSize=true,$aFillColor='#FFFFFF',$aBorder=false) {
if( $aDir == SKEW3D_DOWN || $aDir == SKEW3D_UP )
return $this->_TransVert3D($aGdImg,$aHorizon,$aSkewDist,$aDir,$aMinSize,$aFillColor,$aHiQuality,$aBorder);
else
return $this->_TransHor3D($aGdImg,$aHorizon,$aSkewDist,$aDir,$aMinSize,$aFillColor,$aHiQuality,$aBorder);
}
}
?>

@ -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) Asial Corporation. 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();
}
}
}
?>

@ -0,0 +1,494 @@
<?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) Asial Corporation. 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_DEFAULT,$font_style=FS_NORMAL,$font_size=8; // old. 12
private $color=array(120,120,120); // Default frame color
private $fill_color=array(245,245,245); // Default fill color
private $shadow=false; // 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 HasItems() {
return (boolean)(count($this->txtcol));
}
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)+1;
}
$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 using image
if( $p[2]->GetType() == MARK_IMG ) {
$p[2]->Stroke($aImg,$x1,$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);
}
// Draw a plot frame line
$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
?>

File diff suppressed because it is too large Load Diff

@ -1,268 +1,305 @@
<?php
/*=======================================================================
// File: JPGRAPH_LOG.PHP
// Description: Log scale plot extension for JpGraph
// Created: 2001-01-08
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: jpgraph_log.php,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// 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,$dummy, $dummy2 = 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.');
}
$smin = floor(log10($min));
$smax = ceil(log10($max));
$this->Update($img,$smin,$smax);
}
//---------------
// PRIVATE METHODS
} // Class
//===================================================
// CLASS LogTicks
// Description:
//===================================================
class LogTicks extends Ticks{
var $label_logtype=LOGLABELS_MAGNITUDE;
//---------------
// CONSTRUCTOR
function __construct() {
parent::__construct();
}
//---------------
// 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 */
?>
<?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) Asial Corporation. 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 __construct() {
}
//---------------
// 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 */
?>

@ -0,0 +1,105 @@
<?php
/*=======================================================================
// File: JPGRAPH_MESHINTERPOLATE.INC.PHP
// Description: Utility class to do mesh linear interpolation of a matrix
// Created: 2009-03-09
// Ver: $Id: jpgraph_meshinterpolate.inc.php 1709 2009-07-30 08:00:08Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
*/
/**
* Utility function to do linear mesh interpolation
* @param $aDat Matrix to interpolate
* @param $aFactor Interpolation factor
*/
function doMeshInterpolate( &$aData, $aFactor ) {
$m = new MeshInterpolate();
$aData = $m->Linear($aData,$aFactor);
}
/**
* Utility class to interpolate a given data matrix
*
*/
class MeshInterpolate {
private $data = array();
/**
* Calculate the mid points of the given rectangle which has its top left
* corner at $row,$col. The $aFactordecides how many spliots should be done.
* i.e. how many more divisions should be done recursively
*
* @param $row Top left corner of square to work with
* @param $col Top left corner of square to work with
* $param $aFactor In how many subsquare should we split this square. A value of 1 indicates that no action
*/
function IntSquare( $aRow, $aCol, $aFactor ) {
if ( $aFactor <= 1 )
return;
$step = pow( 2, $aFactor-1 );
$v0 = $this->data[$aRow][$aCol];
$v1 = $this->data[$aRow][$aCol + $step];
$v2 = $this->data[$aRow + $step][$aCol];
$v3 = $this->data[$aRow + $step][$aCol + $step];
$this->data[$aRow][$aCol + $step / 2] = ( $v0 + $v1 ) / 2;
$this->data[$aRow + $step / 2][$aCol] = ( $v0 + $v2 ) / 2;
$this->data[$aRow + $step][$aCol + $step / 2] = ( $v2 + $v3 ) / 2;
$this->data[$aRow + $step / 2][$aCol + $step] = ( $v1 + $v3 ) / 2;
$this->data[$aRow + $step / 2][$aCol + $step / 2] = ( $v0 + $v1 + $v2 + $v3 ) / 4;
$this->IntSquare( $aRow, $aCol, $aFactor-1 );
$this->IntSquare( $aRow, $aCol + $step / 2, $aFactor-1 );
$this->IntSquare( $aRow + $step / 2, $aCol, $aFactor-1 );
$this->IntSquare( $aRow + $step / 2, $aCol + $step / 2, $aFactor-1 );
}
/**
* Interpolate values in a matrice so that the total number of data points
* in vert and horizontal axis are $aIntNbr more. For example $aIntNbr=2 will
* make the data matrice have tiwce as many vertical and horizontal dta points.
*
* Note: This will blow up the matrcide in memory size in the order of $aInNbr^2
*
* @param $ &$aData The original data matricde
* @param $aInNbr Interpolation factor
* @return the interpolated matrice
*/
function Linear( &$aData, $aIntFactor ) {
$step = pow( 2, $aIntFactor-1 );
$orig_cols = count( $aData[0] );
$orig_rows = count( $aData );
// Number of new columns/rows
// N = (a-1) * 2^(f-1) + 1
$p = pow( 2, $aIntFactor-1 );
$new_cols = $p * ( $orig_cols - 1 ) + 1;
$new_rows = $p * ( $orig_rows - 1 ) + 1;
$this->data = array_fill( 0, $new_rows, array_fill( 0, $new_cols, 0 ) );
// Initialize the new matrix with the values that we know
for ( $i = 0; $i < $new_rows; $i++ ) {
for ( $j = 0; $j < $new_cols; $j++ ) {
$v = 0 ;
if ( ( $i % $step == 0 ) && ( $j % $step == 0 ) ) {
$v = $aData[$i / $step][$j / $step];
}
$this->data[$i][$j] = $v;
}
}
for ( $i = 0; $i < $new_rows-1; $i += $step ) {
for ( $j = 0; $j < $new_cols-1; $j += $step ) {
$this->IntSquare( $i, $j, $aIntFactor );
}
}
return $this->data;
}
}
?>

@ -0,0 +1,345 @@
<?php
/*=======================================================================
// File: JPGRAPH_MGRAPH.PHP
// Description: Class to handle multiple graphs in the same image
// Created: 2006-01-15
// Ver: $Id: jpgraph_mgraph.php 1770 2009-08-17 06:10:22Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
*/
//=============================================================================
// CLASS MGraph
// Description: Create a container image that can hold several graph
//=============================================================================
class MGraph {
public $title = null, $subtitle = null, $subsubtitle = null;
protected $img=NULL;
protected $iCnt=0,$iGraphs = array(); // image_handle, x, y, fx, fy, sizex, sizey
protected $iFillColor='white', $iCurrentColor=0;
protected $lm=4,$rm=4,$tm=4,$bm=4;
protected $iDoFrame = FALSE, $iFrameColor = 'black', $iFrameWeight = 1;
protected $iLineWeight = 1;
protected $expired=false;
protected $cache=null,$cache_name = '',$inline=true;
protected $image_format='png',$image_quality=75;
protected $iWidth=NULL,$iHeight=NULL;
protected $background_image='',$background_image_center=true,
$backround_image_format='',$background_image_mix=100,
$background_image_y=NULL, $background_image_x=NULL;
private $doshadow=false, $shadow_width=4, $shadow_color='gray@0.5';
public $footer;
// Create a new instane of the combined graph
function __construct($aWidth=NULL,$aHeight=NULL,$aCachedName='',$aTimeOut=0,$aInline=true) {
$this->iWidth = $aWidth;
$this->iHeight = $aHeight;
// If the cached version exist just read it directly from the
// cache, stream it back to browser and exit
if( $aCachedName!='' && READ_CACHE && $aInline ) {
$this->cache = new ImgStreamCache();
$this->cache->SetTimeOut($aTimeOut);
$image = new Image();
if( $this->cache->GetAndStream($image,$aCachedName) ) {
exit();
}
}
$this->inline = $aInline;
$this->cache_name = $aCachedName;
$this->title = new Text();
$this->title->ParagraphAlign('center');
$this->title->SetFont(FF_FONT2,FS_BOLD);
$this->title->SetMargin(3);
$this->title->SetAlign('center');
$this->subtitle = new Text();
$this->subtitle->ParagraphAlign('center');
$this->subtitle->SetFont(FF_FONT1,FS_BOLD);
$this->subtitle->SetMargin(3);
$this->subtitle->SetAlign('center');
$this->subsubtitle = new Text();
$this->subsubtitle->ParagraphAlign('center');
$this->subsubtitle->SetFont(FF_FONT1,FS_NORMAL);
$this->subsubtitle->SetMargin(3);
$this->subsubtitle->SetAlign('center');
$this->footer = new Footer();
}
// Specify background fill color for the combined graph
function SetFillColor($aColor) {
$this->iFillColor = $aColor;
}
// Add a frame around the combined graph
function SetFrame($aFlg,$aColor='black',$aWeight=1) {
$this->iDoFrame = $aFlg;
$this->iFrameColor = $aColor;
$this->iFrameWeight = $aWeight;
}
// Specify a background image blend
function SetBackgroundImageMix($aMix) {
$this->background_image_mix = $aMix ;
}
// Specify a background image
function SetBackgroundImage($aFileName,$aCenter_aX=NULL,$aY=NULL) {
// Second argument can be either a boolean value or
// a numeric
$aCenter=TRUE;
$aX=NULL;
if( is_numeric($aCenter_aX) ) {
$aX=$aCenter_aX;
}
// Get extension to determine image type
$e = explode('.',$aFileName);
if( !$e ) {
JpGraphError::RaiseL(12002,$aFileName);
//('Incorrect file name for MGraph::SetBackgroundImage() : '.$aFileName.' Must have a valid image extension (jpg,gif,png) when using autodetection of image type');
}
$valid_formats = array('png', 'jpg', 'gif');
$aImgFormat = strtolower($e[count($e)-1]);
if ($aImgFormat == 'jpeg') {
$aImgFormat = 'jpg';
}
elseif (!in_array($aImgFormat, $valid_formats) ) {
JpGraphError::RaiseL(12003,$aImgFormat,$aFileName);
//('Unknown file extension ($aImgFormat) in MGraph::SetBackgroundImage() for filename: '.$aFileName);
}
$this->background_image = $aFileName;
$this->background_image_center=$aCenter;
$this->background_image_format=$aImgFormat;
$this->background_image_x = $aX;
$this->background_image_y = $aY;
}
function _strokeBackgroundImage() {
if( $this->background_image == '' ) return;
$bkgimg = Graph::LoadBkgImage('',$this->background_image);
// Background width & Heoght
$bw = imagesx($bkgimg);
$bh = imagesy($bkgimg);
// Canvas width and height
$cw = imagesx($this->img);
$ch = imagesy($this->img);
if( $this->doshadow ) {
$cw -= $this->shadow_width;
$ch -= $this->shadow_width;
}
if( $this->background_image_x === NULL || $this->background_image_y === NULL ) {
if( $this->background_image_center ) {
// Center original image in the plot area
$x = round($cw/2-$bw/2); $y = round($ch/2-$bh/2);
}
else {
// Just copy the image from left corner, no resizing
$x=0; $y=0;
}
}
else {
$x = $this->background_image_x;
$y = $this->background_image_y;
}
imagecopymerge($this->img,$bkgimg,$x,$y,0,0,$bw,$bh,$this->background_image_mix);
}
function AddMix($aGraph,$x=0,$y=0,$mix=100,$fx=0,$fy=0,$w=0,$h=0) {
$this->_gdImgHandle($aGraph->Stroke( _IMG_HANDLER),$x,$y,$fx=0,$fy=0,$w,$h,$mix);
}
function Add($aGraph,$x=0,$y=0,$fx=0,$fy=0,$w=0,$h=0) {
$this->_gdImgHandle($aGraph->Stroke( _IMG_HANDLER),$x,$y,$fx=0,$fy=0,$w,$h);
}
function _gdImgHandle($agdCanvas,$x,$y,$fx=0,$fy=0,$w=0,$h=0,$mix=100) {
if( $w == 0 ) {
$w = @imagesx($agdCanvas);
}
if( $w === NULL ) {
JpGraphError::RaiseL(12007);
//('Argument to MGraph::Add() is not a valid GD image handle.');
return;
}
if( $h == 0 ) {
$h = @imagesy($agdCanvas);
}
$this->iGraphs[$this->iCnt++] = array($agdCanvas,$x,$y,$fx,$fy,$w,$h,$mix);
}
function SetMargin($lm,$rm,$tm,$bm) {
$this->lm = $lm;
$this->rm = $rm;
$this->tm = $tm;
$this->bm = $bm;
}
function SetExpired($aFlg=true) {
$this->expired = $aFlg;
}
function SetImgFormat($aFormat,$aQuality=75) {
$this->image_format = $aFormat;
$this->image_quality = $aQuality;
}
// Set the shadow around the whole image
function SetShadow($aShowShadow=true,$aShadowWidth=4,$aShadowColor='gray@0.3') {
$this->doshadow = $aShowShadow;
$this->shadow_color = $aShadowColor;
$this->shadow_width = $aShadowWidth;
$this->footer->iBottomMargin += $aShadowWidth;
$this->footer->iRightMargin += $aShadowWidth;
}
function StrokeTitle($image,$w,$h) {
// Stroke title
if( $this->title->t !== '' ) {
$margin = 3;
$y = $this->title->margin;
if( $this->title->halign == 'center' ) {
$this->title->Center(0,$w,$y);
}
elseif( $this->title->halign == 'left' ) {
$this->title->SetPos($this->title->margin+2,$y);
}
elseif( $this->title->halign == 'right' ) {
$indent = 0;
if( $this->doshadow ) {
$indent = $this->shadow_width+2;
}
$this->title->SetPos($w-$this->title->margin-$indent,$y,'right');
}
$this->title->Stroke($image);
// ... and subtitle
$y += $this->title->GetTextHeight($image) + $margin + $this->subtitle->margin;
if( $this->subtitle->halign == 'center' ) {
$this->subtitle->Center(0,$w,$y);
}
elseif( $this->subtitle->halign == 'left' ) {
$this->subtitle->SetPos($this->subtitle->margin+2,$y);
}
elseif( $this->subtitle->halign == 'right' ) {
$indent = 0;
if( $this->doshadow ) {
$indent = $this->shadow_width+2;
}
$this->subtitle->SetPos($this->img->width-$this->subtitle->margin-$indent,$y,'right');
}
$this->subtitle->Stroke($image);
// ... and subsubtitle
$y += $this->subtitle->GetTextHeight($image) + $margin + $this->subsubtitle->margin;
if( $this->subsubtitle->halign == 'center' ) {
$this->subsubtitle->Center(0,$w,$y);
}
elseif( $this->subsubtitle->halign == 'left' ) {
$this->subsubtitle->SetPos($this->subsubtitle->margin+2,$y);
}
elseif( $this->subsubtitle->halign == 'right' ) {
$indent = 0;
if( $this->doshadow ) {
$indent = $this->shadow_width+2;
}
$this->subsubtitle->SetPos($w-$this->subsubtitle->margin-$indent,$y,'right');
}
$this->subsubtitle->Stroke($image);
}
}
function Stroke($aFileName='') {
// Find out the necessary size for the container image
$w=0; $h=0;
for($i=0; $i < $this->iCnt; ++$i ) {
$maxw = $this->iGraphs[$i][1]+$this->iGraphs[$i][5];
$maxh = $this->iGraphs[$i][2]+$this->iGraphs[$i][6];
$w = max( $w, $maxw );
$h = max( $h, $maxh );
}
$w += $this->lm+$this->rm;
$h += $this->tm+$this->bm;
// User specified width,height overrides
if( $this->iWidth !== NULL && $this->iWidth !== 0 ) $w = $this->iWidth;
if( $this->iHeight!== NULL && $this->iHeight !== 0) $h = $this->iHeight;
if( $this->doshadow ) {
$w += $this->shadow_width;
$h += $this->shadow_width;
}
$image = new Image($w,$h);
$image->SetImgFormat( $this->image_format,$this->image_quality);
if( $this->doshadow ) {
$image->SetColor($this->iFrameColor);
$image->ShadowRectangle(0,0,$w-1,$h-1,$this->iFillColor,$this->shadow_width,$this->shadow_color);
$w -= $this->shadow_width;
$h -= $this->shadow_width;
}
else {
$image->SetColor($this->iFillColor);
$image->FilledRectangle(0,0,$w-1,$h-1);
}
$image->SetExpired($this->expired);
$this->img = $image->img;
$this->_strokeBackgroundImage();
if( $this->iDoFrame && ! $this->doshadow ) {
$image->SetColor($this->iFrameColor);
$image->SetLineWeight($this->iFrameWeight);
$image->Rectangle(0,0,$w-1,$h-1);
}
// Copy all sub graphs to the container
for($i=0; $i < $this->iCnt; ++$i ) {
$image->CopyMerge($this->iGraphs[$i][0],
$this->iGraphs[$i][1]+$this->lm,$this->iGraphs[$i][2]+$this->tm,
$this->iGraphs[$i][3],$this->iGraphs[$i][4],
$this->iGraphs[$i][5],$this->iGraphs[$i][6],
-1,-1, /* Full from width and height */
$this->iGraphs[$i][7]);
}
$this->StrokeTitle($image,$w,$h);
$this->footer->Stroke($image);
// Output image
if( $aFileName == _IMG_HANDLER ) {
return $image->img;
}
else {
//Finally stream the generated picture
$this->cache = new ImgStreamCache();
$this->cache->PutAndStream($image,$this->cache_name,$this->inline,$aFileName);
}
}
}
// EOF
?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,142 @@
<?php
/*=======================================================================
// File: JPGRAPH_PLOTLINE.PHP
// Description: PlotLine extension for JpGraph
// Created: 2009-03-24
// Ver: $Id: jpgraph_plotline.php 1931 2010-03-22 15:05:48Z 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) Asial Corporation. 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;
}
function GetCSIMAreas() {
return '';
}
//---------------
// 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)
);
}
}
?>

@ -1,482 +0,0 @@
<?php
//=======================================================================
// File: JPGRAPH_PLOTMARK.PHP
// Description: Class file. Handles plotmarks
// Created: 2003-03-21
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: jpgraph_plotmark.inc,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
//========================================================================
// CLASS ImgData
// Description: Base class for all image data classes that contains the
// real image data.
//========================================================================
class ImgData {
var $name = ''; // Each subclass gives a name
var $an = array(); // Data array names
var $colors = array(); // Available colors
var $index = array(); // Index for colors
var $maxidx = 0 ; // Max color index
var $anchor_x=0.5, $anchor_y=0.5 ; // Where is the center of the image
// Create a GD image from the data and return a GD handle
function GetImg($aMark,$aIdx) {
$n = $this->an[$aMark];
if( is_string($aIdx) ) {
if( !in_array($aIdx,$this->colors) ) {
JpGraphError::RaiseL(23001,$this->name,$aIdx); //('This marker "'.($this->name).'" does not exist in color: '.$aIdx);
}
$idx = $this->index[$aIdx];
}
elseif( !is_integer($aIdx) ||
(is_integer($aIdx) && $aIdx > $this->maxidx ) ) {
JpGraphError::RaiseL(23002,$this->name);
//('Mark color index too large for marker "'.($this->name).'"');
}
else
$idx = $aIdx ;
return Image::CreateFromString(base64_decode($this->{$n}[$idx][1]));
}
function GetAnchor() {
return array($this->anchor_x,$this->anchor_y);
}
}
// Keep a global flag cache to reduce memory usage
$_gFlagCache=array(
1 => null,
2 => null,
3 => null,
4 => null,
);
// Only supposed to b called as statics
class FlagCache {
function GetFlagImgByName($aSize,$aName) {
global $_gFlagCache;
require_once('jpgraph_flags.php');
if( $_gFlagCache[$aSize] === null ) {
$_gFlagCache[$aSize] = new FlagImages($aSize);
}
$f =& $_gFlagCache[$aSize];
$idx = $f->GetIdxByName($aName,$aFullName);
return $f->GetImgByIdx($idx);
}
}
//===================================================
// CLASS PlotMark
// Description: Handles the plot marks in graphs
//===================================================
class PlotMark {
var $title, $show=true;
var $type,$weight=1;
var $color="black", $width=4, $fill_color="blue";
var $yvalue,$xvalue='',$csimtarget,$csimalt,$csimareas;
var $iFormatCallback="";
var $iFormatCallback2="";
var $markimg='',$iScale=1.0;
var $oldfilename='',$iFileName='';
var $imgdata_balls = null;
var $imgdata_diamonds = null;
var $imgdata_squares = null;
var $imgdata_bevels = null;
var $imgdata_stars = null;
var $imgdata_pushpins = null;
//--------------
// CONSTRUCTOR
function __construct() {
$this->title = new Text();
$this->title->Hide();
$this->csimareas = '';
$this->csimalt = '';
$this->type=-1;
}
//---------------
// PUBLIC METHODS
function SetType($aType,$aFileName='',$aScale=1.0) {
$this->type = $aType;
if( $aType == MARK_IMG && $aFileName=='' ) {
JpGraphError::RaiseL(23003);//('A filename must be specified if you set the mark type to MARK_IMG.');
}
$this->iFileName = $aFileName;
$this->iScale = $aScale;
}
function SetCallback($aFunc) {
$this->iFormatCallback = $aFunc;
}
function SetCallbackYX($aFunc) {
$this->iFormatCallback2 = $aFunc;
}
function GetType() {
return $this->type;
}
function SetColor($aColor) {
$this->color=$aColor;
}
function SetFillColor($aFillColor) {
$this->fill_color = $aFillColor;
}
function SetWeight($aWeight) {
$this->weight = $aWeight;
}
// Synonym for SetWidth()
function SetSize($aWidth) {
$this->width=$aWidth;
}
function SetWidth($aWidth) {
$this->width=$aWidth;
}
function SetDefaultWidth() {
switch( $this->type ) {
case MARK_CIRCLE:
case MARK_FILLEDCIRCLE:
$this->width=4;
break;
default:
$this->width=7;
}
}
function GetWidth() {
return $this->width;
}
function Hide($aHide=true) {
$this->show = !$aHide;
}
function Show($aShow=true) {
$this->show = $aShow;
}
function SetCSIMAltVal($aY,$aX='') {
$this->yvalue=$aY;
$this->xvalue=$aX;
}
function SetCSIMTarget($aTarget) {
$this->csimtarget=$aTarget;
}
function SetCSIMAlt($aAlt) {
$this->csimalt=$aAlt;
}
function GetCSIMAreas(){
return $this->csimareas;
}
function AddCSIMPoly($aPts) {
$coords = round($aPts[0]).", ".round($aPts[1]);
$n = count($aPts)/2;
for( $i=1; $i < $n; ++$i){
$coords .= ", ".round($aPts[2*$i]).", ".round($aPts[2*$i+1]);
}
$this->csimareas="";
if( !empty($this->csimtarget) ) {
$this->csimareas .= "<area shape=\"poly\" coords=\"$coords\" href=\"".$this->csimtarget."\"";
if( !empty($this->csimalt) ) {
$tmp=sprintf($this->csimalt,$this->yvalue,$this->xvalue);
$this->csimareas .= " title=\"$tmp\"";
}
$this->csimareas .= " alt=\"$tmp\" />\n";
}
}
function AddCSIMCircle($x,$y,$r) {
$x = round($x); $y=round($y); $r=round($r);
$this->csimareas="";
if( !empty($this->csimtarget) ) {
$this->csimareas .= "<area shape=\"circle\" coords=\"$x,$y,$r\" href=\"".$this->csimtarget."\"";
if( !empty($this->csimalt) ) {
$tmp=sprintf($this->csimalt,$this->yvalue,$this->xvalue);
$this->csimareas .= " title=\"$tmp\"";
}
$this->csimareas .= " alt=\"$tmp\" />\n";
}
}
function Stroke(&$img,$x,$y) {
if( !$this->show ) return;
if( $this->iFormatCallback != '' || $this->iFormatCallback2 != '' ) {
if( $this->iFormatCallback != '' ) {
$f = $this->iFormatCallback;
list($width,$color,$fcolor) = call_user_func($f,$this->yvalue);
$filename = $this->iFileName;
$imgscale = $this->iScale;
}
else {
$f = $this->iFormatCallback2;
list($width,$color,$fcolor,$filename,$imgscale) = call_user_func($f,$this->yvalue,$this->xvalue);
if( $filename=="" ) $filename = $this->iFileName;
if( $imgscale=="" ) $imgscale = $this->iScale;
}
if( $width=="" ) $width = $this->width;
if( $color=="" ) $color = $this->color;
if( $fcolor=="" ) $fcolor = $this->fill_color;
}
else {
$fcolor = $this->fill_color;
$color = $this->color;
$width = $this->width;
$filename = $this->iFileName;
$imgscale = $this->iScale;
}
if( $this->type == MARK_IMG ||
($this->type >= MARK_FLAG1 && $this->type <= MARK_FLAG4 ) ||
$this->type >= MARK_IMG_PUSHPIN ) {
// Note: For the builtin images we use the "filename" parameter
// to denote the color
$anchor_x = 0.5;
$anchor_y = 0.5;
switch( $this->type ) {
case MARK_FLAG1:
case MARK_FLAG2:
case MARK_FLAG3:
case MARK_FLAG4:
$this->markimg = FlagCache::GetFlagImgByName($this->type-MARK_FLAG1+1,$filename);
break;
case MARK_IMG :
// Load an image and use that as a marker
// Small optimization, if we have already read an image don't
// waste time reading it again.
if( $this->markimg == '' || !($this->oldfilename === $filename) ) {
$this->markimg = Graph::LoadBkgImage('',$filename);
$this->oldfilename = $filename ;
}
break;
case MARK_IMG_PUSHPIN:
case MARK_IMG_SPUSHPIN:
case MARK_IMG_LPUSHPIN:
if( $this->imgdata_pushpins == null ) {
require_once 'imgdata_pushpins.inc';
$this->imgdata_pushpins = new ImgData_PushPins();
}
$this->markimg = $this->imgdata_pushpins->GetImg($this->type,$filename);
list($anchor_x,$anchor_y) = $this->imgdata_pushpins->GetAnchor();
break;
case MARK_IMG_SQUARE:
if( $this->imgdata_squares == null ) {
require_once 'imgdata_squares.inc';
$this->imgdata_squares = new ImgData_Squares();
}
$this->markimg = $this->imgdata_squares->GetImg($this->type,$filename);
list($anchor_x,$anchor_y) = $this->imgdata_squares->GetAnchor();
break;
case MARK_IMG_STAR:
if( $this->imgdata_stars == null ) {
require_once 'imgdata_stars.inc';
$this->imgdata_stars = new ImgData_Stars();
}
$this->markimg = $this->imgdata_stars->GetImg($this->type,$filename);
list($anchor_x,$anchor_y) = $this->imgdata_stars->GetAnchor();
break;
case MARK_IMG_BEVEL:
if( $this->imgdata_bevels == null ) {
require_once 'imgdata_bevels.inc';
$this->imgdata_bevels = new ImgData_Bevels();
}
$this->markimg = $this->imgdata_bevels->GetImg($this->type,$filename);
list($anchor_x,$anchor_y) = $this->imgdata_bevels->GetAnchor();
break;
case MARK_IMG_DIAMOND:
if( $this->imgdata_diamonds == null ) {
require_once 'imgdata_diamonds.inc';
$this->imgdata_diamonds = new ImgData_Diamonds();
}
$this->markimg = $this->imgdata_diamonds->GetImg($this->type,$filename);
list($anchor_x,$anchor_y) = $this->imgdata_diamonds->GetAnchor();
break;
case MARK_IMG_BALL:
case MARK_IMG_SBALL:
case MARK_IMG_MBALL:
case MARK_IMG_LBALL:
if( $this->imgdata_balls == null ) {
require_once 'imgdata_balls.inc';
$this->imgdata_balls = new ImgData_Balls();
}
$this->markimg = $this->imgdata_balls->GetImg($this->type,$filename);
list($anchor_x,$anchor_y) = $this->imgdata_balls->GetAnchor();
break;
}
$w = $img->GetWidth($this->markimg);
$h = $img->GetHeight($this->markimg);
$dw = round($imgscale * $w );
$dh = round($imgscale * $h );
// Do potential rotation
list($x,$y) = $img->Rotate($x,$y);
$dx = round($x-$dw*$anchor_x);
$dy = round($y-$dh*$anchor_y);
$this->width = max($dx,$dy);
$img->Copy($this->markimg,$dx,$dy,0,0,$dw,$dh,$w,$h);
if( !empty($this->csimtarget) ) {
$this->csimareas = "<area shape=\"rect\" coords=\"".
$dx.','.$dy.','.round($dx+$dw).','.round($dy+$dh).'" '.
"href=\"".$this->csimtarget."\"";
if( !empty($this->csimalt) ) {
$tmp=sprintf($this->csimalt,$this->yvalue,$this->xvalue);
$this->csimareas .= " title=\"$tmp\"";
}
$this->csimareas .= " alt=\"$tmp\" />\n";
}
// Stroke title
$this->title->Align("center","top");
$this->title->Stroke($img,$x,$y+round($dh/2));
return;
}
$weight = $this->weight;
$dx=round($width/2,0);
$dy=round($width/2,0);
$pts=0;
switch( $this->type ) {
case MARK_SQUARE:
$c[]=$x-$dx;$c[]=$y-$dy;
$c[]=$x+$dx;$c[]=$y-$dy;
$c[]=$x+$dx;$c[]=$y+$dy;
$c[]=$x-$dx;$c[]=$y+$dy;
$c[]=$x-$dx;$c[]=$y-$dy;
$pts=5;
break;
case MARK_UTRIANGLE:
++$dx;++$dy;
$c[]=$x-$dx;$c[]=$y+0.87*$dy; // tan(60)/2*$dx
$c[]=$x;$c[]=$y-0.87*$dy;
$c[]=$x+$dx;$c[]=$y+0.87*$dy;
$c[]=$x-$dx;$c[]=$y+0.87*$dy; // tan(60)/2*$dx
$pts=4;
break;
case MARK_DTRIANGLE:
++$dx;++$dy;
$c[]=$x;$c[]=$y+0.87*$dy; // tan(60)/2*$dx
$c[]=$x-$dx;$c[]=$y-0.87*$dy;
$c[]=$x+$dx;$c[]=$y-0.87*$dy;
$c[]=$x;$c[]=$y+0.87*$dy; // tan(60)/2*$dx
$pts=4;
break;
case MARK_DIAMOND:
$c[]=$x;$c[]=$y+$dy;
$c[]=$x-$dx;$c[]=$y;
$c[]=$x;$c[]=$y-$dy;
$c[]=$x+$dx;$c[]=$y;
$c[]=$x;$c[]=$y+$dy;
$pts=5;
break;
case MARK_LEFTTRIANGLE:
$c[]=$x;$c[]=$y;
$c[]=$x;$c[]=$y+2*$dy;
$c[]=$x+$dx*2;$c[]=$y;
$c[]=$x;$c[]=$y;
$pts=4;
break;
case MARK_RIGHTTRIANGLE:
$c[]=$x-$dx*2;$c[]=$y;
$c[]=$x;$c[]=$y+2*$dy;
$c[]=$x;$c[]=$y;
$c[]=$x-$dx*2;$c[]=$y;
$pts=4;
break;
case MARK_FLASH:
$dy *= 2;
$c[]=$x+$dx/2; $c[]=$y-$dy;
$c[]=$x-$dx+$dx/2; $c[]=$y+$dy*0.7-$dy;
$c[]=$x+$dx/2; $c[]=$y+$dy*1.3-$dy;
$c[]=$x-$dx+$dx/2; $c[]=$y+2*$dy-$dy;
$img->SetLineWeight($weight);
$img->SetColor($color);
$img->Polygon($c);
$img->SetLineWeight(1);
$this->AddCSIMPoly($c);
break;
}
if( $pts>0 ) {
$this->AddCSIMPoly($c);
$img->SetLineWeight($weight);
$img->SetColor($fcolor);
$img->FilledPolygon($c);
$img->SetColor($color);
$img->Polygon($c);
$img->SetLineWeight(1);
}
elseif( $this->type==MARK_CIRCLE ) {
$img->SetColor($color);
$img->Circle($x,$y,$width);
$this->AddCSIMCircle($x,$y,$width);
}
elseif( $this->type==MARK_FILLEDCIRCLE ) {
$img->SetColor($fcolor);
$img->FilledCircle($x,$y,$width);
$img->SetColor($color);
$img->Circle($x,$y,$width);
$this->AddCSIMCircle($x,$y,$width);
}
elseif( $this->type==MARK_CROSS ) {
// Oversize by a pixel to match the X
$img->SetColor($color);
$img->SetLineWeight($weight);
$img->Line($x,$y+$dy+1,$x,$y-$dy-1);
$img->Line($x-$dx-1,$y,$x+$dx+1,$y);
$this->AddCSIMCircle($x,$y,$dx);
}
elseif( $this->type==MARK_X ) {
$img->SetColor($color);
$img->SetLineWeight($weight);
$img->Line($x+$dx,$y+$dy,$x-$dx,$y-$dy);
$img->Line($x-$dx,$y+$dy,$x+$dx,$y-$dy);
$this->AddCSIMCircle($x,$y,$dx+$dy);
}
elseif( $this->type==MARK_STAR ) {
$img->SetColor($color);
$img->SetLineWeight($weight);
$img->Line($x+$dx,$y+$dy,$x-$dx,$y-$dy);
$img->Line($x-$dx,$y+$dy,$x+$dx,$y-$dy);
// Oversize by a pixel to match the X
$img->Line($x,$y+$dy+1,$x,$y-$dy-1);
$img->Line($x-$dx-1,$y,$x+$dx+1,$y);
$this->AddCSIMCircle($x,$y,$dx+$dy);
}
// Stroke title
$this->title->Align("center","center");
$this->title->Stroke($img,$x,$y);
}
} // Class
?>

@ -0,0 +1,504 @@
<?php
//=======================================================================
// File: JPGRAPH_PLOTMARK.PHP
// Description: Class file. Handles plotmarks
// Created: 2003-03-21
// Ver: $Id: jpgraph_plotmark.inc.php 1106 2009-02-22 20:16:35Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
//===================================================
// CLASS PlotMark
// Description: Handles the plot marks in graphs
//===================================================
class PlotMark {
public $title, $show=true;
public $type,$weight=1;
public $iFormatCallback="", $iFormatCallback2="";
public $fill_color="blue";
public $color="black", $width=4;
private $yvalue,$xvalue='',$csimtarget,$csimwintarget='',$csimalt,$csimareas;
private $markimg='',$iScale=1.0;
private $oldfilename='',$iFileName='';
private $imgdata_balls = null;
private $imgdata_diamonds = null;
private $imgdata_squares = null;
private $imgdata_bevels = null;
private $imgdata_stars = null;
private $imgdata_pushpins = null;
//--------------
// CONSTRUCTOR
function __construct() {
$this->title = new Text();
$this->title->Hide();
$this->csimareas = '';
$this->type=-1;
}
//---------------
// PUBLIC METHODS
function SetType($aType,$aFileName='',$aScale=1.0) {
$this->type = $aType;
if( $aType == MARK_IMG && $aFileName=='' ) {
JpGraphError::RaiseL(23003);//('A filename must be specified if you set the mark type to MARK_IMG.');
}
$this->iFileName = $aFileName;
$this->iScale = $aScale;
}
function SetCallback($aFunc) {
$this->iFormatCallback = $aFunc;
}
function SetCallbackYX($aFunc) {
$this->iFormatCallback2 = $aFunc;
}
function GetType() {
return $this->type;
}
function SetColor($aColor) {
$this->color=$aColor;
}
function SetFillColor($aFillColor) {
$this->fill_color = $aFillColor;
}
function SetWeight($aWeight) {
$this->weight = $aWeight;
}
// Synonym for SetWidth()
function SetSize($aWidth) {
$this->width=$aWidth;
}
function SetWidth($aWidth) {
$this->width=$aWidth;
}
function SetDefaultWidth() {
switch( $this->type ) {
case MARK_CIRCLE:
case MARK_FILLEDCIRCLE:
$this->width=4;
break;
default:
$this->width=7;
}
}
function GetWidth() {
return $this->width;
}
function Hide($aHide=true) {
$this->show = !$aHide;
}
function Show($aShow=true) {
$this->show = $aShow;
}
function SetCSIMAltVal($aY,$aX='') {
$this->yvalue=$aY;
$this->xvalue=$aX;
}
function SetCSIMTarget($aTarget,$aWinTarget='') {
$this->csimtarget=$aTarget;
$this->csimwintarget=$aWinTarget;
}
function SetCSIMAlt($aAlt) {
$this->csimalt=$aAlt;
}
function GetCSIMAreas(){
return $this->csimareas;
}
function AddCSIMPoly($aPts) {
$coords = round($aPts[0]).", ".round($aPts[1]);
$n = count($aPts)/2;
for( $i=1; $i < $n; ++$i){
$coords .= ", ".round($aPts[2*$i]).", ".round($aPts[2*$i+1]);
}
$this->csimareas="";
if( !empty($this->csimtarget) ) {
$this->csimareas .= "<area shape=\"poly\" coords=\"$coords\" href=\"".htmlentities($this->csimtarget)."\"";
if( !empty($this->csimwintarget) ) {
$this->csimareas .= " target=\"".$this->csimwintarget."\" ";
}
if( !empty($this->csimalt) ) {
$tmp=sprintf($this->csimalt,$this->yvalue,$this->xvalue);
$this->csimareas .= " title=\"$tmp\" alt=\"$tmp\"";
}
$this->csimareas .= " />\n";
}
}
function AddCSIMCircle($x,$y,$r) {
$x = round($x); $y=round($y); $r=round($r);
$this->csimareas="";
if( !empty($this->csimtarget) ) {
$this->csimareas .= "<area shape=\"circle\" coords=\"$x,$y,$r\" href=\"".htmlentities($this->csimtarget)."\"";
if( !empty($this->csimwintarget) ) {
$this->csimareas .= " target=\"".$this->csimwintarget."\" ";
}
if( !empty($this->csimalt) ) {
$tmp=sprintf($this->csimalt,$this->yvalue,$this->xvalue);
$this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" ";
}
$this->csimareas .= " />\n";
}
}
function Stroke($img,$x,$y) {
if( !$this->show ) return;
if( $this->iFormatCallback != '' || $this->iFormatCallback2 != '' ) {
if( $this->iFormatCallback != '' ) {
$f = $this->iFormatCallback;
list($width,$color,$fcolor) = call_user_func($f,$this->yvalue);
$filename = $this->iFileName;
$imgscale = $this->iScale;
}
else {
$f = $this->iFormatCallback2;
list($width,$color,$fcolor,$filename,$imgscale) = call_user_func($f,$this->yvalue,$this->xvalue);
if( $filename=="" ) $filename = $this->iFileName;
if( $imgscale=="" ) $imgscale = $this->iScale;
}
if( $width=="" ) $width = $this->width;
if( $color=="" ) $color = $this->color;
if( $fcolor=="" ) $fcolor = $this->fill_color;
}
else {
$fcolor = $this->fill_color;
$color = $this->color;
$width = $this->width;
$filename = $this->iFileName;
$imgscale = $this->iScale;
}
if( $this->type == MARK_IMG ||
($this->type >= MARK_FLAG1 && $this->type <= MARK_FLAG4 ) ||
$this->type >= MARK_IMG_PUSHPIN ) {
// Note: For the builtin images we use the "filename" parameter
// to denote the color
$anchor_x = 0.5;
$anchor_y = 0.5;
switch( $this->type ) {
case MARK_FLAG1:
case MARK_FLAG2:
case MARK_FLAG3:
case MARK_FLAG4:
$this->markimg = FlagCache::GetFlagImgByName($this->type-MARK_FLAG1+1,$filename);
break;
case MARK_IMG :
// Load an image and use that as a marker
// Small optimization, if we have already read an image don't
// waste time reading it again.
if( $this->markimg == '' || !($this->oldfilename === $filename) ) {
$this->markimg = Graph::LoadBkgImage('',$filename);
$this->oldfilename = $filename ;
}
break;
case MARK_IMG_PUSHPIN:
case MARK_IMG_SPUSHPIN:
case MARK_IMG_LPUSHPIN:
if( $this->imgdata_pushpins == null ) {
require_once 'imgdata_pushpins.inc.php';
$this->imgdata_pushpins = new ImgData_PushPins();
}
$this->markimg = $this->imgdata_pushpins->GetImg($this->type,$filename);
list($anchor_x,$anchor_y) = $this->imgdata_pushpins->GetAnchor();
break;
case MARK_IMG_SQUARE:
if( $this->imgdata_squares == null ) {
require_once 'imgdata_squares.inc.php';
$this->imgdata_squares = new ImgData_Squares();
}
$this->markimg = $this->imgdata_squares->GetImg($this->type,$filename);
list($anchor_x,$anchor_y) = $this->imgdata_squares->GetAnchor();
break;
case MARK_IMG_STAR:
if( $this->imgdata_stars == null ) {
require_once 'imgdata_stars.inc.php';
$this->imgdata_stars = new ImgData_Stars();
}
$this->markimg = $this->imgdata_stars->GetImg($this->type,$filename);
list($anchor_x,$anchor_y) = $this->imgdata_stars->GetAnchor();
break;
case MARK_IMG_BEVEL:
if( $this->imgdata_bevels == null ) {
require_once 'imgdata_bevels.inc.php';
$this->imgdata_bevels = new ImgData_Bevels();
}
$this->markimg = $this->imgdata_bevels->GetImg($this->type,$filename);
list($anchor_x,$anchor_y) = $this->imgdata_bevels->GetAnchor();
break;
case MARK_IMG_DIAMOND:
if( $this->imgdata_diamonds == null ) {
require_once 'imgdata_diamonds.inc.php';
$this->imgdata_diamonds = new ImgData_Diamonds();
}
$this->markimg = $this->imgdata_diamonds->GetImg($this->type,$filename);
list($anchor_x,$anchor_y) = $this->imgdata_diamonds->GetAnchor();
break;
case MARK_IMG_BALL:
case MARK_IMG_SBALL:
case MARK_IMG_MBALL:
case MARK_IMG_LBALL:
if( $this->imgdata_balls == null ) {
require_once 'imgdata_balls.inc.php';
$this->imgdata_balls = new ImgData_Balls();
}
$this->markimg = $this->imgdata_balls->GetImg($this->type,$filename);
list($anchor_x,$anchor_y) = $this->imgdata_balls->GetAnchor();
break;
}
$w = $img->GetWidth($this->markimg);
$h = $img->GetHeight($this->markimg);
$dw = round($imgscale * $w );
$dh = round($imgscale * $h );
// Do potential rotation
list($x,$y) = $img->Rotate($x,$y);
$dx = round($x-$dw*$anchor_x);
$dy = round($y-$dh*$anchor_y);
$this->width = max($dx,$dy);
$img->Copy($this->markimg,$dx,$dy,0,0,$dw,$dh,$w,$h);
if( !empty($this->csimtarget) ) {
$this->csimareas = "<area shape=\"rect\" coords=\"".
$dx.','.$dy.','.round($dx+$dw).','.round($dy+$dh).'" '.
"href=\"".htmlentities($this->csimtarget)."\"";
if( !empty($this->csimwintarget) ) {
$this->csimareas .= " target=\"".$this->csimwintarget."\" ";
}
if( !empty($this->csimalt) ) {
$tmp=sprintf($this->csimalt,$this->yvalue,$this->xvalue);
$this->csimareas .= " title=\"$tmp\" alt=\"$tmp\" ";
}
$this->csimareas .= " />\n";
}
// Stroke title
$this->title->Align("center","top");
$this->title->Stroke($img,$x,$y+round($dh/2));
return;
}
$weight = $this->weight;
$dx=round($width/2,0);
$dy=round($width/2,0);
$pts=0;
switch( $this->type ) {
case MARK_SQUARE:
$c[]=$x-$dx;$c[]=$y-$dy;
$c[]=$x+$dx;$c[]=$y-$dy;
$c[]=$x+$dx;$c[]=$y+$dy;
$c[]=$x-$dx;$c[]=$y+$dy;
$c[]=$x-$dx;$c[]=$y-$dy;
$pts=5;
break;
case MARK_UTRIANGLE:
++$dx;++$dy;
$c[]=$x-$dx;$c[]=$y+0.87*$dy; // tan(60)/2*$dx
$c[]=$x;$c[]=$y-0.87*$dy;
$c[]=$x+$dx;$c[]=$y+0.87*$dy;
$c[]=$x-$dx;$c[]=$y+0.87*$dy; // tan(60)/2*$dx
$pts=4;
break;
case MARK_DTRIANGLE:
++$dx;++$dy;
$c[]=$x;$c[]=$y+0.87*$dy; // tan(60)/2*$dx
$c[]=$x-$dx;$c[]=$y-0.87*$dy;
$c[]=$x+$dx;$c[]=$y-0.87*$dy;
$c[]=$x;$c[]=$y+0.87*$dy; // tan(60)/2*$dx
$pts=4;
break;
case MARK_DIAMOND:
$c[]=$x;$c[]=$y+$dy;
$c[]=$x-$dx;$c[]=$y;
$c[]=$x;$c[]=$y-$dy;
$c[]=$x+$dx;$c[]=$y;
$c[]=$x;$c[]=$y+$dy;
$pts=5;
break;
case MARK_LEFTTRIANGLE:
$c[]=$x;$c[]=$y;
$c[]=$x;$c[]=$y+2*$dy;
$c[]=$x+$dx*2;$c[]=$y;
$c[]=$x;$c[]=$y;
$pts=4;
break;
case MARK_RIGHTTRIANGLE:
$c[]=$x-$dx*2;$c[]=$y;
$c[]=$x;$c[]=$y+2*$dy;
$c[]=$x;$c[]=$y;
$c[]=$x-$dx*2;$c[]=$y;
$pts=4;
break;
case MARK_FLASH:
$dy *= 2;
$c[]=$x+$dx/2; $c[]=$y-$dy;
$c[]=$x-$dx+$dx/2; $c[]=$y+$dy*0.7-$dy;
$c[]=$x+$dx/2; $c[]=$y+$dy*1.3-$dy;
$c[]=$x-$dx+$dx/2; $c[]=$y+2*$dy-$dy;
$img->SetLineWeight($weight);
$img->SetColor($color);
$img->Polygon($c);
$img->SetLineWeight(1);
$this->AddCSIMPoly($c);
break;
}
if( $pts>0 ) {
$this->AddCSIMPoly($c);
$img->SetLineWeight($weight);
$img->SetColor($fcolor);
$img->FilledPolygon($c);
$img->SetColor($color);
$img->Polygon($c);
$img->SetLineWeight(1);
}
elseif( $this->type==MARK_CIRCLE ) {
$img->SetColor($color);
$img->Circle($x,$y,$width);
$this->AddCSIMCircle($x,$y,$width);
}
elseif( $this->type==MARK_FILLEDCIRCLE ) {
$img->SetColor($fcolor);
$img->FilledCircle($x,$y,$width);
$img->SetColor($color);
$img->Circle($x,$y,$width);
$this->AddCSIMCircle($x,$y,$width);
}
elseif( $this->type==MARK_CROSS ) {
// Oversize by a pixel to match the X
$img->SetColor($color);
$img->SetLineWeight($weight);
$img->Line($x,$y+$dy+1,$x,$y-$dy-1);
$img->Line($x-$dx-1,$y,$x+$dx+1,$y);
$this->AddCSIMCircle($x,$y,$dx);
}
elseif( $this->type==MARK_X ) {
$img->SetColor($color);
$img->SetLineWeight($weight);
$img->Line($x+$dx,$y+$dy,$x-$dx,$y-$dy);
$img->Line($x-$dx,$y+$dy,$x+$dx,$y-$dy);
$this->AddCSIMCircle($x,$y,$dx+$dy);
}
elseif( $this->type==MARK_STAR ) {
$img->SetColor($color);
$img->SetLineWeight($weight);
$img->Line($x+$dx,$y+$dy,$x-$dx,$y-$dy);
$img->Line($x-$dx,$y+$dy,$x+$dx,$y-$dy);
// Oversize by a pixel to match the X
$img->Line($x,$y+$dy+1,$x,$y-$dy-1);
$img->Line($x-$dx-1,$y,$x+$dx+1,$y);
$this->AddCSIMCircle($x,$y,$dx+$dy);
}
// Stroke title
$this->title->Align("center","center");
$this->title->Stroke($img,$x,$y);
}
} // Class
//========================================================================
// CLASS ImgData
// Description: Base class for all image data classes that contains the
// real image data.
//========================================================================
class ImgData {
protected $name = ''; // Each subclass gives a name
protected $an = array(); // Data array names
protected $colors = array(); // Available colors
protected $index = array(); // Index for colors
protected $maxidx = 0 ; // Max color index
protected $anchor_x=0.5, $anchor_y=0.5 ; // Where is the center of the image
function __construct() {
// Empty
}
// Create a GD image from the data and return a GD handle
function GetImg($aMark,$aIdx) {
$n = $this->an[$aMark];
if( is_string($aIdx) ) {
if( !in_array($aIdx,$this->colors) ) {
JpGraphError::RaiseL(23001,$this->name,$aIdx);//('This marker "'.($this->name).'" does not exist in color: '.$aIdx);
}
$idx = $this->index[$aIdx];
}
elseif( !is_integer($aIdx) ||
(is_integer($aIdx) && $aIdx > $this->maxidx ) ) {
JpGraphError::RaiseL(23002,$this->name);//('Mark color index too large for marker "'.($this->name).'"');
}
else
$idx = $aIdx ;
return Image::CreateFromString(base64_decode($this->{$n}[$idx][1]));
}
function GetAnchor() {
return array($this->anchor_x,$this->anchor_y);
}
}
// Keep a global flag cache to reduce memory usage
$_gFlagCache=array(
1 => null,
2 => null,
3 => null,
4 => null,
);
// Only supposed to b called as statics
class FlagCache {
static function GetFlagImgByName($aSize,$aName) {
global $_gFlagCache;
require_once('jpgraph_flags.php');
if( $_gFlagCache[$aSize] === null ) {
$_gFlagCache[$aSize] = new FlagImages($aSize);
}
$f = $_gFlagCache[$aSize];
$idx = $f->GetIdxByName($aName,$aFullName);
return $f->GetImgByIdx($idx);
}
}
?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,202 +1,215 @@
<?php
/*=======================================================================
// File: JPGRAPH_REGSTAT.PHP
// Description: Regression and statistical analysis helper classes
// Created: 2002-12-01
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: jpgraph_regstat.php,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// 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
var $xdata,$ydata; // Data vectors
var $y2; // 2:nd derivate of ydata
var $n=0;
function Spline($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://astronomy.swin.edu.au/~pbourke/curves/bezier/
*/
var $datax = array();
var $datay = array();
var $n=0;
function Bezier($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;
}
}
}
function Get($steps) {
$datax = array();
$datay = array();
for ($i = 0; $i < $steps; $i++) {
list($datumx, $datumy) = $this->GetPoint((double) $i / (double) $steps);
$datax[] = $datumx;
$datay[] = $datumy;
}
$datax[] = end($this->datax);
$datay[] = end($this->datay);
return array($datax, $datay);
}
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
?>
<?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) Asial Corporation. 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
?>

@ -0,0 +1,615 @@
<?php
//=======================================================================
// File: JPGRAPH_RGB.INC.PHP
// Description: Class to handle RGb color space specification and
// named colors
// Created: 2001-01-08 (Refactored to separate file 2008-08-01)
// Ver: $Id: jpgraph_rgb.inc.php 1893 2009-10-02 23:15:25Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
/*===================================================
// CLASS RGB
// Description: Color definitions as RGB triples
//===================================================
*/
class RGB {
public $rgb_table;
public $img;
function __construct($aImg=null) {
$this->img = $aImg;
// Conversion array between color names and RGB
$this->rgb_table = array(
'aqua'=> array(0,255,255),
'lime'=> array(0,255,0),
'teal'=> array(0,128,128),
'whitesmoke'=>array(245,245,245),
'gainsboro'=>array(220,220,220),
'oldlace'=>array(253,245,230),
'linen'=>array(250,240,230),
'antiquewhite'=>array(250,235,215),
'papayawhip'=>array(255,239,213),
'blanchedalmond'=>array(255,235,205),
'bisque'=>array(255,228,196),
'peachpuff'=>array(255,218,185),
'navajowhite'=>array(255,222,173),
'moccasin'=>array(255,228,181),
'cornsilk'=>array(255,248,220),
'ivory'=>array(255,255,240),
'lemonchiffon'=>array(255,250,205),
'seashell'=>array(255,245,238),
'mintcream'=>array(245,255,250),
'azure'=>array(240,255,255),
'aliceblue'=>array(240,248,255),
'lavender'=>array(230,230,250),
'lavenderblush'=>array(255,240,245),
'mistyrose'=>array(255,228,225),
'white'=>array(255,255,255),
'black'=>array(0,0,0),
'darkslategray'=>array(47,79,79),
'dimgray'=>array(105,105,105),
'slategray'=>array(112,128,144),
'lightslategray'=>array(119,136,153),
'gray'=>array(190,190,190),
'lightgray'=>array(211,211,211),
'midnightblue'=>array(25,25,112),
'navy'=>array(0,0,128),
'indigo'=>array(75,0,130),
'electricindigo'=>array(102,0,255),
'deepindigo'=>array(138,43,226),
'pigmentindigo'=>array(75,0,130),
'indigodye'=>array(0,65,106),
'cornflowerblue'=>array(100,149,237),
'darkslateblue'=>array(72,61,139),
'slateblue'=>array(106,90,205),
'mediumslateblue'=>array(123,104,238),
'lightslateblue'=>array(132,112,255),
'mediumblue'=>array(0,0,205),
'royalblue'=>array(65,105,225),
'blue'=>array(0,0,255),
'dodgerblue'=>array(30,144,255),
'deepskyblue'=>array(0,191,255),
'skyblue'=>array(135,206,235),
'lightskyblue'=>array(135,206,250),
'steelblue'=>array(70,130,180),
'lightred'=>array(211,167,168),
'lightsteelblue'=>array(176,196,222),
'lightblue'=>array(173,216,230),
'powderblue'=>array(176,224,230),
'paleturquoise'=>array(175,238,238),
'darkturquoise'=>array(0,206,209),
'mediumturquoise'=>array(72,209,204),
'turquoise'=>array(64,224,208),
'cyan'=>array(0,255,255),
'lightcyan'=>array(224,255,255),
'cadetblue'=>array(95,158,160),
'mediumaquamarine'=>array(102,205,170),
'aquamarine'=>array(127,255,212),
'darkgreen'=>array(0,100,0),
'darkolivegreen'=>array(85,107,47),
'darkseagreen'=>array(143,188,143),
'seagreen'=>array(46,139,87),
'mediumseagreen'=>array(60,179,113),
'lightseagreen'=>array(32,178,170),
'palegreen'=>array(152,251,152),
'springgreen'=>array(0,255,127),
'lawngreen'=>array(124,252,0),
'green'=>array(0,255,0),
'chartreuse'=>array(127,255,0),
'mediumspringgreen'=>array(0,250,154),
'greenyellow'=>array(173,255,47),
'limegreen'=>array(50,205,50),
'yellowgreen'=>array(154,205,50),
'forestgreen'=>array(34,139,34),
'olivedrab'=>array(107,142,35),
'darkkhaki'=>array(189,183,107),
'khaki'=>array(240,230,140),
'palegoldenrod'=>array(238,232,170),
'lightgoldenrodyellow'=>array(250,250,210),
'lightyellow'=>array(255,255,200),
'yellow'=>array(255,255,0),
'gold'=>array(255,215,0),
'lightgoldenrod'=>array(238,221,130),
'goldenrod'=>array(218,165,32),
'darkgoldenrod'=>array(184,134,11),
'rosybrown'=>array(188,143,143),
'indianred'=>array(205,92,92),
'saddlebrown'=>array(139,69,19),
'sienna'=>array(160,82,45),
'peru'=>array(205,133,63),
'burlywood'=>array(222,184,135),
'beige'=>array(245,245,220),
'wheat'=>array(245,222,179),
'sandybrown'=>array(244,164,96),
'tan'=>array(210,180,140),
'chocolate'=>array(210,105,30),
'firebrick'=>array(178,34,34),
'brown'=>array(165,42,42),
'darksalmon'=>array(233,150,122),
'salmon'=>array(250,128,114),
'lightsalmon'=>array(255,160,122),
'orange'=>array(255,165,0),
'darkorange'=>array(255,140,0),
'coral'=>array(255,127,80),
'lightcoral'=>array(240,128,128),
'tomato'=>array(255,99,71),
'orangered'=>array(255,69,0),
'red'=>array(255,0,0),
'hotpink'=>array(255,105,180),
'deeppink'=>array(255,20,147),
'pink'=>array(255,192,203),
'lightpink'=>array(255,182,193),
'palevioletred'=>array(219,112,147),
'maroon'=>array(176,48,96),
'mediumvioletred'=>array(199,21,133),
'violetred'=>array(208,32,144),
'magenta'=>array(255,0,255),
'violet'=>array(238,130,238),
'plum'=>array(221,160,221),
'orchid'=>array(218,112,214),
'mediumorchid'=>array(186,85,211),
'darkorchid'=>array(153,50,204),
'darkviolet'=>array(148,0,211),
'blueviolet'=>array(138,43,226),
'purple'=>array(160,32,240),
'mediumpurple'=>array(147,112,219),
'thistle'=>array(216,191,216),
'snow1'=>array(255,250,250),
'snow2'=>array(238,233,233),
'snow3'=>array(205,201,201),
'snow4'=>array(139,137,137),
'seashell1'=>array(255,245,238),
'seashell2'=>array(238,229,222),
'seashell3'=>array(205,197,191),
'seashell4'=>array(139,134,130),
'AntiqueWhite1'=>array(255,239,219),
'AntiqueWhite2'=>array(238,223,204),
'AntiqueWhite3'=>array(205,192,176),
'AntiqueWhite4'=>array(139,131,120),
'bisque1'=>array(255,228,196),
'bisque2'=>array(238,213,183),
'bisque3'=>array(205,183,158),
'bisque4'=>array(139,125,107),
'peachPuff1'=>array(255,218,185),
'peachpuff2'=>array(238,203,173),
'peachpuff3'=>array(205,175,149),
'peachpuff4'=>array(139,119,101),
'navajowhite1'=>array(255,222,173),
'navajowhite2'=>array(238,207,161),
'navajowhite3'=>array(205,179,139),
'navajowhite4'=>array(139,121,94),
'lemonchiffon1'=>array(255,250,205),
'lemonchiffon2'=>array(238,233,191),
'lemonchiffon3'=>array(205,201,165),
'lemonchiffon4'=>array(139,137,112),
'ivory1'=>array(255,255,240),
'ivory2'=>array(238,238,224),
'ivory3'=>array(205,205,193),
'ivory4'=>array(139,139,131),
'honeydew'=>array(193,205,193),
'lavenderblush1'=>array(255,240,245),
'lavenderblush2'=>array(238,224,229),
'lavenderblush3'=>array(205,193,197),
'lavenderblush4'=>array(139,131,134),
'mistyrose1'=>array(255,228,225),
'mistyrose2'=>array(238,213,210),
'mistyrose3'=>array(205,183,181),
'mistyrose4'=>array(139,125,123),
'azure1'=>array(240,255,255),
'azure2'=>array(224,238,238),
'azure3'=>array(193,205,205),
'azure4'=>array(131,139,139),
'slateblue1'=>array(131,111,255),
'slateblue2'=>array(122,103,238),
'slateblue3'=>array(105,89,205),
'slateblue4'=>array(71,60,139),
'royalblue1'=>array(72,118,255),
'royalblue2'=>array(67,110,238),
'royalblue3'=>array(58,95,205),
'royalblue4'=>array(39,64,139),
'dodgerblue1'=>array(30,144,255),
'dodgerblue2'=>array(28,134,238),
'dodgerblue3'=>array(24,116,205),
'dodgerblue4'=>array(16,78,139),
'steelblue1'=>array(99,184,255),
'steelblue2'=>array(92,172,238),
'steelblue3'=>array(79,148,205),
'steelblue4'=>array(54,100,139),
'deepskyblue1'=>array(0,191,255),
'deepskyblue2'=>array(0,178,238),
'deepskyblue3'=>array(0,154,205),
'deepskyblue4'=>array(0,104,139),
'skyblue1'=>array(135,206,255),
'skyblue2'=>array(126,192,238),
'skyblue3'=>array(108,166,205),
'skyblue4'=>array(74,112,139),
'lightskyblue1'=>array(176,226,255),
'lightskyblue2'=>array(164,211,238),
'lightskyblue3'=>array(141,182,205),
'lightskyblue4'=>array(96,123,139),
'slategray1'=>array(198,226,255),
'slategray2'=>array(185,211,238),
'slategray3'=>array(159,182,205),
'slategray4'=>array(108,123,139),
'lightsteelblue1'=>array(202,225,255),
'lightsteelblue2'=>array(188,210,238),
'lightsteelblue3'=>array(162,181,205),
'lightsteelblue4'=>array(110,123,139),
'lightblue1'=>array(191,239,255),
'lightblue2'=>array(178,223,238),
'lightblue3'=>array(154,192,205),
'lightblue4'=>array(104,131,139),
'lightcyan1'=>array(224,255,255),
'lightcyan2'=>array(209,238,238),
'lightcyan3'=>array(180,205,205),
'lightcyan4'=>array(122,139,139),
'paleturquoise1'=>array(187,255,255),
'paleturquoise2'=>array(174,238,238),
'paleturquoise3'=>array(150,205,205),
'paleturquoise4'=>array(102,139,139),
'cadetblue1'=>array(152,245,255),
'cadetblue2'=>array(142,229,238),
'cadetblue3'=>array(122,197,205),
'cadetblue4'=>array(83,134,139),
'turquoise1'=>array(0,245,255),
'turquoise2'=>array(0,229,238),
'turquoise3'=>array(0,197,205),
'turquoise4'=>array(0,134,139),
'cyan1'=>array(0,255,255),
'cyan2'=>array(0,238,238),
'cyan3'=>array(0,205,205),
'cyan4'=>array(0,139,139),
'darkslategray1'=>array(151,255,255),
'darkslategray2'=>array(141,238,238),
'darkslategray3'=>array(121,205,205),
'darkslategray4'=>array(82,139,139),
'aquamarine1'=>array(127,255,212),
'aquamarine2'=>array(118,238,198),
'aquamarine3'=>array(102,205,170),
'aquamarine4'=>array(69,139,116),
'darkseagreen1'=>array(193,255,193),
'darkseagreen2'=>array(180,238,180),
'darkseagreen3'=>array(155,205,155),
'darkseagreen4'=>array(105,139,105),
'seagreen1'=>array(84,255,159),
'seagreen2'=>array(78,238,148),
'seagreen3'=>array(67,205,128),
'seagreen4'=>array(46,139,87),
'palegreen1'=>array(154,255,154),
'palegreen2'=>array(144,238,144),
'palegreen3'=>array(124,205,124),
'palegreen4'=>array(84,139,84),
'springgreen1'=>array(0,255,127),
'springgreen2'=>array(0,238,118),
'springgreen3'=>array(0,205,102),
'springgreen4'=>array(0,139,69),
'chartreuse1'=>array(127,255,0),
'chartreuse2'=>array(118,238,0),
'chartreuse3'=>array(102,205,0),
'chartreuse4'=>array(69,139,0),
'olivedrab1'=>array(192,255,62),
'olivedrab2'=>array(179,238,58),
'olivedrab3'=>array(154,205,50),
'olivedrab4'=>array(105,139,34),
'darkolivegreen1'=>array(202,255,112),
'darkolivegreen2'=>array(188,238,104),
'darkolivegreen3'=>array(162,205,90),
'darkolivegreen4'=>array(110,139,61),
'khaki1'=>array(255,246,143),
'khaki2'=>array(238,230,133),
'khaki3'=>array(205,198,115),
'khaki4'=>array(139,134,78),
'lightgoldenrod1'=>array(255,236,139),
'lightgoldenrod2'=>array(238,220,130),
'lightgoldenrod3'=>array(205,190,112),
'lightgoldenrod4'=>array(139,129,76),
'yellow1'=>array(255,255,0),
'yellow2'=>array(238,238,0),
'yellow3'=>array(205,205,0),
'yellow4'=>array(139,139,0),
'gold1'=>array(255,215,0),
'gold2'=>array(238,201,0),
'gold3'=>array(205,173,0),
'gold4'=>array(139,117,0),
'goldenrod1'=>array(255,193,37),
'goldenrod2'=>array(238,180,34),
'goldenrod3'=>array(205,155,29),
'goldenrod4'=>array(139,105,20),
'darkgoldenrod1'=>array(255,185,15),
'darkgoldenrod2'=>array(238,173,14),
'darkgoldenrod3'=>array(205,149,12),
'darkgoldenrod4'=>array(139,101,8),
'rosybrown1'=>array(255,193,193),
'rosybrown2'=>array(238,180,180),
'rosybrown3'=>array(205,155,155),
'rosybrown4'=>array(139,105,105),
'indianred1'=>array(255,106,106),
'indianred2'=>array(238,99,99),
'indianred3'=>array(205,85,85),
'indianred4'=>array(139,58,58),
'sienna1'=>array(255,130,71),
'sienna2'=>array(238,121,66),
'sienna3'=>array(205,104,57),
'sienna4'=>array(139,71,38),
'burlywood1'=>array(255,211,155),
'burlywood2'=>array(238,197,145),
'burlywood3'=>array(205,170,125),
'burlywood4'=>array(139,115,85),
'wheat1'=>array(255,231,186),
'wheat2'=>array(238,216,174),
'wheat3'=>array(205,186,150),
'wheat4'=>array(139,126,102),
'tan1'=>array(255,165,79),
'tan2'=>array(238,154,73),
'tan3'=>array(205,133,63),
'tan4'=>array(139,90,43),
'chocolate1'=>array(255,127,36),
'chocolate2'=>array(238,118,33),
'chocolate3'=>array(205,102,29),
'chocolate4'=>array(139,69,19),
'firebrick1'=>array(255,48,48),
'firebrick2'=>array(238,44,44),
'firebrick3'=>array(205,38,38),
'firebrick4'=>array(139,26,26),
'brown1'=>array(255,64,64),
'brown2'=>array(238,59,59),
'brown3'=>array(205,51,51),
'brown4'=>array(139,35,35),
'salmon1'=>array(255,140,105),
'salmon2'=>array(238,130,98),
'salmon3'=>array(205,112,84),
'salmon4'=>array(139,76,57),
'lightsalmon1'=>array(255,160,122),
'lightsalmon2'=>array(238,149,114),
'lightsalmon3'=>array(205,129,98),
'lightsalmon4'=>array(139,87,66),
'orange1'=>array(255,165,0),
'orange2'=>array(238,154,0),
'orange3'=>array(205,133,0),
'orange4'=>array(139,90,0),
'darkorange1'=>array(255,127,0),
'darkorange2'=>array(238,118,0),
'darkorange3'=>array(205,102,0),
'darkorange4'=>array(139,69,0),
'coral1'=>array(255,114,86),
'coral2'=>array(238,106,80),
'coral3'=>array(205,91,69),
'coral4'=>array(139,62,47),
'tomato1'=>array(255,99,71),
'tomato2'=>array(238,92,66),
'tomato3'=>array(205,79,57),
'tomato4'=>array(139,54,38),
'orangered1'=>array(255,69,0),
'orangered2'=>array(238,64,0),
'orangered3'=>array(205,55,0),
'orangered4'=>array(139,37,0),
'deeppink1'=>array(255,20,147),
'deeppink2'=>array(238,18,137),
'deeppink3'=>array(205,16,118),
'deeppink4'=>array(139,10,80),
'hotpink1'=>array(255,110,180),
'hotpink2'=>array(238,106,167),
'hotpink3'=>array(205,96,144),
'hotpink4'=>array(139,58,98),
'pink1'=>array(255,181,197),
'pink2'=>array(238,169,184),
'pink3'=>array(205,145,158),
'pink4'=>array(139,99,108),
'lightpink1'=>array(255,174,185),
'lightpink2'=>array(238,162,173),
'lightpink3'=>array(205,140,149),
'lightpink4'=>array(139,95,101),
'palevioletred1'=>array(255,130,171),
'palevioletred2'=>array(238,121,159),
'palevioletred3'=>array(205,104,137),
'palevioletred4'=>array(139,71,93),
'maroon1'=>array(255,52,179),
'maroon2'=>array(238,48,167),
'maroon3'=>array(205,41,144),
'maroon4'=>array(139,28,98),
'violetred1'=>array(255,62,150),
'violetred2'=>array(238,58,140),
'violetred3'=>array(205,50,120),
'violetred4'=>array(139,34,82),
'magenta1'=>array(255,0,255),
'magenta2'=>array(238,0,238),
'magenta3'=>array(205,0,205),
'magenta4'=>array(139,0,139),
'mediumred'=>array(140,34,34),
'orchid1'=>array(255,131,250),
'orchid2'=>array(238,122,233),
'orchid3'=>array(205,105,201),
'orchid4'=>array(139,71,137),
'plum1'=>array(255,187,255),
'plum2'=>array(238,174,238),
'plum3'=>array(205,150,205),
'plum4'=>array(139,102,139),
'mediumorchid1'=>array(224,102,255),
'mediumorchid2'=>array(209,95,238),
'mediumorchid3'=>array(180,82,205),
'mediumorchid4'=>array(122,55,139),
'darkorchid1'=>array(191,62,255),
'darkorchid2'=>array(178,58,238),
'darkorchid3'=>array(154,50,205),
'darkorchid4'=>array(104,34,139),
'purple1'=>array(155,48,255),
'purple2'=>array(145,44,238),
'purple3'=>array(125,38,205),
'purple4'=>array(85,26,139),
'mediumpurple1'=>array(171,130,255),
'mediumpurple2'=>array(159,121,238),
'mediumpurple3'=>array(137,104,205),
'mediumpurple4'=>array(93,71,139),
'thistle1'=>array(255,225,255),
'thistle2'=>array(238,210,238),
'thistle3'=>array(205,181,205),
'thistle4'=>array(139,123,139),
'gray1'=>array(10,10,10),
'gray2'=>array(40,40,30),
'gray3'=>array(70,70,70),
'gray4'=>array(100,100,100),
'gray5'=>array(130,130,130),
'gray6'=>array(160,160,160),
'gray7'=>array(190,190,190),
'gray8'=>array(210,210,210),
'gray9'=>array(240,240,240),
'darkgray'=>array(100,100,100),
'darkblue'=>array(0,0,139),
'darkcyan'=>array(0,139,139),
'darkmagenta'=>array(139,0,139),
'darkred'=>array(139,0,0),
'silver'=>array(192, 192, 192),
'eggplant'=>array(144,176,168),
'lightgreen'=>array(144,238,144));
}
//----------------
// PUBLIC METHODS
// Colors can be specified as either
// 1. #xxxxxx HTML style
// 2. "colorname" as a named color
// 3. array(r,g,b) RGB triple
// This function translates this to a native RGB format and returns an
// RGB triple.
function Color($aColor) {
if (is_string($aColor)) {
$matches = array();
// this regex will parse a color string and fill the $matches array as such:
// 0: the full match if any
// 1: a hex string preceded by a hash, can be 3 characters (#fff) or 6 (#ffffff) (4 or 5 also accepted but...)
// 2,3,4: r,g,b values in hex if the first character of the string is #
// 5: all alpha-numeric characters at the beginning of the string if string does not start with #
// 6: alpha value prefixed by @ if supplied
// 7: alpha value with @ stripped
// 8: adjust value prefixed with : if supplied
// 9: adjust value with : stripped
$regex = '/(#([0-9a-fA-F]{1,2})([0-9a-fA-F]{1,2})([0-9a-fA-F]{1,2}))?([\w]+)?(@([\d\.,]+))?(:([\d\.,]+))?/';
if(!preg_match($regex, $aColor, $matches)) {
JpGraphError::RaiseL(25078,$aColor);//(" Unknown color: $aColor");
}
if(empty($matches[5])) {
$r = strlen($matches[2]) == 1 ? $matches[2].$matches[2] : $matches[2];
$g = strlen($matches[3]) == 1 ? $matches[3].$matches[3] : $matches[3];
$b = strlen($matches[4]) == 1 ? $matches[4].$matches[4] : $matches[4];
$r = hexdec($r);
$g = hexdec($g);
$b = hexdec($b);
}else {
if(!isset($this->rgb_table[$matches[5]]) ) {
JpGraphError::RaiseL(25078,$aColor);//(" Unknown color: $aColor");
}
$r = $this->rgb_table[$matches[5]][0];
$g = $this->rgb_table[$matches[5]][1];
$b = $this->rgb_table[$matches[5]][2];
}
$alpha = isset($matches[7]) ? str_replace(',','.',$matches[7]) : 0;
$adj = isset($matches[9]) ? str_replace(',','.',$matches[9]) : 1.0;
if( $adj < 0 ) {
JpGraphError::RaiseL(25077);//('Adjustment factor for color must be > 0');
}
// Scale adj so that an adj=2 always
// makes the color 100% white (i.e. 255,255,255.
// and adj=1 neutral and adj=0 black.
if( $adj == 1) {
return array($r,$g,$b,$alpha);
}
elseif( $adj > 1 ) {
$m = ($adj-1.0)*(255-min(255,min($r,min($g,$b))));
return array(min(255,$r+$m), min(255,$g+$m), min(255,$b+$m),$alpha);
}
elseif( $adj < 1 ) {
$m = ($adj-1.0)*max(255,max($r,max($g,$b)));
return array(max(0,$r+$m), max(0,$g+$m), max(0,$b+$m),$alpha);
}
} elseif( is_array($aColor) ) {
if(!isset($aColor[3])) $aColor[3] = 0;
return $aColor;
}
else {
JpGraphError::RaiseL(25079,$aColor,count($aColor));//(" Unknown color specification: $aColor , size=".count($aColor));
}
}
// Compare two colors
// return true if equal
function Equal($aCol1,$aCol2) {
$c1 = $this->Color($aCol1);
$c2 = $this->Color($aCol2);
return $c1[0]==$c2[0] && $c1[1]==$c2[1] && $c1[2]==$c2[2] ;
}
// Allocate a new color in the current image
// Return new color index, -1 if no more colors could be allocated
function Allocate($aColor,$aAlpha=0.0) {
list ($r, $g, $b, $a) = $this->color($aColor);
// If alpha is specified in the color string then this
// takes precedence over the second argument
if( $a > 0 ) {
$aAlpha = $a;
}
if( $aAlpha < 0 || $aAlpha > 1 ) {
JpGraphError::RaiseL(25080);//('Alpha parameter for color must be between 0.0 and 1.0');
}
return imagecolorresolvealpha($this->img, $r, $g, $b, round($aAlpha * 127));
}
// Try to convert an array with three valid numbers to the corresponding hex array
// This is currenly only used in processing the colors for barplots in order to be able
// to handle the case where the color might be specified as an array of colros as well.
// In that case we must be able to find out if an array of values should be interpretated as
// a single color (specifeid as an RGB triple)
static function tryHexConversion($aColor) {
if( is_array( $aColor ) ) {
if( count( $aColor ) == 3 ) {
if( is_numeric($aColor[0]) && is_numeric($aColor[1]) && is_numeric($aColor[2]) ) {
if( ($aColor[0] >= 0 && $aColor[0] <= 255) &&
($aColor[1] >= 0 && $aColor[1] <= 255) &&
($aColor[2] >= 0 && $aColor[2] <= 255) ) {
return sprintf('#%02x%02x%02x',$aColor[0],$aColor[1],$aColor[2]);
}
}
}
}
return $aColor;
}
// Return a RGB tripple corresponding to a position in the normal light spectrum
// The argumen values is in the range [0, 1] where a value of 0 correponds to blue and
// a value of 1 corresponds to red. Values in betwen is mapped to a linear interpolation
// of the constituting colors in the visible color spectra.
// The $aDynamicRange specified how much of the dynamic range we shold use
// a value of 1.0 give the full dyanmic range and a lower value give more dark
// colors. In the extreme of 0.0 then all colors will be black.
static function GetSpectrum($aVal,$aDynamicRange=1.0) {
if( $aVal < 0 || $aVal > 1.0001 ) {
return array(0,0,0); // Invalid case - just return black
}
$sat = round(255*$aDynamicRange);
$a = 0.25;
if( $aVal <= 0.25 ) {
return array(0, round($sat*$aVal/$a), $sat);
}
elseif( $aVal <= 0.5 ) {
return array(0, $sat, round($sat-$sat*($aVal-0.25)/$a));
}
elseif( $aVal <= 0.75 ) {
return array(round($sat*($aVal-0.5)/$a), $sat, 0);
}
else {
return array($sat, round($sat-$sat*($aVal-0.75)/$a), 0);
}
}
} // Class
?>

@ -1,225 +1,242 @@
<?php
/*=======================================================================
// File: JPGRAPH_SCATTER.PHP
// Description: Scatter (and impuls) plot extension for JpGraph
// Created: 2001-02-11
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: jpgraph_scatter.php,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
require_once ('jpgraph_plotmark.inc');
//===================================================
// CLASS FieldArrow
// Description: Draw an arrow at (x,y) with angle a
//===================================================
class FieldArrow {
var $iSize=10; // Length in pixels for arrow
var $iArrowSize = 2;
var $iColor='black';
var $isizespec = array(
array(2,1),array(3,2),array(4,3),array(6,4),array(7,4),array(8,5),array(10,6),array(12,7),array(16,8),array(20,10));
function FieldArrow() {
}
function SetSize($aSize,$aArrowSize=2) {
$this->iSize = $aSize;
$this->iArrowSize = $aArrowSize;
}
function SetColor($aColor) {
$this->iColor = $aColor;
}
function Stroke(&$aImg,$x,$y,$a) {
// First rotate the center coordinates
list($x,$y) = $aImg->Rotate($x,$y);
$old_origin = $aImg->SetCenter($x,$y);
$old_a = $aImg->a;
$aImg->SetAngle(-$a+$old_a);
$dx = round($this->iSize/2);
$c = array($x-$dx,$y,$x+$dx,$y);
$x += $dx;
list($dx,$dy) = $this->isizespec[$this->iArrowSize];
$ca = array($x,$y,$x-$dx,$y-$dy,$x-$dx,$y+$dy,$x,$y);
$aImg->SetColor($this->iColor);
$aImg->Polygon($c);
$aImg->FilledPolygon($ca);
$aImg->SetCenter($old_origin[0],$old_origin[1]);
$aImg->SetAngle($old_a);
}
}
//===================================================
// CLASS FieldPlot
// Description: Render a field plot
//===================================================
class FieldPlot extends Plot {
var $iAngles;
var $iCallback='';
function FieldPlot($datay,$datax,$angles) {
if( (count($datax) != count($datay)) )
JpGraphError::RaiseL(20001);//("Fieldplots must have equal number of X and Y points.");
if( (count($datax) != count($angles)) )
JpGraphError::RaiseL(20002);//("Fieldplots must have an angle specified for each X and Y points.");
$this->iAngles = $angles;
$this->Plot($datay,$datax);
$this->value->SetAlign('center','center');
$this->value->SetMargin(15);
$this->arrow = new FieldArrow();
}
function SetCallback($aFunc) {
$this->iCallback = $aFunc;
}
function Stroke(&$img,&$xscale,&$yscale) {
// Remeber base color and size
$bc = $this->arrow->iColor;
$bs = $this->arrow->iSize;
$bas = $this->arrow->iArrowSize;
for( $i=0; $i<$this->numpoints; ++$i ) {
// Skip null values
if( $this->coords[0][$i]==="" )
continue;
$f = $this->iCallback;
if( $f != "" ) {
list($cc,$cs,$cas) = call_user_func($f,$this->coords[1][$i],$this->coords[0][$i],$this->iAngles[$i]);
// Fall back on global data if the callback isn't set
if( $cc == "" ) $cc = $bc;
if( $cs == "" ) $cs = $bs;
if( $cas == "" ) $cas = $bas;
//echo "f=$f, cc=$cc, cs=$cs, cas=$cas<br>";
$this->arrow->SetColor($cc);
$this->arrow->SetSize($cs,$cas);
}
$xt = $xscale->Translate($this->coords[1][$i]);
$yt = $yscale->Translate($this->coords[0][$i]);
$this->arrow->Stroke($img,$xt,$yt,$this->iAngles[$i]);
$this->value->Stroke($img,$this->coords[0][$i],$xt,$yt);
}
}
// Framework function
function Legend(&$aGraph) {
if( $this->legend != "" ) {
$aGraph->legend->Add($this->legend,$this->mark->fill_color,$this->mark,0,
$this->legendcsimtarget,$this->legendcsimalt);
}
}
}
//===================================================
// CLASS ScatterPlot
// Description: Render X and Y plots
//===================================================
class ScatterPlot extends Plot {
var $impuls = false;
var $linkpoints = false, $linkpointweight=1, $linkpointcolor="black";
//---------------
// CONSTRUCTOR
function ScatterPlot($datay,$datax=false) {
if( (count($datax) != count($datay)) && is_array($datax))
JpGraphError::RaiseL(20003);//("Scatterplot must have equal number of X and Y points.");
$this->Plot($datay,$datax);
$this->mark = new PlotMark();
$this->mark->SetType(MARK_SQUARE);
$this->mark->SetColor($this->color);
$this->value->SetAlign('center','center');
$this->value->SetMargin(0);
}
//---------------
// PUBLIC METHODS
function SetImpuls($f=true) {
$this->impuls = $f;
}
// Combine the scatter plot points with a line
function SetLinkPoints($aFlag=true,$aColor="black",$aWeight=1) {
$this->linkpoints=$aFlag;
$this->linkpointcolor=$aColor;
$this->linkpointweight=$aWeight;
}
function Stroke(&$img,&$xscale,&$yscale) {
$ymin=$yscale->scale_abs[0];
if( $yscale->scale[0] < 0 )
$yzero=$yscale->Translate(0);
else
$yzero=$yscale->scale_abs[0];
$this->csimareas = '';
for( $i=0; $i<$this->numpoints; ++$i ) {
// Skip null values
if( $this->coords[0][$i]==="" || $this->coords[0][$i]==='-' || $this->coords[0][$i]==='x')
continue;
if( isset($this->coords[1]) )
$xt = $xscale->Translate($this->coords[1][$i]);
else
$xt = $xscale->Translate($i);
$yt = $yscale->Translate($this->coords[0][$i]);
if( $this->linkpoints && isset($yt_old) ) {
$img->SetColor($this->linkpointcolor);
$img->SetLineWeight($this->linkpointweight);
$img->Line($xt_old,$yt_old,$xt,$yt);
}
if( $this->impuls ) {
$img->SetColor($this->color);
$img->SetLineWeight($this->weight);
$img->Line($xt,$yzero,$xt,$yt);
}
if( !empty($this->csimtargets[$i]) ) {
$this->mark->SetCSIMTarget($this->csimtargets[$i]);
$this->mark->SetCSIMAlt($this->csimalts[$i]);
}
if( isset($this->coords[1]) ) {
$this->mark->SetCSIMAltVal($this->coords[0][$i],$this->coords[1][$i]);
}
else {
$this->mark->SetCSIMAltVal($this->coords[0][$i],$i);
}
$this->mark->Stroke($img,$xt,$yt);
$this->csimareas .= $this->mark->GetCSIMAreas();
$this->value->Stroke($img,$this->coords[0][$i],$xt,$yt);
$xt_old = $xt;
$yt_old = $yt;
}
}
// Framework function
function Legend(&$aGraph) {
if( $this->legend != "" ) {
$aGraph->legend->Add($this->legend,$this->mark->fill_color,$this->mark,0,
$this->legendcsimtarget,$this->legendcsimalt);
}
}
} // Class
/* EOF */
?>
<?php
/*=======================================================================
// File: JPGRAPH_SCATTER.PHP
// Description: Scatter (and impuls) plot extension for JpGraph
// Created: 2001-02-11
// Ver: $Id: jpgraph_scatter.php 1397 2009-06-27 21:34:14Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
*/
require_once ('jpgraph_plotmark.inc.php');
//===================================================
// CLASS FieldArrow
// Description: Draw an arrow at (x,y) with angle a
//===================================================
class FieldArrow {
public $iColor='black';
public $iSize=10; // Length in pixels for arrow
public $iArrowSize = 2;
private $isizespec = array(
array(2,1),array(3,2),array(4,3),array(6,4),array(7,4),array(8,5),array(10,6),array(12,7),array(16,8),array(20,10)
);
function __construct() {
// Empty
}
function SetSize($aSize,$aArrowSize=2) {
$this->iSize = $aSize;
$this->iArrowSize = $aArrowSize;
}
function SetColor($aColor) {
$this->iColor = $aColor;
}
function Stroke($aImg,$x,$y,$a) {
// First rotate the center coordinates
list($x,$y) = $aImg->Rotate($x,$y);
$old_origin = $aImg->SetCenter($x,$y);
$old_a = $aImg->a;
$aImg->SetAngle(-$a+$old_a);
$dx = round($this->iSize/2);
$c = array($x-$dx,$y,$x+$dx,$y);
$x += $dx;
list($dx,$dy) = $this->isizespec[$this->iArrowSize];
$ca = array($x,$y,$x-$dx,$y-$dy,$x-$dx,$y+$dy,$x,$y);
$aImg->SetColor($this->iColor);
$aImg->Polygon($c);
$aImg->FilledPolygon($ca);
$aImg->SetCenter($old_origin[0],$old_origin[1]);
$aImg->SetAngle($old_a);
}
}
//===================================================
// CLASS FieldPlot
// Description: Render a field plot
//===================================================
class FieldPlot extends Plot {
public $arrow = '';
private $iAngles = array();
private $iCallback = '';
function __construct($datay,$datax,$angles) {
if( (count($datax) != count($datay)) )
JpGraphError::RaiseL(20001);//("Fieldplots must have equal number of X and Y points.");
if( (count($datax) != count($angles)) )
JpGraphError::RaiseL(20002);//("Fieldplots must have an angle specified for each X and Y points.");
$this->iAngles = $angles;
parent::__construct($datay,$datax);
$this->value->SetAlign('center','center');
$this->value->SetMargin(15);
$this->arrow = new FieldArrow();
}
function SetCallback($aFunc) {
$this->iCallback = $aFunc;
}
function Stroke($img,$xscale,$yscale) {
// Remeber base color and size
$bc = $this->arrow->iColor;
$bs = $this->arrow->iSize;
$bas = $this->arrow->iArrowSize;
for( $i=0; $i<$this->numpoints; ++$i ) {
// Skip null values
if( $this->coords[0][$i]==="" )
continue;
$f = $this->iCallback;
if( $f != "" ) {
list($cc,$cs,$cas) = call_user_func($f,$this->coords[1][$i],$this->coords[0][$i],$this->iAngles[$i]);
// Fall back on global data if the callback isn't set
if( $cc == "" ) $cc = $bc;
if( $cs == "" ) $cs = $bs;
if( $cas == "" ) $cas = $bas;
$this->arrow->SetColor($cc);
$this->arrow->SetSize($cs,$cas);
}
$xt = $xscale->Translate($this->coords[1][$i]);
$yt = $yscale->Translate($this->coords[0][$i]);
$this->arrow->Stroke($img,$xt,$yt,$this->iAngles[$i]);
$this->value->Stroke($img,$this->coords[0][$i],$xt,$yt);
}
}
// Framework function
function Legend($aGraph) {
if( $this->legend != "" ) {
$aGraph->legend->Add($this->legend,$this->mark->fill_color,$this->mark,0,
$this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget);
}
}
}
//===================================================
// CLASS ScatterPlot
// Description: Render X and Y plots
//===================================================
class ScatterPlot extends Plot {
public $mark,$link;
private $impuls = false;
//---------------
// CONSTRUCTOR
function __construct($datay,$datax=false) {
if( is_array($datax) && (count($datax) != count($datay)) ) {
JpGraphError::RaiseL(20003);//("Scatterplot must have equal number of X and Y points.");
}
parent::__construct($datay,$datax);
$this->mark = new PlotMark();
$this->mark->SetType(MARK_SQUARE);
$this->mark->SetColor($this->color);
$this->value->SetAlign('center','center');
$this->value->SetMargin(0);
$this->link = new LineProperty(1,'black','solid');
$this->link->iShow = false;
}
//---------------
// PUBLIC METHODS
function SetImpuls($f=true) {
$this->impuls = $f;
}
function SetStem($f=true) {
$this->impuls = $f;
}
// Combine the scatter plot points with a line
function SetLinkPoints($aFlag=true,$aColor="black",$aWeight=1,$aStyle='solid') {
$this->link->iShow = $aFlag;
$this->link->iColor = $aColor;
$this->link->iWeight = $aWeight;
$this->link->iStyle = $aStyle;
}
function Stroke($img,$xscale,$yscale) {
$ymin=$yscale->scale_abs[0];
if( $yscale->scale[0] < 0 )
$yzero=$yscale->Translate(0);
else
$yzero=$yscale->scale_abs[0];
$this->csimareas = '';
for( $i=0; $i<$this->numpoints; ++$i ) {
// Skip null values
if( $this->coords[0][$i]==='' || $this->coords[0][$i]==='-' || $this->coords[0][$i]==='x')
continue;
if( isset($this->coords[1]) )
$xt = $xscale->Translate($this->coords[1][$i]);
else
$xt = $xscale->Translate($i);
$yt = $yscale->Translate($this->coords[0][$i]);
if( $this->link->iShow && isset($yt_old) ) {
$img->SetColor($this->link->iColor);
$img->SetLineWeight($this->link->iWeight);
$old = $img->SetLineStyle($this->link->iStyle);
$img->StyleLine($xt_old,$yt_old,$xt,$yt);
$img->SetLineStyle($old);
}
if( $this->impuls ) {
$img->SetColor($this->color);
$img->SetLineWeight($this->weight);
$img->Line($xt,$yzero,$xt,$yt);
}
if( !empty($this->csimtargets[$i]) ) {
if( !empty($this->csimwintargets[$i]) ) {
$this->mark->SetCSIMTarget($this->csimtargets[$i],$this->csimwintargets[$i]);
}
else {
$this->mark->SetCSIMTarget($this->csimtargets[$i]);
}
$this->mark->SetCSIMAlt($this->csimalts[$i]);
}
if( isset($this->coords[1]) ) {
$this->mark->SetCSIMAltVal($this->coords[0][$i],$this->coords[1][$i]);
}
else {
$this->mark->SetCSIMAltVal($this->coords[0][$i],$i);
}
$this->mark->Stroke($img,$xt,$yt);
$this->csimareas .= $this->mark->GetCSIMAreas();
$this->value->Stroke($img,$this->coords[0][$i],$xt,$yt);
$xt_old = $xt;
$yt_old = $yt;
}
}
// Framework function
function Legend($aGraph) {
if( $this->legend != "" ) {
$aGraph->legend->Add($this->legend,$this->mark->fill_color,$this->mark,0,
$this->legendcsimtarget,$this->legendcsimalt,$this->legendcsimwintarget);
}
}
} // Class
/* EOF */
?>

@ -1,183 +1,198 @@
<?php
/*=======================================================================
// File: JPGRAPH_STOCK.PHP
// Description: Stock plot extension for JpGraph
// Created: 2003-01-27
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: jpgraph_stock.php,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
//===================================================
// CLASS StockPlot
//===================================================
class StockPlot extends Plot {
var $iTupleSize = 4;
var $iWidth=9;
var $iEndLines=1;
var $iStockColor1='white',$iStockColor2='darkred',$iStockColor3='darkred';
//---------------
// CONSTRUCTOR
function StockPlot(&$datay,$datax=false) {
if( count($datay) % $this->iTupleSize ) {
JpGraphError::RaiseL(21001,$this->iTupleSize);//('Data values for Stock charts must contain an even multiple of '.$this->iTupleSize.' data points.');
}
$this->Plot($datay,$datax);
$this->numpoints /= $this->iTupleSize;
}
//---------------
// PUBLIC METHODS
function SetColor($aColor,$aColor1='white',$aColor2='darkred',$aColor3='darkred') {
$this->color = $aColor;
$this->iStockColor1 = $aColor1;
$this->iStockColor2 = $aColor2;
$this->iStockColor3 = $aColor3;
}
function SetWidth($aWidth) {
// Make sure it's odd
$this->iWidth = 2*floor($aWidth/2)+1;
}
function HideEndLines($aHide=true) {
$this->iEndLines = !$aHide;
}
// Gets called before any axis are stroked
function PreStrokeAdjust(&$graph) {
if( $this->center ) {
$a=0.5; $b=0.5;
$this->numpoints++;
} else {
$a=0; $b=0;
}
$graph->xaxis->scale->ticks->SetXLabelOffset($a);
$graph->SetTextScaleOff($b);
}
// Stroke stock plot
function Stroke(&$img,$xscale,$yscale) {
$n=$this->numpoints;
if( $this->center ) $n--;
if( isset($this->coords[1]) ) {
if( count($this->coords[1])!=$n )
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;
if( $exist_x )
$xs=$this->coords[1][0];
else
$xs=0;
$ts = $this->iTupleSize;
$this->csimareas = '';
for( $i=0; $i<$n; ++$i) {
//If value is NULL, then don't draw a bar at all
if ($this->coords[0][$i] === null) continue;
if( $exist_x ) $x=$this->coords[1][$i];
else $x=$i;
$xt = $xscale->Translate($x);
$neg = $this->coords[0][$i*$ts] > $this->coords[0][$i*$ts+1] ;
$yopen = $yscale->Translate($this->coords[0][$i*$ts]);
$yclose = $yscale->Translate($this->coords[0][$i*$ts+1]);
$ymin = $yscale->Translate($this->coords[0][$i*$ts+2]);
$ymax = $yscale->Translate($this->coords[0][$i*$ts+3]);
$dx = floor($this->iWidth/2);
$xl = $xt - $dx;
$xr = $xt + $dx;
if( $neg )
$img->SetColor($this->iStockColor3);
else
$img->SetColor($this->iStockColor1);
$img->FilledRectangle($xl,$yopen,$xr,$yclose);
$img->SetLineWeight($this->weight);
if( $neg )
$img->SetColor($this->iStockColor2);
else
$img->SetColor($this->color);
$img->Rectangle($xl,$yopen,$xr,$yclose);
if( $yopen < $yclose ) {
$ytop = $yopen ;
$ybottom = $yclose ;
}
else {
$ytop = $yclose ;
$ybottom = $yopen ;
}
$img->SetColor($this->color);
$img->Line($xt,$ytop,$xt,$ymax);
$img->Line($xt,$ybottom,$xt,$ymin);
if( $this->iEndLines ) {
$img->Line($xl,$ymax,$xr,$ymax);
$img->Line($xl,$ymin,$xr,$ymin);
}
// A chance for subclasses to add things to the bar
// for data point i
$this->ModBox($img,$xscale,$yscale,$i,$xl,$xr,$neg);
// Setup image maps
if( !empty($this->csimtargets[$i]) ) {
$this->csimareas.= '<area shape="rect" coords="'.
round($xl).','.round($ytop).','.
round($xr).','.round($ybottom).'" ';
$this->csimareas .= ' href="'.$this->csimtargets[$i].'"';
if( !empty($this->csimalts[$i]) ) {
$sval=$this->csimalts[$i];
$this->csimareas .= " title=\"$sval\" ";
}
$this->csimareas.= " alt=\"$sval\" />\n";
}
}
return true;
}
// A hook for subclasses to modify the plot
function ModBox($img,$xscale,$yscale,$i,$xl,$xr,$neg) {}
} // Class
//===================================================
// CLASS BoxPlot
//===================================================
class BoxPlot extends StockPlot {
var $iPColor='black',$iNColor='white';
function BoxPlot($datay,$datax=false) {
$this->iTupleSize=5;
parent::StockPlot($datay,$datax);
}
function SetMedianColor($aPos,$aNeg) {
$this->iPColor = $aPos;
$this->iNColor = $aNeg;
}
function ModBox(&$img,$xscale,$yscale,$i,$xl,$xr,$neg) {
if( $neg )
$img->SetColor($this->iNColor);
else
$img->SetColor($this->iPColor);
$y = $yscale->Translate($this->coords[0][$i*5+4]);
$img->Line($xl,$y,$xr,$y);
}
}
/* EOF */
?>
<?php
/*=======================================================================
// File: JPGRAPH_STOCK.PHP
// Description: Stock plot extension for JpGraph
// Created: 2003-01-27
// Ver: $Id: jpgraph_stock.php 1364 2009-06-24 07:07:44Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
*/
//===================================================
// CLASS StockPlot
//===================================================
class StockPlot extends Plot {
protected $iTupleSize = 4;
private $iWidth=9;
private $iEndLines=1;
private $iStockColor1='white',$iStockColor2='darkred',$iStockColor3='darkred';
//---------------
// CONSTRUCTOR
function __construct($datay,$datax=false) {
if( count($datay) % $this->iTupleSize ) {
JpGraphError::RaiseL(21001,$this->iTupleSize);
//('Data values for Stock charts must contain an even multiple of '.$this->iTupleSize.' data points.');
}
parent::__construct($datay,$datax);
$this->numpoints /= $this->iTupleSize;
}
//---------------
// PUBLIC METHODS
function SetColor($aColor,$aColor1='white',$aColor2='darkred',$aColor3='darkred') {
$this->color = $aColor;
$this->iStockColor1 = $aColor1;
$this->iStockColor2 = $aColor2;
$this->iStockColor3 = $aColor3;
}
function SetWidth($aWidth) {
// Make sure it's odd
$this->iWidth = 2*floor($aWidth/2)+1;
}
function HideEndLines($aHide=true) {
$this->iEndLines = !$aHide;
}
// Gets called before any axis are stroked
function PreStrokeAdjust($graph) {
if( $this->center ) {
$a=0.5; $b=0.5;
$this->numpoints++;
} else {
$a=0; $b=0;
}
$graph->xaxis->scale->ticks->SetXLabelOffset($a);
$graph->SetTextScaleOff($b);
}
// Method description
function Stroke($img,$xscale,$yscale) {
$n=$this->numpoints;
if( $this->center ) $n--;
if( isset($this->coords[1]) ) {
if( count($this->coords[1])!=$n ) {
JpGraphError::RaiseL(2003,count($this->coords[1]),$n);
// ("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;
}
if( $exist_x ) {
$xs=$this->coords[1][0];
}
else {
$xs=0;
}
$ts = $this->iTupleSize;
$this->csimareas = '';
for( $i=0; $i<$n; ++$i) {
//If value is NULL, then don't draw a bar at all
if ($this->coords[0][$i*$ts] === null) continue;
if( $exist_x ) {
$x=$this->coords[1][$i];
if ($x === null) continue;
}
else {
$x=$i;
}
$xt = $xscale->Translate($x);
$neg = $this->coords[0][$i*$ts] > $this->coords[0][$i*$ts+1] ;
$yopen = $yscale->Translate($this->coords[0][$i*$ts]);
$yclose = $yscale->Translate($this->coords[0][$i*$ts+1]);
$ymin = $yscale->Translate($this->coords[0][$i*$ts+2]);
$ymax = $yscale->Translate($this->coords[0][$i*$ts+3]);
$dx = floor($this->iWidth/2);
$xl = $xt - $dx;
$xr = $xt + $dx;
if( $neg ) {
$img->SetColor($this->iStockColor3);
}
else {
$img->SetColor($this->iStockColor1);
}
$img->FilledRectangle($xl,$yopen,$xr,$yclose);
$img->SetLineWeight($this->weight);
if( $neg ) {
$img->SetColor($this->iStockColor2);
}
else {
$img->SetColor($this->color);
}
$img->Rectangle($xl,$yopen,$xr,$yclose);
if( $yopen < $yclose ) {
$ytop = $yopen ;
$ybottom = $yclose ;
}
else {
$ytop = $yclose ;
$ybottom = $yopen ;
}
$img->SetColor($this->color);
$img->Line($xt,$ytop,$xt,$ymax);
$img->Line($xt,$ybottom,$xt,$ymin);
if( $this->iEndLines ) {
$img->Line($xl,$ymax,$xr,$ymax);
$img->Line($xl,$ymin,$xr,$ymin);
}
// A chance for subclasses to add things to the bar
// for data point i
$this->ModBox($img,$xscale,$yscale,$i,$xl,$xr,$neg);
// Setup image maps
if( !empty($this->csimtargets[$i]) ) {
$this->csimareas.= '<area shape="rect" coords="'.
round($xl).','.round($ytop).','.
round($xr).','.round($ybottom).'" ';
$this->csimareas .= ' href="'.$this->csimtargets[$i].'"';
if( !empty($this->csimalts[$i]) ) {
$sval=$this->csimalts[$i];
$this->csimareas .= " title=\"$sval\" alt=\"$sval\" ";
}
$this->csimareas.= " />\n";
}
}
return true;
}
// A hook for subclasses to modify the plot
function ModBox($img,$xscale,$yscale,$i,$xl,$xr,$neg) {}
} // Class
//===================================================
// CLASS BoxPlot
//===================================================
class BoxPlot extends StockPlot {
private $iPColor='black',$iNColor='white';
function __construct($datay,$datax=false) {
$this->iTupleSize=5;
parent::__construct($datay,$datax);
}
function SetMedianColor($aPos,$aNeg) {
$this->iPColor = $aPos;
$this->iNColor = $aNeg;
}
function ModBox($img,$xscale,$yscale,$i,$xl,$xr,$neg) {
if( $neg )
$img->SetColor($this->iNColor);
else
$img->SetColor($this->iPColor);
$y = $yscale->Translate($this->coords[0][$i*5+4]);
$img->Line($xl,$y,$xr,$y);
}
}
/* EOF */
?>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,327 @@
<?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) Asial Corporation. All rights reserved.
//========================================================================
//===================================================
// CLASS Text
// Description: Arbitrary text object that can be added to the graph
//===================================================
class Text {
public $t;
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_DEFAULT,$font_style=FS_NORMAL; // old. FF_FONT1
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
// for __get, __set
private $_margin;
private $_font_size=8; // old. 12
//---------------
// 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->raw_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->raw_font_size);
$h = $aImg->GetFontHeight();
return $h;
}
function GetTextHeight($aImg) {
$aImg->SetFont($this->font_family,$this->font_style,$this->raw_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->raw_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->raw_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);
}
function __get($name) {
if (strpos($name, 'raw_') !== false) {
// if $name == 'raw_left_margin' , return $this->_left_margin;
$variable_name = '_' . str_replace('raw_', '', $name);
return $this->$variable_name;
}
$variable_name = '_' . $name;
if (isset($this->$variable_name)) {
return $this->$variable_name * SUPERSAMPLING_SCALE;
} else {
JpGraphError::RaiseL('25132', $name);
}
}
function __set($name, $value) {
$this->{'_'.$name} = $value;
}
} // Class
?>

@ -0,0 +1,136 @@
<?php
//=======================================================================
// File: JPGRAPH_THEME.INC.PHP
// Description: Class to define graph theme
// Created: 2010-09-29
// Ver: $Id: jpgraph_theme.inc.php 83 2010-10-01 11:24:19Z atsushi $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
// include Theme classes
foreach (glob(dirname(__FILE__) . '/themes/*.php') as $theme_class_script) {
require_once($theme_class_script);
}
//===================================================
// CLASS
// Description:
//===================================================
abstract class Theme {
protected $color_index;
function __construct() {
$this->color_index = 0;
}
/**
*
*/
abstract function GetColorList();
/**
*
*/
abstract function ApplyPlot($plot);
/**
*
*/
function SetupPlot($plot) {
if (is_array($plot)) {
foreach ($plot as $obj) {
$this->ApplyPlot($obj);
}
} else {
$this->ApplyPlot($plot);
}
}
/**
*
*/
function ApplyGraph($graph) {
$this->graph = $graph;
$method_name = '';
if (get_class($graph) == 'Graph') {
$method_name = 'SetupGraph';
} else {
$method_name = 'Setup' . get_class($graph);
}
if (method_exists($this, $method_name)) {
$this->$method_name($graph);
} else {
JpGraphError::RaiseL(30001, $method_name, $method_name); //Theme::%s() is not defined. \nPlease make %s(\$graph) function in your theme classs.
}
}
/**
*
*/
function PreStrokeApply($graph) {
}
/**
*
*/
function GetThemeColors($num = 30) {
$result_list = array();
$old_index = $this->color_index;
$this->color_index = 0;
$count = 0;
$i = 0;
while (true) {
for ($j = 0; $j < count($this->GetColorList()); $j++) {
if (++$count > $num) {
break 2;
}
$result_list[] = $this->GetNextColor();
}
$i++;
}
$this->color_index = $old_index;
return $result_list;
}
/**
*
*/
function GetNextColor() {
$color_list = $this->GetColorList();
$color = null;
if (isset($color_list[$this->color_index])) {
$color = $color_list[$this->color_index];
} else {
$color_count = count($color_list);
if ($color_count <= $this->color_index) {
$color_tmp = $color_list[$this->color_index % $color_count];
$brightness = 1.0 - intval($this->color_index / $color_count) * 0.2;
$rgb = new RGB();
$color = $color_tmp . ':' . $brightness;
$color = $rgb->Color($color);
$alpha = array_pop($color);
$color = $rgb->tryHexConversion($color);
if ($alpha) {
$color .= '@' . $alpha;
}
}
}
$this->color_index++;
return $color;
}
} // Class
?>

@ -0,0 +1,631 @@
<?php
//=======================================================================
// File: jpgraph_ttf.inc.php
// Description: Handling of TTF fonts
// Created: 2006-11-19
// Ver: $Id: jpgraph_ttf.inc.php 1858 2009-09-28 14:39:51Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
// TTF Font families
define("FF_COURIER",10);
define("FF_VERDANA",11);
define("FF_TIMES",12);
define("FF_COMIC",14);
define("FF_ARIAL",15);
define("FF_GEORGIA",16);
define("FF_TREBUCHE",17);
// Gnome Vera font
// Available from http://www.gnome.org/fonts/
define("FF_VERA",18);
define("FF_VERAMONO",19);
define("FF_VERASERIF",20);
// Chinese font
define("FF_SIMSUN",30);
define("FF_CHINESE",31);
define("FF_BIG5",32);
// Japanese font
define("FF_MINCHO",40);
define("FF_PMINCHO",41);
define("FF_GOTHIC",42);
define("FF_PGOTHIC",43);
// Hebrew fonts
define("FF_DAVID",44);
define("FF_MIRIAM",45);
define("FF_AHRON",46);
// Dejavu-fonts http://sourceforge.net/projects/dejavu
define("FF_DV_SANSSERIF",47);
define("FF_DV_SERIF",48);
define("FF_DV_SANSSERIFMONO",49);
define("FF_DV_SERIFCOND",50);
define("FF_DV_SANSSERIFCOND",51);
// Extra fonts
// Download fonts from
// http://www.webfontlist.com
// http://www.webpagepublicity.com/free-fonts.html
// http://www.fontonic.com/fonts.asp?width=d&offset=120
// http://www.fontspace.com/category/famous
// define("FF_SPEEDO",71); // This font is also known as Bauer (Used for development gauge fascia)
define("FF_DIGITAL",72); // Digital readout font
define("FF_COMPUTER",73); // The classic computer font
define("FF_CALCULATOR",74); // Triad font
define("FF_USERFONT",90);
define("FF_USERFONT1",90);
define("FF_USERFONT2",91);
define("FF_USERFONT3",92);
// Limits for fonts
define("_FIRST_FONT",10);
define("_LAST_FONT",99);
// TTF Font styles
define("FS_NORMAL",9001);
define("FS_BOLD",9002);
define("FS_ITALIC",9003);
define("FS_BOLDIT",9004);
define("FS_BOLDITALIC",9004);
//Definitions for internal font
define("FF_FONT0",1);
define("FF_FONT1",2);
define("FF_FONT2",4);
//------------------------------------------------------------------------
// Defines for font setup
//------------------------------------------------------------------------
// Actual name of the TTF file used together with FF_CHINESE aka FF_BIG5
// This is the TTF file being used when the font family is specified as
// either FF_CHINESE or FF_BIG5
define('CHINESE_TTF_FONT','bkai00mp.ttf');
// Special unicode greek language support
define("LANGUAGE_GREEK",false);
// If you are setting this config to true the conversion of greek characters
// will assume that the input text is windows 1251
define("GREEK_FROM_WINDOWS",false);
// Special unicode cyrillic language support
define("LANGUAGE_CYRILLIC",false);
// If you are setting this config to true the conversion
// will assume that the input text is windows 1251, if
// false it will assume koi8-r
define("CYRILLIC_FROM_WINDOWS",false);
// The following constant is used to auto-detect
// whether cyrillic conversion is really necessary
// if enabled. Just replace 'windows-1251' with a variable
// containing the input character encoding string
// of your application calling jpgraph.
// A typical such string would be 'UTF-8' or 'utf-8'.
// The comparison is case-insensitive.
// If this charset is not a 'koi8-r' or 'windows-1251'
// derivate then no conversion is done.
//
// This constant can be very important in multi-user
// multi-language environments where a cyrillic conversion
// could be needed for some cyrillic people
// and resulting in just erraneous conversions
// for not-cyrillic language based people.
//
// Example: In the free project management
// software dotproject.net $locale_char_set is dynamically
// set by the language environment the user has chosen.
//
// Usage: define('LANGUAGE_CHARSET', $locale_char_set);
//
// where $locale_char_set is a GLOBAL (string) variable
// from the application including JpGraph.
//
define('LANGUAGE_CHARSET', null);
// Japanese TrueType font used with FF_MINCHO, FF_PMINCHO, FF_GOTHIC, FF_PGOTHIC
// Standard fonts from Infomation-technology Promotion Agency (IPA)
// See http://mix-mplus-ipa.sourceforge.jp/
define('MINCHO_TTF_FONT','ipam.ttf');
define('PMINCHO_TTF_FONT','ipamp.ttf');
define('GOTHIC_TTF_FONT','ipag.ttf');
define('PGOTHIC_TTF_FONT','ipagp.ttf');
// Assume that Japanese text have been entered in EUC-JP encoding.
// If this define is true then conversion from EUC-JP to UTF8 is done
// automatically in the library using the mbstring module in PHP.
define('ASSUME_EUCJP_ENCODING',false);
// Default font family
define('FF_DEFAULT', FF_DV_SANSSERIF);
//=================================================================
// CLASS LanguageConv
// Description:
// Converts various character encoding into proper
// UTF-8 depending on how the library have been configured and
// what font family is being used
//=================================================================
class LanguageConv {
private $g2312 = null ;
function Convert($aTxt,$aFF) {
if( LANGUAGE_GREEK ) {
if( GREEK_FROM_WINDOWS ) {
$unistring = LanguageConv::gr_win2uni($aTxt);
} else {
$unistring = LanguageConv::gr_iso2uni($aTxt);
}
return $unistring;
} elseif( LANGUAGE_CYRILLIC ) {
if( CYRILLIC_FROM_WINDOWS && (!defined('LANGUAGE_CHARSET') || stristr(LANGUAGE_CHARSET, 'windows-1251')) ) {
$aTxt = convert_cyr_string($aTxt, "w", "k");
}
if( !defined('LANGUAGE_CHARSET') || stristr(LANGUAGE_CHARSET, 'koi8-r') || stristr(LANGUAGE_CHARSET, 'windows-1251')) {
$isostring = convert_cyr_string($aTxt, "k", "i");
$unistring = LanguageConv::iso2uni($isostring);
}
else {
$unistring = $aTxt;
}
return $unistring;
}
elseif( $aFF === FF_SIMSUN ) {
// Do Chinese conversion
if( $this->g2312 == null ) {
include_once 'jpgraph_gb2312.php' ;
$this->g2312 = new GB2312toUTF8();
}
return $this->g2312->gb2utf8($aTxt);
}
elseif( $aFF === FF_BIG5 ) {
if( !function_exists('iconv') ) {
JpGraphError::RaiseL(25006);
//('Usage of FF_CHINESE (FF_BIG5) font family requires that your PHP setup has the iconv() function. By default this is not compiled into PHP (needs the "--width-iconv" when configured).');
}
return iconv('BIG5','UTF-8',$aTxt);
}
elseif( ASSUME_EUCJP_ENCODING &&
($aFF == FF_MINCHO || $aFF == FF_GOTHIC || $aFF == FF_PMINCHO || $aFF == FF_PGOTHIC) ) {
if( !function_exists('mb_convert_encoding') ) {
JpGraphError::RaiseL(25127);
}
return mb_convert_encoding($aTxt, 'UTF-8','EUC-JP');
}
elseif( $aFF == FF_DAVID || $aFF == FF_MIRIAM || $aFF == FF_AHRON ) {
return LanguageConv::heb_iso2uni($aTxt);
}
else
return $aTxt;
}
// Translate iso encoding to unicode
public static function iso2uni ($isoline){
$uniline='';
for ($i=0; $i < strlen($isoline); $i++){
$thischar=substr($isoline,$i,1);
$charcode=ord($thischar);
$uniline.=($charcode>175) ? "&#" . (1040+($charcode-176)). ";" : $thischar;
}
return $uniline;
}
// Translate greek iso encoding to unicode
public static function gr_iso2uni ($isoline) {
$uniline='';
for ($i=0; $i < strlen($isoline); $i++) {
$thischar=substr($isoline,$i,1);
$charcode=ord($thischar);
$uniline.=($charcode>179 && $charcode!=183 && $charcode!=187 && $charcode!=189) ? "&#" . (900+($charcode-180)). ";" : $thischar;
}
return $uniline;
}
// Translate greek win encoding to unicode
public static function gr_win2uni ($winline) {
$uniline='';
for ($i=0; $i < strlen($winline); $i++) {
$thischar=substr($winline,$i,1);
$charcode=ord($thischar);
if ($charcode==161 || $charcode==162) {
$uniline.="&#" . (740+$charcode). ";";
}
else {
$uniline.=(($charcode>183 && $charcode!=187 && $charcode!=189) || $charcode==180) ? "&#" . (900+($charcode-180)). ";" : $thischar;
}
}
return $uniline;
}
public static function heb_iso2uni($isoline) {
$isoline = hebrev($isoline);
$o = '';
$n = strlen($isoline);
for($i=0; $i < $n; $i++) {
$c=ord( substr($isoline,$i,1) );
$o .= ($c > 223) && ($c < 251) ? '&#'.(1264+$c).';' : chr($c);
}
return utf8_encode($o);
}
}
//=============================================================
// CLASS TTF
// Description: Handle TTF font names and mapping and loading of
// font files
//=============================================================
class TTF {
private $font_files,$style_names;
function __construct() {
// String names for font styles to be used in error messages
$this->style_names=array(
FS_NORMAL =>'normal',
FS_BOLD =>'bold',
FS_ITALIC =>'italic',
FS_BOLDITALIC =>'bolditalic');
// File names for available fonts
$this->font_files=array(
FF_COURIER => array(FS_NORMAL =>'cour.ttf',
FS_BOLD =>'courbd.ttf',
FS_ITALIC =>'couri.ttf',
FS_BOLDITALIC =>'courbi.ttf' ),
FF_GEORGIA => array(FS_NORMAL =>'georgia.ttf',
FS_BOLD =>'georgiab.ttf',
FS_ITALIC =>'georgiai.ttf',
FS_BOLDITALIC =>'' ),
FF_TREBUCHE =>array(FS_NORMAL =>'trebuc.ttf',
FS_BOLD =>'trebucbd.ttf',
FS_ITALIC =>'trebucit.ttf',
FS_BOLDITALIC =>'trebucbi.ttf' ),
FF_VERDANA => array(FS_NORMAL =>'verdana.ttf',
FS_BOLD =>'verdanab.ttf',
FS_ITALIC =>'verdanai.ttf',
FS_BOLDITALIC =>'' ),
FF_TIMES => array(FS_NORMAL =>'times.ttf',
FS_BOLD =>'timesbd.ttf',
FS_ITALIC =>'timesi.ttf',
FS_BOLDITALIC =>'timesbi.ttf' ),
FF_COMIC => array(FS_NORMAL =>'comic.ttf',
FS_BOLD =>'comicbd.ttf',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
FF_ARIAL => array(FS_NORMAL =>'arial.ttf',
FS_BOLD =>'arialbd.ttf',
FS_ITALIC =>'ariali.ttf',
FS_BOLDITALIC =>'arialbi.ttf' ) ,
FF_VERA => array(FS_NORMAL =>'Vera.ttf',
FS_BOLD =>'VeraBd.ttf',
FS_ITALIC =>'VeraIt.ttf',
FS_BOLDITALIC =>'VeraBI.ttf' ),
FF_VERAMONO => array(FS_NORMAL =>'VeraMono.ttf',
FS_BOLD =>'VeraMoBd.ttf',
FS_ITALIC =>'VeraMoIt.ttf',
FS_BOLDITALIC =>'VeraMoBI.ttf' ),
FF_VERASERIF=> array(FS_NORMAL =>'VeraSe.ttf',
FS_BOLD =>'VeraSeBd.ttf',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ) ,
/* Chinese fonts */
FF_SIMSUN => array(
FS_NORMAL =>'simsun.ttc',
FS_BOLD =>'simhei.ttf',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
FF_CHINESE => array(
FS_NORMAL =>CHINESE_TTF_FONT,
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
FF_BIG5 => array(
FS_NORMAL =>CHINESE_TTF_FONT,
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
/* Japanese fonts */
FF_MINCHO => array(
FS_NORMAL =>MINCHO_TTF_FONT,
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
FF_PMINCHO => array(
FS_NORMAL =>PMINCHO_TTF_FONT,
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
FF_GOTHIC => array(
FS_NORMAL =>GOTHIC_TTF_FONT,
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
FF_PGOTHIC => array(
FS_NORMAL =>PGOTHIC_TTF_FONT,
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
/* Hebrew fonts */
FF_DAVID => array(
FS_NORMAL =>'DAVIDNEW.TTF',
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
FF_MIRIAM => array(
FS_NORMAL =>'MRIAMY.TTF',
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
FF_AHRON => array(
FS_NORMAL =>'ahronbd.ttf',
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
/* Misc fonts */
FF_DIGITAL => array(
FS_NORMAL =>'DIGIRU__.TTF',
FS_BOLD =>'Digirtu_.ttf',
FS_ITALIC =>'Digir___.ttf',
FS_BOLDITALIC =>'DIGIRT__.TTF' ),
/* This is an experimental font for the speedometer development
FF_SPEEDO => array(
FS_NORMAL =>'Speedo.ttf',
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
*/
FF_COMPUTER => array(
FS_NORMAL =>'COMPUTER.TTF',
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
FF_CALCULATOR => array(
FS_NORMAL =>'Triad_xs.ttf',
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
/* Dejavu fonts */
FF_DV_SANSSERIF => array(
FS_NORMAL =>array('DejaVuSans.ttf'),
FS_BOLD =>array('DejaVuSans-Bold.ttf','DejaVuSansBold.ttf'),
FS_ITALIC =>array('DejaVuSans-Oblique.ttf','DejaVuSansOblique.ttf'),
FS_BOLDITALIC =>array('DejaVuSans-BoldOblique.ttf','DejaVuSansBoldOblique.ttf') ),
FF_DV_SANSSERIFMONO => array(
FS_NORMAL =>array('DejaVuSansMono.ttf','DejaVuMonoSans.ttf'),
FS_BOLD =>array('DejaVuSansMono-Bold.ttf','DejaVuMonoSansBold.ttf'),
FS_ITALIC =>array('DejaVuSansMono-Oblique.ttf','DejaVuMonoSansOblique.ttf'),
FS_BOLDITALIC =>array('DejaVuSansMono-BoldOblique.ttf','DejaVuMonoSansBoldOblique.ttf') ),
FF_DV_SANSSERIFCOND => array(
FS_NORMAL =>array('DejaVuSansCondensed.ttf','DejaVuCondensedSans.ttf'),
FS_BOLD =>array('DejaVuSansCondensed-Bold.ttf','DejaVuCondensedSansBold.ttf'),
FS_ITALIC =>array('DejaVuSansCondensed-Oblique.ttf','DejaVuCondensedSansOblique.ttf'),
FS_BOLDITALIC =>array('DejaVuSansCondensed-BoldOblique.ttf','DejaVuCondensedSansBoldOblique.ttf') ),
FF_DV_SERIF => array(
FS_NORMAL =>array('DejaVuSerif.ttf'),
FS_BOLD =>array('DejaVuSerif-Bold.ttf','DejaVuSerifBold.ttf'),
FS_ITALIC =>array('DejaVuSerif-Italic.ttf','DejaVuSerifItalic.ttf'),
FS_BOLDITALIC =>array('DejaVuSerif-BoldItalic.ttf','DejaVuSerifBoldItalic.ttf') ),
FF_DV_SERIFCOND => array(
FS_NORMAL =>array('DejaVuSerifCondensed.ttf','DejaVuCondensedSerif.ttf'),
FS_BOLD =>array('DejaVuSerifCondensed-Bold.ttf','DejaVuCondensedSerifBold.ttf'),
FS_ITALIC =>array('DejaVuSerifCondensed-Italic.ttf','DejaVuCondensedSerifItalic.ttf'),
FS_BOLDITALIC =>array('DejaVuSerifCondensed-BoldItalic.ttf','DejaVuCondensedSerifBoldItalic.ttf') ),
/* Placeholders for defined fonts */
FF_USERFONT1 => array(
FS_NORMAL =>'',
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
FF_USERFONT2 => array(
FS_NORMAL =>'',
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
FF_USERFONT3 => array(
FS_NORMAL =>'',
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
);
}
//---------------
// PUBLIC METHODS
// Create the TTF file from the font specification
function File($family,$style=FS_NORMAL) {
$fam = @$this->font_files[$family];
if( !$fam ) {
JpGraphError::RaiseL(25046,$family);//("Specified TTF font family (id=$family) is unknown or does not exist. Please note that TTF fonts are not distributed with JpGraph for copyright reasons. You can find the MS TTF WEB-fonts (arial, courier etc) for download at http://corefonts.sourceforge.net/");
}
$ff = @$fam[$style];
// There are several optional file names. They are tried in order
// and the first one found is used
if( !is_array($ff) ) {
$ff = array($ff);
}
$jpgraph_font_dir = dirname(__FILE__).'/fonts/';
foreach ($ff as $font_file) {
// All font families are guaranteed to have the normal style
if( $font_file==='' )
JpGraphError::RaiseL(25047,$this->style_names[$style],$this->font_files[$family][FS_NORMAL]);//('Style "'.$this->style_names[$style].'" is not available for font family '.$this->font_files[$family][FS_NORMAL].'.');
if( !$font_file ) {
JpGraphError::RaiseL(25048,$fam);//("Unknown font style specification [$fam].");
}
// check jpgraph/src/fonts dir
$jpgraph_font_file = $jpgraph_font_dir . $font_file;
if (file_exists($jpgraph_font_file) === true && is_readable($jpgraph_font_file) === true) {
$font_file = $jpgraph_font_file;
break;
}
// check OS font dir
if ($family >= FF_MINCHO && $family <= FF_PGOTHIC) {
$font_file = MBTTF_DIR.$font_file;
} else {
$font_file = TTF_DIR.$font_file;
}
if (file_exists($font_file) === true && is_readable($font_file) === true) {
break;
}
}
if( !file_exists($font_file) ) {
JpGraphError::RaiseL(25049,$font_file);//("Font file \"$font_file\" is not readable or does not exist.");
}
return $font_file;
}
function SetUserFont($aNormal,$aBold='',$aItalic='',$aBoldIt='') {
$this->font_files[FF_USERFONT] =
array(FS_NORMAL => $aNormal,
FS_BOLD => $aBold,
FS_ITALIC => $aItalic,
FS_BOLDITALIC => $aBoldIt ) ;
}
function SetUserFont1($aNormal,$aBold='',$aItalic='',$aBoldIt='') {
$this->font_files[FF_USERFONT1] =
array(FS_NORMAL => $aNormal,
FS_BOLD => $aBold,
FS_ITALIC => $aItalic,
FS_BOLDITALIC => $aBoldIt ) ;
}
function SetUserFont2($aNormal,$aBold='',$aItalic='',$aBoldIt='') {
$this->font_files[FF_USERFONT2] =
array(FS_NORMAL => $aNormal,
FS_BOLD => $aBold,
FS_ITALIC => $aItalic,
FS_BOLDITALIC => $aBoldIt ) ;
}
function SetUserFont3($aNormal,$aBold='',$aItalic='',$aBoldIt='') {
$this->font_files[FF_USERFONT3] =
array(FS_NORMAL => $aNormal,
FS_BOLD => $aBold,
FS_ITALIC => $aItalic,
FS_BOLDITALIC => $aBoldIt ) ;
}
} // Class
//=============================================================================
// CLASS SymChar
// Description: Code values for some commonly used characters that
// normally isn't available directly on the keyboard, for example
// mathematical and greek symbols.
//=============================================================================
class SymChar {
static function Get($aSymb,$aCapital=FALSE) {
$iSymbols = array(
/* Greek */
array('alpha','03B1','0391'),
array('beta','03B2','0392'),
array('gamma','03B3','0393'),
array('delta','03B4','0394'),
array('epsilon','03B5','0395'),
array('zeta','03B6','0396'),
array('ny','03B7','0397'),
array('eta','03B8','0398'),
array('theta','03B8','0398'),
array('iota','03B9','0399'),
array('kappa','03BA','039A'),
array('lambda','03BB','039B'),
array('mu','03BC','039C'),
array('nu','03BD','039D'),
array('xi','03BE','039E'),
array('omicron','03BF','039F'),
array('pi','03C0','03A0'),
array('rho','03C1','03A1'),
array('sigma','03C3','03A3'),
array('tau','03C4','03A4'),
array('upsilon','03C5','03A5'),
array('phi','03C6','03A6'),
array('chi','03C7','03A7'),
array('psi','03C8','03A8'),
array('omega','03C9','03A9'),
/* Money */
array('euro','20AC'),
array('yen','00A5'),
array('pound','20A4'),
/* Math */
array('approx','2248'),
array('neq','2260'),
array('not','2310'),
array('def','2261'),
array('inf','221E'),
array('sqrt','221A'),
array('int','222B'),
/* Misc */
array('copy','00A9'),
array('para','00A7'),
array('tm','2122'), /* Trademark symbol */
array('rtm','00AE'), /* Registered trademark */
array('degree','00b0'),
array('lte','2264'), /* Less than or equal */
array('gte','2265'), /* Greater than or equal */
);
$n = count($iSymbols);
$i=0;
$found = false;
$aSymb = strtolower($aSymb);
while( $i < $n && !$found ) {
$found = $aSymb === $iSymbols[$i++][0];
}
if( $found ) {
$ca = $iSymbols[--$i];
if( $aCapital && count($ca)==3 )
$s = $ca[2];
else
$s = $ca[1];
return sprintf('&#%04d;',hexdec($s));
}
else
return '';
}
}
?>

@ -1,251 +0,0 @@
<?php
/*=======================================================================
// File: JPGRAPH_UTILS.INC
// Description: Collection of non-essential "nice to have" utilities
// Created: 2005-11-20
// Author: Johan Persson (johanp@aditus.nu)
// Ver: $Id: jpgraph_utils.inc,v 1.1 2006/07/07 13:37:14 powles Exp $
//
// 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 {
var $iFunc='',$iXFunc='',$iMin,$iMax,$iStepSize;
function FuncGenerator($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 SymChar
// Description: Code values for some commonly used characters that
// normally isn't available directly on the keyboard, for example
// mathematical and greek symbols.
//=============================================================================
class SymChar {
function Get($aSymb,$aCapital=FALSE) {
static $iSymbols = array(
/* Greek */
array('alpha','03B1','0391'),
array('beta','03B2','0392'),
array('gamma','03B3','0393'),
array('delta','03B4','0394'),
array('epsilon','03B5','0395'),
array('zeta','03B6','0396'),
array('ny','03B7','0397'),
array('eta','03B8','0398'),
array('theta','03B8','0398'),
array('iota','03B9','0399'),
array('kappa','03BA','039A'),
array('lambda','03BB','039B'),
array('mu','03BC','039C'),
array('nu','03BD','039D'),
array('xi','03BE','039E'),
array('omicron','03BF','039F'),
array('pi','03C0','03A0'),
array('rho','03C1','03A1'),
array('sigma','03C3','03A3'),
array('tau','03C4','03A4'),
array('upsilon','03C5','03A5'),
array('phi','03C6','03A6'),
array('chi','03C7','03A7'),
array('psi','03C8','03A8'),
array('omega','03C9','03A9'),
/* Money */
array('euro','20AC'),
array('yen','00A5'),
array('pound','20A4'),
/* Math */
array('approx','2248'),
array('neq','2260'),
array('not','2310'),
array('def','2261'),
array('inf','221E'),
array('sqrt','221A'),
array('int','222B'),
/* Misc */
array('copy','00A9'),
array('para','00A7'));
$n = count($iSymbols);
$i=0;
$found = false;
$aSymb = strtolower($aSymb);
while( $i < $n && !$found ) {
$found = $aSymb === $iSymbols[$i++][0];
}
if( $found ) {
$ca = $iSymbols[--$i];
if( $aCapital && count($ca)==3 )
$s = $ca[2];
else
$s = $ca[1];
return sprintf('&#%04d;',hexdec($s));
}
else
return '';
}
}
//=============================================================================
// CLASS DateScaleUtils
// Description: Help to create a manual date scale
//=============================================================================
DEFINE('DSUTILS_MONTH1',1); // Major and minor ticks on a monthly basis
class DateScaleUtils {
function GetTicks($aData,$aType=1) {
//
// Find out the range of the data in order to get the limits for the loops
// that creates the position for the labels. This code is generic and can be
// used for any ranges of the data.
//
$n = count($aData);
$startmonth = date('n',$aData[0]);
$startday = date('j',$aData[0]);
$startyear = date('Y',$aData[0]);
$endmonth = date('n',$aData[$n-1]);
$endyear = date('Y',$aData[$n-1]);
$endday = date('j',$aData[$n-1]);
//
// Now create the positions for all the ticks. In this example we
// put a tick at the start of every month and also on the very
// first and last X-position.
//
$tickPositions = array();
$minTickPositions = array();
$i=0;$j=0;
// Uncomment this line to put a label at the very left data pos
// $tickPositions[$i++] = $datax[0];
$m = $startmonth;
$y = $startyear;
// Skip the first month label if it is before the startdate
if( $startday == 1 ) {
$tickPositions[$i++] = mktime(0,0,0,$m,1,$y);
}
if( $startday < 15 ) {
$minTickPositions[$j++] = mktime(0,0,0,$m,15,$y);
}
++$m;
// Loop through all the years included in the scale
for($y=$startyear; $y <= $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 == $endyear ? $endmonth : 12;
while( $m <= $stopmonth ) {
switch( $aType ) {
case 1:
// Set minor tick at the middle of the month
if( $m <= $stopmonth ) {
if( !($y==$endyear && $m==$stopmonth && $endday < 15) )
$minTickPositions[$j++] = mktime(0,0,0,$m,15,$y);
}
// Major at month
// Get timestamp of first hour of first day in each month
$tickPositions[$i++] = mktime(0,0,0,$m,1,$y);
break;
}
++$m;
}
$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($startmonth == $endmonth && $startyear == $endyear && $aType==1 ) {
$tickPositions[$i++] = mktime(0 ,0 ,0, $startmonth + 1, 1, $startyear);
}
// Uncomment this line to put a label at the very right data pos
// $tickPositions[$i] = $datax[$n-1];
return array($tickPositions,$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
//----------------------------------------------------------------------------
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;
}
}
?>

@ -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) Asial Corporation. 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);
}
}
?>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,552 @@
<?php
/*=======================================================================
// File: DE.INC.PHP
// Description: German language file for error messages
// Created: 2006-03-06
// Author: Timo Leopold (timo@leopold-hh.de)
// Johan Persson (ljp@localhost.nil)
// Ver: $Id: de.inc.php 1886 2009-10-01 23:30:16Z ljp $
//
// Copyright (c)
//========================================================================
*/
// Notiz: Das Format fuer jede Fehlermeldung ist array(<Fehlermeldung>,<Anzahl der Argumente>)
$_jpg_messages = array(
/*
** Headers wurden bereits gesendet - Fehler. Dies wird als HTML formatiert, weil es direkt als text zurueckgesendet wird
*/
10 => array('<table border="1"><tr><td style="color:darkred;font-size:1.2em;"><b>JpGraph Fehler:</b>
HTTP header wurden bereits gesendet.<br>Fehler in der Datei <b>%s</b> in der Zeile <b>%d</b>.</td></tr><tr><td><b>Erklärung:</b><br>HTTP header wurden bereits zum Browser gesendet, wobei die Daten als Text gekennzeichnet wurden, bevor die Bibliothek die Chance hatte, seinen Bild-HTTP-Header zum Browser zu schicken. Dies verhindert, dass die Bibliothek Bilddaten zum Browser schicken kann (weil sie vom Browser als Text interpretiert würden und daher nur Mist dargestellt würde).<p>Wahrscheinlich steht Text im Skript bevor <i>Graph::Stroke()</i> aufgerufen wird. Wenn dieser Text zum Browser gesendet wird, nimmt dieser an, dass die gesamten Daten aus Text bestehen. Such nach irgendwelchem Text, auch nach Leerzeichen und Zeilenumbrüchen, die eventuell bereits zum Browser gesendet wurden. <p>Zum Beispiel ist ein oft auftretender Fehler, eine Leerzeile am Anfang der Datei oder vor <i>Graph::Stroke()</i> zu lassen."<b>&lt;?php</b>".</td></tr></table>',2),
/*
** Setup Fehler
*/
11 => array('Es wurde kein Pfad für CACHE_DIR angegeben. Bitte gib einen Pfad CACHE_DIR in der Datei jpg-config.inc an.',0),
12 => array('Es wurde kein Pfad für TTF_DIR angegeben und der Pfad kann nicht automatisch ermittelt werden. Bitte gib den Pfad in der Datei jpg-config.inc an.',0),
13 => array('The installed PHP version (%s) is not compatible with this release of the library. The library requires at least PHP version %s',2),
/*
** jpgraph_bar
*/
2001 => array('Die Anzahl der Farben ist nicht gleich der Anzahl der Vorlagen in BarPlot::SetPattern().',0),
2002 => array('Unbekannte Vorlage im Aufruf von BarPlot::SetPattern().',0),
2003 => array('Anzahl der X- und Y-Koordinaten sind nicht identisch. Anzahl der X-Koordinaten: %d; Anzahl der Y-Koordinaten: %d.',2),
2004 => array('Alle Werte für ein Balkendiagramm (barplot) müssen numerisch sein. Du hast den Wert nr [%d] == %s angegeben.',2),
2005 => array('Du hast einen leeren Vektor für die Schattierungsfarben im Balkendiagramm (barplot) angegeben.',0),
2006 => array('Unbekannte Position für die Werte der Balken: %s.',1),
2007 => array('Kann GroupBarPlot nicht aus einem leeren Vektor erzeugen.',0),
2008 => array('GroupBarPlot Element nbr %d wurde nicht definiert oder ist leer.',0),
2009 => array('Eins der Objekte, das an GroupBar weitergegeben wurde ist kein Balkendiagramm (BarPlot). Versichere Dich, dass Du den GroupBarPlot aus einem Vektor von Balkendiagrammen (barplot) oder AccBarPlot-Objekten erzeugst. (Class = %s)',1),
2010 => array('Kann AccBarPlot nicht aus einem leeren Vektor erzeugen.',0),
2011 => array('AccBarPlot-Element nbr %d wurde nicht definiert oder ist leer.',1),
2012 => array('Eins der Objekte, das an AccBar weitergegeben wurde ist kein Balkendiagramm (barplot). Versichere Dich, dass Du den AccBar-Plot aus einem Vektor von Balkendiagrammen (barplot) erzeugst. (Class=%s)',1),
2013 => array('Du hast einen leeren Vektor für die Schattierungsfarben im Balkendiagramm (barplot) angegeben.',0),
2014 => array('Die Anzahl der Datenpunkte jeder Datenreihe in AccBarPlot muss gleich sein.',0),
2015 => array('Individual bar plots in an AccBarPlot or GroupBarPlot can not have specified X-coordinates',0),
/*
** jpgraph_date
*/
3001 => array('Es ist nur möglich, entweder SetDateAlign() oder SetTimeAlign() zu benutzen, nicht beides!',0),
/*
** jpgraph_error
*/
4002 => array('Fehler bei den Eingabedaten von LineErrorPlot. Die Anzahl der Datenpunkte mus ein Mehrfaches von drei sein!',0),
/*
** jpgraph_flags
*/
5001 => array('Unbekannte Flaggen-Größe (%d).',1),
5002 => array('Der Flaggen-Index %s existiert nicht.',1),
5003 => array('Es wurde eine ungültige Ordnungszahl (%d) für den Flaggen-Index angegeben.',1),
5004 => array('Der Landesname %s hat kein korrespondierendes Flaggenbild. Die Flagge mag existieren, abr eventuell unter einem anderen Namen, z.B. versuche "united states" statt "usa".',1),
/*
** jpgraph_gantt
*/
6001 => array('Interner Fehler. Die Höhe für ActivityTitles ist < 0.',0),
6002 => array('Es dürfen keine negativen Werte für die Gantt-Diagramm-Dimensionen angegeben werden. Verwende 0, wenn die Dimensionen automatisch ermittelt werden sollen.',0),
6003 => array('Ungültiges Format für den Bedingungs-Parameter bei Index=%d in CreateSimple(). Der Parameter muss bei index 0 starten und Vektoren in der Form (Row,Constrain-To,Constrain-Type) enthalten.',1),
6004 => array('Ungültiges Format für den Fortschritts-Parameter bei Index=%d in CreateSimple(). Der Parameter muss bei Index 0 starten und Vektoren in der Form (Row,Progress) enthalten.',1),
6005 => array('SetScale() ist nicht sinnvoll bei Gantt-Diagrammen.',0),
6006 => array('Das Gantt-Diagramm kann nicht automatisch skaliert werden. Es existieren keine Aktivitäten mit Termin. [GetBarMinMax() start >= n]',0),
6007 => array('Plausibiltätsprüfung für die automatische Gantt-Diagramm-Größe schlug fehl. Entweder die Breite (=%d) oder die Höhe (=%d) ist größer als MAX_GANTTIMG_SIZE. Dies kann möglicherweise durch einen falschen Wert bei einer Aktivität hervorgerufen worden sein.',2),
6008 => array('Du hast eine Bedingung angegeben von Reihe=%d bis Reihe=%d, die keine Aktivität hat.',2),
6009 => array('Unbekannter Bedingungstyp von Reihe=%d bis Reihe=%d',2),
6010 => array('Ungültiger Icon-Index für das eingebaute Gantt-Icon [%d]',1),
6011 => array('Argument für IconImage muss entweder ein String oder ein Integer sein.',0),
6012 => array('Unbekannter Typ bei der Gantt-Objekt-Title-Definition.',0),
6015 => array('Ungültige vertikale Position %d',1),
6016 => array('Der eingegebene Datums-String (%s) für eine Gantt-Aktivität kann nicht interpretiert werden. Versichere Dich, dass es ein gültiger Datumsstring ist, z.B. 2005-04-23 13:30',1),
6017 => array('Unbekannter Datumstyp in GanttScale (%s).',1),
6018 => array('Intervall für Minuten muss ein gerader Teiler einer Stunde sein, z.B. 1,5,10,12,15,20,30, etc. Du hast ein Intervall von %d Minuten angegeben.',1),
6019 => array('Die vorhandene Breite (%d) für die Minuten ist zu klein, um angezeigt zu werden. Bitte benutze die automatische Größenermittlung oder vergrößere die Breite des Diagramms.',1),
6020 => array('Das Intervall für die Stunden muss ein gerader Teiler eines Tages sein, z.B. 0:30, 1:00, 1:30, 4:00, etc. Du hast ein Intervall von %d eingegeben.',1),
6021 => array('Unbekanntes Format für die Woche.',0),
6022 => array('Die Gantt-Skala wurde nicht eingegeben.',0),
6023 => array('Wenn Du sowohl Stunden als auch Minuten anzeigen lassen willst, muss das Stunden-Interval gleich 1 sein (anderenfalls ist es nicht sinnvoll, Minuten anzeigen zu lassen).',0),
6024 => array('Das CSIM-Ziel muss als String angegeben werden. Der Start des Ziels ist: %d',1),
6025 => array('Der CSIM-Alt-Text muss als String angegeben werden. Der Beginn des Alt-Textes ist: %d',1),
6027 => array('Der Fortschrittswert muss im Bereich [0, 1] liegen.',0),
6028 => array('Die eingegebene Höhe (%d) für GanttBar ist nicht im zulässigen Bereich.',1),
6029 => array('Der Offset für die vertikale Linie muss im Bereich [0,1] sein.',0),
6030 => array('Unbekannte Pfeilrichtung für eine Verbindung.',0),
6031 => array('Unbekannter Pfeiltyp für eine Verbindung.',0),
6032 => array('Interner Fehler: Unbekannter Pfadtyp (=%d) für eine Verbindung.',1),
6033 => array('Array of fonts must contain arrays with 3 elements, i.e. (Family, Style, Size)',0),
/*
** jpgraph_gradient
*/
7001 => array('Unbekannter Gradiententyp (=%d).',1),
/*
** jpgraph_iconplot
*/
8001 => array('Der Mix-Wert für das Icon muss zwischen 0 und 100 sein.',0),
8002 => array('Die Ankerposition für Icons muss entweder "top", "bottom", "left", "right" oder "center" sein.',0),
8003 => array('Es ist nicht möglich, gleichzeitig ein Bild und eine Landesflagge für dasselbe Icon zu definieren',0),
8004 => array('Wenn Du Landesflaggen benutzen willst, musst Du die Datei "jpgraph_flags.php" hinzufügen (per include).',0),
/*
** jpgraph_imgtrans
*/
9001 => array('Der Wert für die Bildtransformation ist außerhalb des zulässigen Bereichs. Der verschwindende Punkt am Horizont muss als Wert zwischen 0 und 1 angegeben werden.',0),
/*
** jpgraph_lineplot
*/
10001 => array('Die Methode LinePlot::SetFilled() sollte nicht mehr benutzt werden. Benutze lieber SetFillColor()',0),
10002 => array('Der Plot ist zu kompliziert für FastLineStroke. Benutze lieber den StandardStroke()',0),
10003 => array('Each plot in an accumulated lineplot must have the same number of data points.',0),
/*
** jpgraph_log
*/
11001 => array('Deine Daten enthalten nicht-numerische Werte.',0),
11002 => array('Negative Werte können nicht für logarithmische Achsen verwendet werden.',0),
11003 => array('Deine Daten enthalten nicht-numerische Werte.',0),
11004 => array('Skalierungsfehler für die logarithmische Achse. Es gibt ein Problem mit den Daten der Achse. Der größte Wert muss größer sein als Null. Es ist mathematisch nicht möglich, einen Wert gleich Null in der Skala zu haben.',0),
11005 => array('Das Tick-Intervall für die logarithmische Achse ist nicht definiert. Lösche jeden Aufruf von SetTextLabelStart() oder SetTextTickInterval() bei der logarithmischen Achse.',0),
/*
** jpgraph_mgraph
*/
12001 => array("Du benutzt GD 2.x und versuchst ein Nicht-Truecolor-Bild als Hintergrundbild zu benutzen. Um Hintergrundbilder mit GD 2.x zu benutzen, ist es notwendig Truecolor zu aktivieren, indem die USE_TRUECOLOR-Konstante auf TRUE gesetzt wird. Wegen eines Bugs in GD 2.0.1 ist die Qualität der Truetype-Schriften sehr schlecht, wenn man Truetype-Schriften mit Truecolor-Bildern verwendet.",0),
12002 => array('Ungültiger Dateiname für MGraph::SetBackgroundImage() : %s. Die Datei muss eine gültige Dateierweiterung haben (jpg,gif,png), wenn die automatische Typerkennung verwendet wird.',1),
12003 => array('Unbekannte Dateierweiterung (%s) in MGraph::SetBackgroundImage() für Dateiname: %s',2),
12004 => array('Das Bildformat des Hintergrundbildes (%s) wird von Deiner System-Konfiguration nicht unterstützt. ',1),
12005 => array('Das Hintergrundbild kann nicht gelesen werden: %s',1),
12006 => array('Es wurden ungültige Größen für Breite oder Höhe beim Erstellen des Bildes angegeben, (Breite=%d, Höhe=%d)',2),
12007 => array('Das Argument für MGraph::Add() ist nicht gültig für GD.',0),
12008 => array('Deine PHP- (und GD-lib-) Installation scheint keine bekannten Bildformate zu unterstützen.',0),
12009 => array('Deine PHP-Installation unterstützt das gewählte Bildformat nicht: %s',1),
12010 => array('Es konnte kein Bild als Datei %s erzeugt werden. Überprüfe, ob Du die entsprechenden Schreibrechte im aktuellen Verzeichnis hast.',1),
12011 => array('Es konnte kein Truecolor-Bild erzeugt werden. Überprüfe, ob Du wirklich die GD2-Bibliothek installiert hast.',0),
12012 => array('Es konnte kein Bild erzeugt werden. Überprüfe, ob Du wirklich die GD2-Bibliothek installiert hast.',0),
/*
** jpgraph_pie3d
*/
14001 => array('Pie3D::ShowBorder(). Missbilligte Funktion. Benutze Pie3D::SetEdge(), um die Ecken der Tortenstücke zu kontrollieren.',0),
14002 => array('PiePlot3D::SetAngle() 3D-Torten-Projektionswinkel muss zwischen 5 und 85 Grad sein.',0),
14003 => array('Interne Festlegung schlug fehl. Pie3D::Pie3DSlice',0),
14004 => array('Tortenstück-Startwinkel muss zwischen 0 und 360 Grad sein.',0),
14005 => array('Pie3D Interner Fehler: Versuch, zweimal zu umhüllen bei der Suche nach dem Startindex.',0,),
14006 => array('Pie3D Interner Fehler: Z-Sortier-Algorithmus für 3D-Tortendiagramme funktioniert nicht einwandfrei (2). Versuch, zweimal zu umhüllen beim Erstellen des Bildes.',0),
14007 => array('Die Breite für das 3D-Tortendiagramm ist 0. Gib eine Breite > 0 an.',0),
/*
** jpgraph_pie
*/
15001 => array('PiePLot::SetTheme() Unbekannter Stil: %s',1),
15002 => array('Argument für PiePlot::ExplodeSlice() muss ein Integer-Wert sein',0),
15003 => array('Argument für PiePlot::Explode() muss ein Vektor mit Integer-Werten sein.',0),
15004 => array('Tortenstück-Startwinkel muss zwischen 0 und 360 Grad sein.',0),
15005 => array('PiePlot::SetFont() sollte nicht mehr verwendet werden. Benutze stattdessen PiePlot->value->SetFont().',0),
15006 => array('PiePlot::SetSize() Radius für Tortendiagramm muss entweder als Bruch [0, 0.5] der Bildgröße oder als Absoluwert in Pixel im Bereich [10, 1000] angegeben werden.',0),
15007 => array('PiePlot::SetFontColor() sollte nicht mehr verwendet werden. Benutze stattdessen PiePlot->value->SetColor()..',0),
15008 => array('PiePlot::SetLabelType() der Typ für Tortendiagramme muss entweder 0 or 1 sein (nicht %d).',1),
15009 => array('Ungültiges Tortendiagramm. Die Summe aller Daten ist Null.',0),
15010 => array('Die Summe aller Daten ist Null.',0),
15011 => array('Um Bildtransformationen benutzen zu können, muss die Datei jpgraph_imgtrans.php eingefügt werden (per include).',0), // @todo translate into German
15012 => array('PiePlot::SetTheme() is no longer recommended. Use PieGraph::SetTheme()',0),
/*
** jpgraph_plotband
*/
16001 => array('Die Dichte für das Pattern muss zwischen 1 und 100 sein. (Du hast %f eingegeben)',1),
16002 => array('Es wurde keine Position für das Pattern angegeben.',0),
16003 => array('Unbekannte Pattern-Definition (%d)',0),
16004 => array('Der Mindeswert für das PlotBand ist größer als der Maximalwert. Bitte korrigiere dies!',0),
/*
** jpgraph_polar
*/
17001 => array('PolarPlots müssen eine gerade Anzahl von Datenpunkten haben. Jeder Datenpunkt ist ein Tupel (Winkel, Radius).',0),
17002 => array('Unbekannte Ausrichtung für X-Achsen-Titel. (%s)',1),
//17003 => array('Set90AndMargin() wird für PolarGraph nicht unterstützt.',0),
17004 => array('Unbekannter Achsentyp für PolarGraph. Er muss entweder \'lin\' oder \'log\' sein.',0),
/*
** jpgraph_radar
*/
18001 => array('ClientSideImageMaps werden für RadarPlots nicht unterstützt.',0),
18002 => array('RadarGraph::SupressTickMarks() sollte nicht mehr verwendet werden. Benutze stattdessen HideTickMarks().',0),
18003 => array('Ungültiger Achsentyp für RadarPlot (%s). Er muss entweder \'lin\' oder \'log\' sein.',1),
18004 => array('Die RadarPlot-Größe muss zwischen 0.1 und 1 sein. (Dein Wert=%f)',1),
18005 => array('RadarPlot: nicht unterstützte Tick-Dichte: %d',1),
18006 => array('Minimum Daten %f (RadarPlots sollten nur verwendet werden, wenn alle Datenpunkte einen Wert > 0 haben).',1),
18007 => array('Die Anzahl der Titel entspricht nicht der Anzahl der Datenpunkte.',0),
18008 => array('Jeder RadarPlot muss die gleiche Anzahl von Datenpunkten haben.',0),
/*
** jpgraph_regstat
*/
19001 => array('Spline: Anzahl der X- und Y-Koordinaten muss gleich sein.',0),
19002 => array('Ungültige Dateneingabe für Spline. Zwei oder mehr aufeinanderfolgende X-Werte sind identisch. Jeder eigegebene X-Wert muss unterschiedlich sein, weil vom mathematischen Standpunkt ein Eins-zu-Eins-Mapping vorliegen muss, d.h. jeder X-Wert korrespondiert mit exakt einem Y-Wert.',0),
19003 => array('Bezier: Anzahl der X- und Y-Koordinaten muss gleich sein.',0),
/*
** jpgraph_scatter
*/
20001 => array('Fieldplots müssen die gleiche Anzahl von X und Y Datenpunkten haben.',0),
20002 => array('Bei Fieldplots muss ein Winkel für jeden X und Y Datenpunkt angegeben werden.',0),
20003 => array('Scatterplots müssen die gleiche Anzahl von X- und Y-Datenpunkten haben.',0),
/*
** jpgraph_stock
*/
21001 => array('Die Anzahl der Datenwerte für Stock-Charts müssen ein Mehrfaches von %d Datenpunkten sein.',1),
/*
** jpgraph_plotmark
*/
23001 => array('Der Marker "%s" existiert nicht in der Farbe: %d',2),
23002 => array('Der Farb-Index ist zu hoch für den Marker "%s"',1),
23003 => array('Ein Dateiname muss angegeben werden, wenn Du den Marker-Typ auf MARK_IMG setzt.',0),
/*
** jpgraph_utils
*/
24001 => array('FuncGenerator : Keine Funktion definiert. ',0),
24002 => array('FuncGenerator : Syntax-Fehler in der Funktionsdefinition ',0),
24003 => array('DateScaleUtils: Unknown tick type specified in call to GetTicks()',0),
24004 => array('ReadCSV2: Die anzahl der spalten fehler in %s reihe %d',2),
/*
** jpgraph
*/
25001 => array('Diese PHP-Installation ist nicht mit der GD-Bibliothek kompiliert. Bitte kompiliere PHP mit GD-Unterstützung neu, damit JpGraph funktioniert. (Weder die Funktion imagetypes() noch imagecreatefromstring() existiert!)',0),
25002 => array('Diese PHP-Installation scheint nicht die benötigte GD-Bibliothek zu unterstützen. Bitte schau in der PHP-Dokumentation nach, wie man die GD-Bibliothek installiert und aktiviert.',0),
25003 => array('Genereller PHP Fehler : Bei %s:%d : %s',3),
25004 => array('Genereller PHP Fehler : %s ',1),
25005 => array('PHP_SELF, die PHP-Global-Variable kann nicht ermittelt werden. PHP kann nicht von der Kommandozeile gestartet werden, wenn der Cache oder die Bilddateien automatisch benannt werden sollen.',0),
25006 => array('Die Benutzung der FF_CHINESE (FF_BIG5) Schriftfamilie benötigt die iconv() Funktion in Deiner PHP-Konfiguration. Dies wird nicht defaultmäßig in PHP kompiliert (benötigt "--width-iconv" bei der Konfiguration).',0),
25007 => array('Du versuchst das lokale (%s) zu verwenden, was von Deiner PHP-Installation nicht unterstützt wird. Hinweis: Benutze \'\', um das defaultmäßige Lokale für diese geographische Region festzulegen.',1),
25008 => array('Die Bild-Breite und Höhe in Graph::Graph() müssen numerisch sein',0),
25009 => array('Die Skalierung der Achsen muss angegeben werden mit Graph::SetScale()',0),
25010 => array('Graph::Add() Du hast versucht, einen leeren Plot zum Graph hinzuzufügen.',0),
25011 => array('Graph::AddY2() Du hast versucht, einen leeren Plot zum Graph hinzuzufügen.',0),
25012 => array('Graph::AddYN() Du hast versucht, einen leeren Plot zum Graph hinzuzufügen.',0),
25013 => array('Es können nur Standard-Plots zu multiplen Y-Achsen hinzugefügt werden',0),
25014 => array('Graph::AddText() Du hast versucht, einen leeren Text zum Graph hinzuzufügen.',0),
25015 => array('Graph::AddLine() Du hast versucht, eine leere Linie zum Graph hinzuzufügen.',0),
25016 => array('Graph::AddBand() Du hast versucht, ein leeres Band zum Graph hinzuzufügen.',0),
25017 => array('Du benutzt GD 2.x und versuchst, ein Hintergrundbild in einem Truecolor-Bild zu verwenden. Um Hintergrundbilder mit GD 2.x zu verwenden, ist es notwendig, Truecolor zu aktivieren, indem die USE_TRUECOLOR-Konstante auf TRUE gesetzt wird. Wegen eines Bugs in GD 2.0.1 ist die Qualität der Schrift sehr schlecht, wenn Truetype-Schrift in Truecolor-Bildern verwendet werden.',0),
25018 => array('Falscher Dateiname für Graph::SetBackgroundImage() : "%s" muss eine gültige Dateinamenerweiterung (jpg,gif,png) haben, wenn die automatische Dateityperkennung verwenndet werden soll.',1),
25019 => array('Unbekannte Dateinamenerweiterung (%s) in Graph::SetBackgroundImage() für Dateiname: "%s"',2),
25020 => array('Graph::SetScale(): Dar Maximalwert muss größer sein als der Mindestwert.',0),
25021 => array('Unbekannte Achsendefinition für die Y-Achse. (%s)',1),
25022 => array('Unbekannte Achsendefinition für die X-Achse. (%s)',1),
25023 => array('Nicht unterstützter Y2-Achsentyp: "%s" muss einer von (lin,log,int) sein.',1),
25024 => array('Nicht unterstützter X-Achsentyp: "%s" muss einer von (lin,log,int) sein.',1),
25025 => array('Nicht unterstützte Tick-Dichte: %d',1),
25026 => array('Nicht unterstützter Typ der nicht angegebenen Y-Achse. Du hast entweder: 1. einen Y-Achsentyp für automatisches Skalieren definiert, aber keine Plots angegeben. 2. eine Achse direkt definiert, aber vergessen, die Tick-Dichte zu festzulegen.',0),
25027 => array('Kann cached CSIM "%s" zum Lesen nicht öffnen.',1),
25028 => array('Apache/PHP hat keine Schreibrechte, in das CSIM-Cache-Verzeichnis (%s) zu schreiben. Überprüfe die Rechte.',1),
25029 => array('Kann nicht in das CSIM "%s" schreiben. Überprüfe die Schreibrechte und den freien Speicherplatz.',1),
25030 => array('Fehlender Skriptname für StrokeCSIM(). Der Name des aktuellen Skriptes muss als erster Parameter von StrokeCSIM() angegeben werden.',0),
25031 => array('Der Achsentyp muss mittels Graph::SetScale() angegeben werden.',0),
25032 => array('Es existieren keine Plots für die Y-Achse nbr:%d',1),
25033 => array('',0),
25034 => array('Undefinierte X-Achse kann nicht gezeichnet werden. Es wurden keine Plots definiert.',0),
25035 => array('Du hast Clipping aktiviert. Clipping wird nur für Diagramme mit 0 oder 90 Grad Rotation unterstützt. Bitte verändere Deinen Rotationswinkel (=%d Grad) dementsprechend oder deaktiviere Clipping.',1),
25036 => array('Unbekannter Achsentyp AxisStyle() : %s',1),
25037 => array('Das Bildformat Deines Hintergrundbildes (%s) wird von Deiner System-Konfiguration nicht unterstützt. ',1),
25038 => array('Das Hintergrundbild scheint von einem anderen Typ (unterschiedliche Dateierweiterung) zu sein als der angegebene Typ. Angegebenen: %s; Datei: %s',2),
25039 => array('Hintergrundbild kann nicht gelesen werden: "%s"',1),
25040 => array('Es ist nicht möglich, sowohl ein Hintergrundbild als auch eine Hintergrund-Landesflagge anzugeben.',0),
25041 => array('Um Landesflaggen als Hintergrund benutzen zu können, muss die Datei "jpgraph_flags.php" eingefügt werden (per include).',0),
25042 => array('Unbekanntes Hintergrundbild-Layout',0),
25043 => array('Unbekannter Titelhintergrund-Stil.',0),
25044 => array('Automatisches Skalieren kann nicht verwendet werden, weil es unmöglich ist, einen gültigen min/max Wert für die Y-Achse zu ermitteln (nur Null-Werte).',0),
25045 => array('Die Schriftfamilien FF_HANDWRT und FF_BOOK sind wegen Copyright-Problemen nicht mehr verfügbar. Diese Schriften können nicht mehr mit JpGraph verteilt werden. Bitte lade Dir Schriften von http://corefonts.sourceforge.net/ herunter.',0),
25046 => array('Angegebene TTF-Schriftfamilie (id=%d) ist unbekannt oder existiert nicht. Bitte merke Dir, dass TTF-Schriften wegen Copyright-Problemen nicht mit JpGraph mitgeliefert werden. Du findest MS-TTF-Internetschriften (arial, courier, etc.) zum Herunterladen unter http://corefonts.sourceforge.net/',1),
25047 => array('Stil %s ist nicht verfügbar für Schriftfamilie %s',2),
25048 => array('Unbekannte Schriftstildefinition [%s].',1),
25049 => array('Schriftdatei "%s" ist nicht lesbar oder existiert nicht.',1),
25050 => array('Erstes Argument für Text::Text() muss ein String sein.',0),
25051 => array('Ungültige Richtung angegeben für Text.',0),
25052 => array('PANIK: Interner Fehler in SuperScript::Stroke(). Unbekannte vertikale Ausrichtung für Text.',0),
25053 => array('PANIK: Interner Fehler in SuperScript::Stroke(). Unbekannte horizontale Ausrichtung für Text.',0),
25054 => array('Interner Fehler: Unbekannte Grid-Achse %s',1),
25055 => array('Axis::SetTickDirection() sollte nicht mehr verwendet werden. Benutze stattdessen Axis::SetTickSide().',0),
25056 => array('SetTickLabelMargin() sollte nicht mehr verwendet werden. Benutze stattdessen Axis::SetLabelMargin().',0),
25057 => array('SetTextTicks() sollte nicht mehr verwendet werden. Benutze stattdessen SetTextTickInterval().',0),
25058 => array('TextLabelIntevall >= 1 muss angegeben werden.',0),
25059 => array('SetLabelPos() sollte nicht mehr verwendet werden. Benutze stattdessen Axis::SetLabelSide().',0),
25060 => array('Unbekannte Ausrichtung angegeben für X-Achsentitel (%s).',1),
25061 => array('Unbekannte Ausrichtung angegeben für Y-Achsentitel (%s).',1),
25062 => array('Label unter einem Winkel werden für die Y-Achse nicht unterstützt.',0),
25063 => array('Ticks::SetPrecision() sollte nicht mehr verwendet werden. Benutze stattdessen Ticks::SetLabelFormat() (oder Ticks::SetFormatCallback()).',0),
25064 => array('Kleinere oder größere Schrittgröße ist 0. Überprüfe, ob Du fälschlicherweise SetTextTicks(0) in Deinem Skript hast. Wenn dies nicht der Fall ist, bist Du eventuell über einen Bug in JpGraph gestolpert. Bitte sende einen Report und füge den Code an, der den Fehler verursacht hat.',0),
25065 => array('Tick-Positionen müssen als array() angegeben werden',0),
25066 => array('Wenn die Tick-Positionen und -Label von Hand eingegeben werden, muss die Anzahl der Ticks und der Label gleich sein.',0),
25067 => array('Deine von Hand eingegebene Achse und Ticks sind nicht korrekt. Die Skala scheint zu klein zu sein für den Tickabstand.',0),
25068 => array('Ein Plot hat eine ungültige Achse. Dies kann beispielsweise der Fall sein, wenn Du automatisches Text-Skalieren verwendest, um ein Liniendiagramm zu zeichnen mit nur einem Datenpunkt, oder wenn die Bildfläche zu klein ist. Es kann auch der Fall sein, dass kein Datenpunkt einen numerischen Wert hat (vielleicht nur \'-\' oder \'x\').',0),
25069 => array('Grace muss größer sein als 0',0),
25070 => array('Deine Daten enthalten nicht-numerische Werte.',0),
25071 => array('Du hast mit SetAutoMin() einen Mindestwert angegeben, der größer ist als der Maximalwert für die Achse. Dies ist nicht möglich.',0),
25072 => array('Du hast mit SetAutoMax() einen Maximalwert angegeben, der kleiner ist als der Minimalwert der Achse. Dies ist nicht möglich.',0),
25073 => array('Interner Fehler. Der Integer-Skalierungs-Algorithmus-Vergleich ist außerhalb der Grenzen (r=%f).',1),
25074 => array('Interner Fehler. Der Skalierungsbereich ist negativ (%f) [für %s Achse]. Dieses Problem könnte verursacht werden durch den Versuch, \'ungültige\' Werte in die Daten-Vektoren einzugeben (z.B. nur String- oder NULL-Werte), was beim automatischen Skalieren einen Fehler erzeugt.',2),
25075 => array('Die automatischen Ticks können nicht gesetzt werden, weil min==max.',0),
25077 => array('Einstellfaktor für die Farbe muss größer sein als 0',0),
25078 => array('Unbekannte Farbe: %s',1),
25079 => array('Unbekannte Farbdefinition: %s, Größe=%d',2),
25080 => array('Der Alpha-Parameter für Farben muss zwischen 0.0 und 1.0 liegen.',0),
25081 => array('Das ausgewählte Grafikformat wird entweder nicht unterstützt oder ist unbekannt [%s]',1),
25082 => array('Es wurden ungültige Größen für Breite und Höhe beim Erstellen des Bildes definiert (Breite=%d, Höhe=%d).',2),
25083 => array('Es wurde eine ungültige Größe beim Kopieren des Bildes angegeben. Die Größe für das kopierte Bild wurde auf 1 Pixel oder weniger gesetzt.',0),
25084 => array('Fehler beim Erstellen eines temporären GD-Canvas. Möglicherweise liegt ein Arbeitsspeicherproblem vor.',0),
25085 => array('Ein Bild kann nicht aus dem angegebenen String erzeugt werden. Er ist entweder in einem nicht unterstützen Format oder er represäntiert ein kaputtes Bild.',0),
25086 => array('Du scheinst nur GD 1.x installiert zu haben. Um Alphablending zu aktivieren, ist GD 2.x oder höher notwendig. Bitte installiere GD 2.x oder versichere Dich, dass die Konstante USE_GD2 richtig gesetzt ist. Standardmäßig wird die installierte GD-Version automatisch erkannt. Ganz selten wird GD2 erkannt, obwohl nur GD1 installiert ist. Die Konstante USE_GD2 muss dann zu "false" gesetzt werden.',0),
25087 => array('Diese PHP-Version wurde ohne TTF-Unterstützung konfiguriert. PHP muss mit TTF-Unterstützung neu kompiliert und installiert werden.',0),
25088 => array('Die GD-Schriftunterstützung wurde falsch konfiguriert. Der Aufruf von imagefontwidth() ist fehlerhaft.',0),
25089 => array('Die GD-Schriftunterstützung wurde falsch konfiguriert. Der Aufruf von imagefontheight() ist fehlerhaft.',0),
25090 => array('Unbekannte Richtung angegeben im Aufruf von StrokeBoxedText() [%s].',1),
25091 => array('Die interne Schrift untestützt das Schreiben von Text in einem beliebigen Winkel nicht. Benutze stattdessen TTF-Schriften.',0),
25092 => array('Es liegt entweder ein Konfigurationsproblem mit TrueType oder ein Problem beim Lesen der Schriftdatei "%s" vor. Versichere Dich, dass die Datei existiert und Leserechte und -pfad vergeben sind. (wenn \'basedir\' restriction in PHP aktiviert ist, muss die Schriftdatei im Dokumentwurzelverzeichnis abgelegt werden). Möglicherweise ist die FreeType-Bibliothek falsch installiert. Versuche, mindestens zur FreeType-Version 2.1.13 zu aktualisieren und kompiliere GD mit einem korrekten Setup neu, damit die FreeType-Bibliothek gefunden werden kann.',1),
25093 => array('Die Schriftdatei "%s" kann nicht gelesen werden beim Aufruf von Image::GetBBoxTTF. Bitte versichere Dich, dass die Schrift gesetzt wurde, bevor diese Methode aufgerufen wird, und dass die Schrift im TTF-Verzeichnis installiert ist.',1),
25094 => array('Die Textrichtung muss in einem Winkel zwischen 0 und 90 engegeben werden.',0),
25095 => array('Unbekannte Schriftfamilien-Definition. ',0),
25096 => array('Der Farbpalette können keine weiteren Farben zugewiesen werden. Dem Bild wurde bereits die größtmögliche Anzahl von Farben (%d) zugewiesen und die Palette ist voll. Verwende stattdessen ein TrueColor-Bild',0),
25097 => array('Eine Farbe wurde als leerer String im Aufruf von PushColor() angegegeben.',0),
25098 => array('Negativer Farbindex. Unpassender Aufruf von PopColor().',0),
25099 => array('Die Parameter für Helligkeit und Kontrast sind außerhalb des zulässigen Bereichs [-1,1]',0),
25100 => array('Es liegt ein Problem mit der Farbpalette und dem GD-Setup vor. Bitte deaktiviere anti-aliasing oder verwende GD2 mit TrueColor. Wenn die GD2-Bibliothek installiert ist, versichere Dich, dass die Konstante USE_GD2 auf "true" gesetzt und TrueColor aktiviert ist.',0),
25101 => array('Ungültiges numerisches Argument für SetLineStyle(): (%d)',1),
25102 => array('Ungültiges String-Argument für SetLineStyle(): %s',1),
25103 => array('Ungültiges Argument für SetLineStyle %s',1),
25104 => array('Unbekannter Linientyp: %s',1),
25105 => array('Es wurden NULL-Daten für ein gefülltes Polygon angegeben. Sorge dafür, dass keine NULL-Daten angegeben werden.',0),
25106 => array('Image::FillToBorder : es können keine weiteren Farben zugewiesen werden.',0),
25107 => array('In Datei "%s" kann nicht geschrieben werden. Überprüfe die aktuellen Schreibrechte.',1),
25108 => array('Das Bild kann nicht gestreamt werden. Möglicherweise liegt ein Fehler im PHP/GD-Setup vor. Kompiliere PHP neu und verwende die eingebaute GD-Bibliothek, die mit PHP angeboten wird.',0),
25109 => array('Deine PHP- (und GD-lib-) Installation scheint keine bekannten Grafikformate zu unterstützen. Sorge zunächst dafür, dass GD als PHP-Modul kompiliert ist. Wenn Du außerdem JPEG-Bilder verwenden willst, musst Du die JPEG-Bibliothek installieren. Weitere Details sind in der PHP-Dokumentation zu finden.',0),
25110 => array('Dein PHP-Installation unterstützt das gewählte Grafikformat nicht: %s',1),
25111 => array('Das gecachete Bild %s kann nicht gelöscht werden. Problem mit den Rechten?',1),
25112 => array('Das Datum der gecacheten Datei (%s) liegt in der Zukunft.',1),
25113 => array('Das gecachete Bild %s kann nicht gelöscht werden. Problem mit den Rechten?',1),
25114 => array('PHP hat nicht die erforderlichen Rechte, um in die Cache-Datei %s zu schreiben. Bitte versichere Dich, dass der Benutzer, der PHP anwendet, die entsprechenden Schreibrechte für die Datei hat, wenn Du das Cache-System in JPGraph verwenden willst.',1),
25115 => array('Berechtigung für gecachetes Bild %s kann nicht gesetzt werden. Problem mit den Rechten?',1),
25116 => array('Datei kann nicht aus dem Cache %s geöffnet werden',1),
25117 => array('Gecachetes Bild %s kann nicht zum Lesen geöffnet werden.',1),
25118 => array('Verzeichnis %s kann nicht angelegt werden. Versichere Dich, dass PHP die Schreibrechte in diesem Verzeichnis hat.',1),
25119 => array('Rechte für Datei %s können nicht gesetzt werden. Problem mit den Rechten?',1),
25120 => array('Die Position für die Legende muss als Prozentwert im Bereich 0-1 angegeben werden.',0),
25121 => array('Eine leerer Datenvektor wurde für den Plot eingegeben. Es muss wenigstens ein Datenpunkt vorliegen.',0),
25122 => array('Stroke() muss als Subklasse der Klasse Plot definiert sein.',0),
25123 => array('Du kannst keine Text-X-Achse mit X-Koordinaten verwenden. Benutze stattdessen eine "int" oder "lin" Achse.',0),
25124 => array('Der Eingabedatenvektor mus aufeinanderfolgende Werte von 0 aufwärts beinhalten. Der angegebene Y-Vektor beginnt mit leeren Werten (NULL).',0),
25125 => array('Ungültige Richtung für statische Linie.',0),
25126 => array('Es kann kein TrueColor-Bild erzeugt werden. Überprüfe, ob die GD2-Bibliothek und PHP korrekt aufgesetzt wurden.',0),
25127 => array('The library has been configured for automatic encoding conversion of Japanese fonts. This requires that PHP has the mb_convert_encoding() function. Your PHP installation lacks this function (PHP needs the "--enable-mbstring" when compiled).',0),
25128 => array('The function imageantialias() is not available in your PHP installation. Use the GD version that comes with PHP and not the standalone version.',0),
25129 => array('Anti-alias can not be used with dashed lines. Please disable anti-alias or use solid lines.',0),
25130 => array('Too small plot area. (%d x %d). With the given image size and margins there is to little space left for the plot. Increase the plot size or reduce the margins.',2),
25131 => array('StrokeBoxedText2() only supports TTF fonts and not built-in bitmap fonts.',0),
25132 => array('Undefined property %s.',1), // @todo translate
25133 => array('Use Graph::SetTheme() after Graph::SetScale().',0), // @todo translate
/*
** jpgraph_led
*/
25500 => array('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.',0),
/*
**---------------------------------------------------------------------------------------------
** Pro-version strings
**---------------------------------------------------------------------------------------------
*/
/*
** jpgraph_table
*/
27001 => array('GTextTable: Ungültiges Argument für Set(). Das Array-Argument muss 2-- dimensional sein.',0),
27002 => array('GTextTable: Ungültiges Argument für Set()',0),
27003 => array('GTextTable: Falsche Anzahl von Argumenten für GTextTable::SetColor()',0),
27004 => array('GTextTable: Angegebener Zellenbereich, der verschmolzen werden soll, ist ungültig.',0),
27005 => array('GTextTable: Bereits verschmolzene Zellen im Bereich (%d,%d) bis (%d,%d) können nicht ein weiteres Mal verschmolzen werden.',4),
27006 => array('GTextTable: Spalten-Argument = %d liegt außerhalb der festgelegten Tabellengröße.',1),
27007 => array('GTextTable: Zeilen-Argument = %d liegt außerhalb der festgelegten Tabellengröße.',1),
27008 => array('GTextTable: Spalten- und Zeilengröße müssen zu den Dimensionen der Tabelle passen.',0),
27009 => array('GTextTable: Die Anzahl der Tabellenspalten oder -zeilen ist 0. Versichere Dich, dass die Methoden Init() oder Set() aufgerufen werden.',0),
27010 => array('GTextTable: Es wurde keine Ausrichtung beim Aufruf von SetAlign() angegeben.',0),
27011 => array('GTextTable: Es wurde eine unbekannte Ausrichtung beim Aufruf von SetAlign() abgegeben. Horizontal=%s, Vertikal=%s',2),
27012 => array('GTextTable: Interner Fehler. Es wurde ein ungültiges Argument festgeleget %s',1),
27013 => array('GTextTable: Das Argument für FormatNumber() muss ein String sein.',0),
27014 => array('GTextTable: Die Tabelle wurde weder mit einem Aufruf von Set() noch von Init() initialisiert.',0),
27015 => array('GTextTable: Der Zellenbildbedingungstyp muss entweder TIMG_WIDTH oder TIMG_HEIGHT sein.',0),
/*
** jpgraph_windrose
*/
22001 => array('Die Gesamtsumme der prozentualen Anteile aller Windrosenarme darf 100%% nicht überschreiten!\n(Aktuell max: %d)',1),
22002 => array('Das Bild ist zu klein für eine Skala. Bitte vergrößere das Bild.',0),
22004 => array('Die Etikettendefinition für Windrosenrichtungen müssen 16 Werte haben (eine für jede Kompassrichtung).',0),
22005 => array('Der Linientyp für radiale Linien muss einer von ("solid","dotted","dashed","longdashed") sein.',0),
22006 => array('Es wurde ein ungültiger Windrosentyp angegeben.',0),
22007 => array('Es wurden zu wenig Werte für die Bereichslegende angegeben.',0),
22008 => array('Interner Fehler: Versuch, eine freie Windrose zu plotten, obwohl der Typ keine freie Windrose ist.',0),
22009 => array('Du hast die gleiche Richtung zweimal angegeben, einmal mit einem Winkel und einmal mit einer Kompassrichtung (%f Grad).',0),
22010 => array('Die Richtung muss entweder ein numerischer Wert sein oder eine der 16 Kompassrichtungen',0),
22011 => array('Der Windrosenindex muss ein numerischer oder Richtungswert sein. Du hast angegeben Index=%d',1),
22012 => array('Die radiale Achsendefinition für die Windrose enthält eine nicht aktivierte Richtung.',0),
22013 => array('Du hast dasselbe Look&Feel für die gleiche Kompassrichtung zweimal engegeben, einmal mit Text und einmal mit einem Index (Index=%d)',1),
22014 => array('Der Index für eine Kompassrichtung muss zwischen 0 und 15 sein.',0),
22015 => array('Du hast einen unbekannten Windrosenplottyp angegeben.',0),
22016 => array('Der Windrosenarmindex muss ein numerischer oder ein Richtungswert sein.',0),
22017 => array('Die Windrosendaten enthalten eine Richtung, die nicht aktiviert ist. Bitte berichtige, welche Label angezeigt werden sollen.',0),
22018 => array('Du hast für dieselbe Kompassrichtung zweimal Daten angegeben, einmal mit Text und einmal mit einem Index (Index=%d)',1),
22019 => array('Der Index für eine Richtung muss zwischen 0 und 15 sein. Winkel dürfen nicht für einen regelmäßigen Windplot angegeben werden, sondern entweder ein Index oder eine Kompassrichtung.',0),
22020 => array('Der Windrosenplot ist zu groß für die angegebene Bildgröße. Benutze entweder WindrosePlot::SetSize(), um den Plot kleiner zu machen oder vergrößere das Bild im ursprünglichen Aufruf von WindroseGraph().',0),
22021 => array('It is only possible to add Text, IconPlot or WindrosePlot to a Windrose Graph',0),
/*
** jpgraph_odometer
*/
13001 => array('Unbekannter Nadeltypstil (%d).',1),
13002 => array('Ein Wert für das Odometer (%f) ist außerhalb des angegebenen Bereichs [%f,%f]',3),
/*
** jpgraph_barcode
*/
1001 => array('Unbekannte Kodier-Specifikation: %s',1),
1002 => array('datenvalidierung schlug fehl. [%s] kann nicht mittels der Kodierung "%s" kodiert werden',2),
1003 => array('Interner Kodierfehler. Kodieren von %s ist nicht möglich in Code 128',1),
1004 => array('Interner barcode Fehler. Unbekannter UPC-E Kodiertyp: %s',1),
1005 => array('Interner Fehler. Das Textzeichen-Tupel (%s, %s) kann nicht im Code-128 Zeichensatz C kodiert werden.',2),
1006 => array('Interner Kodierfehler für CODE 128. Es wurde versucht, CTRL in CHARSET != A zu kodieren.',0),
1007 => array('Interner Kodierfehler für CODE 128. Es wurde versucht, DEL in CHARSET != B zu kodieren.',0),
1008 => array('Interner Kodierfehler für CODE 128. Es wurde versucht, kleine Buchstaben in CHARSET != B zu kodieren.',0),
1009 => array('Kodieren mittels CODE 93 wird noch nicht unterstützt.',0),
1010 => array('Kodieren mittels POSTNET wird noch nicht unterstützt.',0),
1011 => array('Nicht untrstütztes Barcode-Backend für den Typ %s',1),
/*
** PDF417
*/
26000 => array('PDF417: The PDF417 module requires that the PHP installation must support the function bcmod(). This is normally enabled at compile time. See documentation for more information.',0),
26001 => array('PDF417: Die Anzahl der Spalten muss zwischen 1 und 30 sein.',0),
26002 => array('PDF417: Der Fehler-Level muss zwischen 0 und 8 sein.',0),
26003 => array('PDF417: Ungültiges Format für Eingabedaten, um sie mit PDF417 zu kodieren.',0),
26004 => array('PDF417: die eigebenen Daten können nicht mit Fehler-Level %d und %d spalten kodiert werden, weil daraus zu viele Symbole oder mehr als 90 Zeilen resultieren.',2),
26005 => array('PDF417: Die Datei "%s" kann nicht zum Schreiben geöffnet werden.',1),
26006 => array('PDF417: Interner Fehler. Die Eingabedatendatei für PDF417-Cluster %d ist fehlerhaft.',1),
26007 => array('PDF417: Interner Fehler. GetPattern: Ungültiger Code-Wert %d (Zeile %d)',2),
26008 => array('PDF417: Interner Fehler. Modus wurde nicht in der Modusliste!! Modus %d',1),
26009 => array('PDF417: Kodierfehler: Ungültiges Zeichen. Zeichen kann nicht mit ASCII-Code %d kodiert werden.',1),
26010 => array('PDF417: Interner Fehler: Keine Eingabedaten beim Dekodieren.',0),
26011 => array('PDF417: Kodierfehler. Numerisches Kodieren bei nicht-numerischen Daten nicht möglich.',0),
26012 => array('PDF417: Interner Fehler. Es wurden für den Binary-Kompressor keine Daten zum Dekodieren eingegeben.',0),
26013 => array('PDF417: Interner Fehler. Checksum Fehler. Koeffiziententabellen sind fehlerhaft.',0),
26014 => array('PDF417: Interner Fehler. Es wurden keine Daten zum Berechnen von Kodewörtern eingegeben.',0),
26015 => array('PDF417: Interner Fehler. Ein Eintrag 0 in die Statusübertragungstabellen ist nicht NULL. Eintrag 1 = (%s)',1),
26016 => array('PDF417: Interner Fehler: Nichtregistrierter Statusübertragungsmodus beim Dekodieren.',0),
/*
** jpgraph_contour
*/
28001 => array('Dritten parameter fur Contour muss ein vector der fargen sind.',0),
28002 => array('Die anzahlen der farges jeder isobar linien muss gleich sein.',0),
28003 => array('ContourPlot Interner Fehler: isobarHCrossing: Spalten index ist zu hoch (%d)',1),
28004 => array('ContourPlot Interner Fehler: isobarHCrossing: Reihe index ist zu hoch (%d)',1),
28005 => array('ContourPlot Interner Fehler: isobarVCrossing: Reihe index ist zu hoch (%d)',1),
28006 => array('ContourPlot Interner Fehler: isobarVCrossing: Spalten index ist zu hoch (%d)',1),
28007 => array('ContourPlot. Interpolation faktor ist zu hoch (>5)',0),
/*
* jpgraph_matrix and colormap
*/
29201 => array('Min range value must be less or equal to max range value for colormaps',0),
29202 => array('The distance between min and max value is too small for numerical precision',0),
29203 => array('Number of color quantification level must be at least %d',1),
29204 => array('Number of colors (%d) is invalid for this colormap. It must be a number that can be written as: %d + k*%d',3),
29205 => array('Colormap specification out of range. Must be an integer in range [0,%d]',1),
29206 => array('Invalid object added to MatrixGraph',0),
29207 => array('Empty input data specified for MatrixPlot',0),
29208 => array('Unknown side specifiction for matrix labels "%s"',1),
29209 => array('CSIM Target matrix must be the same size as the data matrix (csim=%d x %d, data=%d x %d)',4),
29210 => array('CSIM Target for matrix labels does not match the number of labels (csim=%d, labels=%d)',2),
/*
* jpgraph_theme
*/
30001 => array("Theme::%s() is not defined. \nPlease make %s(\$graph) function in your theme classs.",2),
);
?>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,386 @@
<?php
/*=======================================================================
// File: PROD.INC.PHP
// Description: Special localization file with the same error messages
// for all errors.
// Created: 2006-02-18
// Ver: $Id: prod.inc.php 1886 2009-10-01 23:30:16Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
*/
// The single error message for all errors
DEFINE('DEFAULT_ERROR_MESSAGE','We are sorry but the system could not generate the requested image. Please contact site support to resolve this problem. Problem no: #');
// Note: Format of each error message is array(<error message>,<number of arguments>)
$_jpg_messages = array(
/*
** Headers already sent error. This is formatted as HTML different since this will be sent back directly as text
*/
10 => array('<table border=1><tr><td><font color=darkred size=4><b>JpGraph Error:</b>
HTTP headers have already been sent.<br>Caused by output from file <b>%s</b> at line <b>%d</b>.</font></td></tr><tr><td><b>Explanation:</b><br>HTTP headers have already been sent back to the browser indicating the data as text before the library got a chance to send it\'s image HTTP header to this browser. This makes it impossible for the library to send back image data to the browser (since that would be interpretated as text by the browser and show up as junk text).<p>Most likely you have some text in your script before the call to <i>Graph::Stroke()</i>. If this texts gets sent back to the browser the browser will assume that all data is plain text. Look for any text, even spaces and newlines, that might have been sent back to the browser. <p>For example it is a common mistake to leave a blank line before the opening "<b>&lt;?php</b>".</td></tr></table>',2),
11 => array(DEFAULT_ERROR_MESSAGE.'11',0),
12 => array(DEFAULT_ERROR_MESSAGE.'12',0),
13 => array(DEFAULT_ERROR_MESSAGE.'13',0),
2001 => array(DEFAULT_ERROR_MESSAGE.'2001',0),
2002 => array(DEFAULT_ERROR_MESSAGE.'2002',0),
2003 => array(DEFAULT_ERROR_MESSAGE.'2003',0),
2004 => array(DEFAULT_ERROR_MESSAGE.'2004',0),
2005 => array(DEFAULT_ERROR_MESSAGE.'2005',0),
2006 => array(DEFAULT_ERROR_MESSAGE.'2006',0),
2007 => array(DEFAULT_ERROR_MESSAGE.'2007',0),
2008 => array(DEFAULT_ERROR_MESSAGE.'2008',0),
2009 => array(DEFAULT_ERROR_MESSAGE.'2009',0),
2010 => array(DEFAULT_ERROR_MESSAGE.'2010',0),
2011 => array(DEFAULT_ERROR_MESSAGE.'2011',0),
2012 => array(DEFAULT_ERROR_MESSAGE.'2012',0),
2013 => array(DEFAULT_ERROR_MESSAGE.'2013',0),
2014 => array(DEFAULT_ERROR_MESSAGE.'2014',0),
3001 => array(DEFAULT_ERROR_MESSAGE.'3001',0),
4002 => array(DEFAULT_ERROR_MESSAGE.'4002',0),
5001 => array(DEFAULT_ERROR_MESSAGE.'5001',0),
5002 => array(DEFAULT_ERROR_MESSAGE.'5002',0),
5003 => array(DEFAULT_ERROR_MESSAGE.'5003',0),
5004 => array(DEFAULT_ERROR_MESSAGE.'5004',0),
6001 => array(DEFAULT_ERROR_MESSAGE.'6001',0),
6002 => array(DEFAULT_ERROR_MESSAGE.'6002',0),
6003 => array(DEFAULT_ERROR_MESSAGE.'6003',0),
6004 => array(DEFAULT_ERROR_MESSAGE.'6004',0),
6005 => array(DEFAULT_ERROR_MESSAGE.'6005',0),
6006 => array(DEFAULT_ERROR_MESSAGE.'6006',0),
6007 => array(DEFAULT_ERROR_MESSAGE.'6007',0),
6008 => array(DEFAULT_ERROR_MESSAGE.'6008',0),
6009 => array(DEFAULT_ERROR_MESSAGE.'6009',0),
6010 => array(DEFAULT_ERROR_MESSAGE.'6010',0),
6011 => array(DEFAULT_ERROR_MESSAGE.'6011',0),
6012 => array(DEFAULT_ERROR_MESSAGE.'6012',0),
6015 => array(DEFAULT_ERROR_MESSAGE.'6015',0),
6016 => array(DEFAULT_ERROR_MESSAGE.'6016',0),
6017 => array(DEFAULT_ERROR_MESSAGE.'6017',0),
6018 => array(DEFAULT_ERROR_MESSAGE.'6018',0),
6019 => array(DEFAULT_ERROR_MESSAGE.'6019',0),
6020 => array(DEFAULT_ERROR_MESSAGE.'6020',0),
6021 => array(DEFAULT_ERROR_MESSAGE.'6021',0),
6022 => array(DEFAULT_ERROR_MESSAGE.'6022',0),
6023 => array(DEFAULT_ERROR_MESSAGE.'6023',0),
6024 => array(DEFAULT_ERROR_MESSAGE.'6024',0),
6025 => array(DEFAULT_ERROR_MESSAGE.'6025',0),
6027 => array(DEFAULT_ERROR_MESSAGE.'6027',0),
6028 => array(DEFAULT_ERROR_MESSAGE.'6028',0),
6029 => array(DEFAULT_ERROR_MESSAGE.'6029',0),
6030 => array(DEFAULT_ERROR_MESSAGE.'6030',0),
6031 => array(DEFAULT_ERROR_MESSAGE.'6031',0),
6032 => array(DEFAULT_ERROR_MESSAGE.'6032',0),
6033 => array(DEFAULT_ERROR_MESSAGE.'6033',0),
7001 => array(DEFAULT_ERROR_MESSAGE.'7001',0),
8001 => array(DEFAULT_ERROR_MESSAGE.'8001',0),
8002 => array(DEFAULT_ERROR_MESSAGE.'8002',0),
8003 => array(DEFAULT_ERROR_MESSAGE.'8003',0),
8004 => array(DEFAULT_ERROR_MESSAGE.'8004',0),
9001 => array(DEFAULT_ERROR_MESSAGE.'9001',0),
10001 => array(DEFAULT_ERROR_MESSAGE.'10001',0),
10002 => array(DEFAULT_ERROR_MESSAGE.'10002',0),
10003 => array(DEFAULT_ERROR_MESSAGE.'10003',0),
11001 => array(DEFAULT_ERROR_MESSAGE.'11001',0),
11002 => array(DEFAULT_ERROR_MESSAGE.'11002',0),
11003 => array(DEFAULT_ERROR_MESSAGE.'11003',0),
11004 => array(DEFAULT_ERROR_MESSAGE.'11004',0),
11005 => array(DEFAULT_ERROR_MESSAGE.'11005',0),
12001 => array(DEFAULT_ERROR_MESSAGE.'12001',0),
12002 => array(DEFAULT_ERROR_MESSAGE.'12002',0),
12003 => array(DEFAULT_ERROR_MESSAGE.'12003',0),
12004 => array(DEFAULT_ERROR_MESSAGE.'12004',0),
12005 => array(DEFAULT_ERROR_MESSAGE.'12005',0),
12006 => array(DEFAULT_ERROR_MESSAGE.'12006',0),
12007 => array(DEFAULT_ERROR_MESSAGE.'12007',0),
12008 => array(DEFAULT_ERROR_MESSAGE.'12008',0),
12009 => array(DEFAULT_ERROR_MESSAGE.'12009',0),
12010 => array(DEFAULT_ERROR_MESSAGE.'12010',0),
12011 => array(DEFAULT_ERROR_MESSAGE.'12011',0),
12012 => array(DEFAULT_ERROR_MESSAGE.'12012',0),
14001 => array(DEFAULT_ERROR_MESSAGE.'14001',0),
14002 => array(DEFAULT_ERROR_MESSAGE.'14002',0),
14003 => array(DEFAULT_ERROR_MESSAGE.'14003',0),
14004 => array(DEFAULT_ERROR_MESSAGE.'14004',0),
14005 => array(DEFAULT_ERROR_MESSAGE.'14005',0),
14006 => array(DEFAULT_ERROR_MESSAGE.'14006',0),
14007 => array(DEFAULT_ERROR_MESSAGE.'14007',0),
15001 => array(DEFAULT_ERROR_MESSAGE.'15001',0),
15002 => array(DEFAULT_ERROR_MESSAGE.'15002',0),
15003 => array(DEFAULT_ERROR_MESSAGE.'15003',0),
15004 => array(DEFAULT_ERROR_MESSAGE.'15004',0),
15005 => array(DEFAULT_ERROR_MESSAGE.'15005',0),
15006 => array(DEFAULT_ERROR_MESSAGE.'15006',0),
15007 => array(DEFAULT_ERROR_MESSAGE.'15007',0),
15008 => array(DEFAULT_ERROR_MESSAGE.'15008',0),
15009 => array(DEFAULT_ERROR_MESSAGE.'15009',0),
15010 => array(DEFAULT_ERROR_MESSAGE.'15010',0),
15011 => array(DEFAULT_ERROR_MESSAGE.'15011',0),
15012 => array(DEFAULT_ERROR_MESSAGE.'15012',0),
16001 => array(DEFAULT_ERROR_MESSAGE.'16001',0),
16002 => array(DEFAULT_ERROR_MESSAGE.'16002',0),
16003 => array(DEFAULT_ERROR_MESSAGE.'16003',0),
16004 => array(DEFAULT_ERROR_MESSAGE.'16004',0),
17001 => array(DEFAULT_ERROR_MESSAGE.'17001',0),
17002 => array(DEFAULT_ERROR_MESSAGE.'17002',0),
17004 => array(DEFAULT_ERROR_MESSAGE.'17004',0),
18001 => array(DEFAULT_ERROR_MESSAGE.'18001',0),
18002 => array(DEFAULT_ERROR_MESSAGE.'18002',0),
18003 => array(DEFAULT_ERROR_MESSAGE.'18003',0),
18004 => array(DEFAULT_ERROR_MESSAGE.'18004',0),
18005 => array(DEFAULT_ERROR_MESSAGE.'18005',0),
18006 => array(DEFAULT_ERROR_MESSAGE.'18006',0),
18007 => array(DEFAULT_ERROR_MESSAGE.'18007',0),
18008 => array(DEFAULT_ERROR_MESSAGE.'18008',0),
19001 => array(DEFAULT_ERROR_MESSAGE.'19001',0),
19002 => array(DEFAULT_ERROR_MESSAGE.'19002',0),
19003 => array(DEFAULT_ERROR_MESSAGE.'19003',0),
20001 => array(DEFAULT_ERROR_MESSAGE.'20001',0),
20002 => array(DEFAULT_ERROR_MESSAGE.'20002',0),
20003 => array(DEFAULT_ERROR_MESSAGE.'20003',0),
21001 => array(DEFAULT_ERROR_MESSAGE.'21001',0),
23001 => array(DEFAULT_ERROR_MESSAGE.'23001',0),
23002 => array(DEFAULT_ERROR_MESSAGE.'23002',0),
23003 => array(DEFAULT_ERROR_MESSAGE.'23003',0),
24001 => array(DEFAULT_ERROR_MESSAGE.'24001',0),
24002 => array(DEFAULT_ERROR_MESSAGE.'24002',0),
24003 => array(DEFAULT_ERROR_MESSAGE.'24003',0),
24004 => array(DEFAULT_ERROR_MESSAGE.'24004',0),
25001 => array(DEFAULT_ERROR_MESSAGE.'25001',0),
25002 => array(DEFAULT_ERROR_MESSAGE.'25002',0),
25003 => array(DEFAULT_ERROR_MESSAGE.'25003',0),
25004 => array(DEFAULT_ERROR_MESSAGE.'25004',0),
25005 => array(DEFAULT_ERROR_MESSAGE.'25005',0),
25006 => array(DEFAULT_ERROR_MESSAGE.'25006',0),
25007 => array(DEFAULT_ERROR_MESSAGE.'25007',0),
25008 => array(DEFAULT_ERROR_MESSAGE.'25008',0),
25009 => array(DEFAULT_ERROR_MESSAGE.'25009',0),
25010 => array(DEFAULT_ERROR_MESSAGE.'25010',0),
25011 => array(DEFAULT_ERROR_MESSAGE.'25011',0),
25012 => array(DEFAULT_ERROR_MESSAGE.'25012',0),
25013 => array(DEFAULT_ERROR_MESSAGE.'25013',0),
25014 => array(DEFAULT_ERROR_MESSAGE.'25014',0),
25015 => array(DEFAULT_ERROR_MESSAGE.'25015',0),
25016 => array(DEFAULT_ERROR_MESSAGE.'25016',0),
25017 => array(DEFAULT_ERROR_MESSAGE.'25017',0),
25018 => array(DEFAULT_ERROR_MESSAGE.'25018',0),
25019 => array(DEFAULT_ERROR_MESSAGE.'25019',0),
25020 => array(DEFAULT_ERROR_MESSAGE.'25020',0),
25021 => array(DEFAULT_ERROR_MESSAGE.'25021',0),
25022 => array(DEFAULT_ERROR_MESSAGE.'25022',0),
25023 => array(DEFAULT_ERROR_MESSAGE.'25023',0),
25024 => array(DEFAULT_ERROR_MESSAGE.'25024',0),
25025 => array(DEFAULT_ERROR_MESSAGE.'25025',0),
25026 => array(DEFAULT_ERROR_MESSAGE.'25026',0),
25027 => array(DEFAULT_ERROR_MESSAGE.'25027',0),
25028 => array(DEFAULT_ERROR_MESSAGE.'25028',0),
25029 => array(DEFAULT_ERROR_MESSAGE.'25029',0),
25030 => array(DEFAULT_ERROR_MESSAGE.'25030',0),
25031 => array(DEFAULT_ERROR_MESSAGE.'25031',0),
25032 => array(DEFAULT_ERROR_MESSAGE.'25032',0),
25033 => array(DEFAULT_ERROR_MESSAGE.'25033',0),
25034 => array(DEFAULT_ERROR_MESSAGE.'25034',0),
25035 => array(DEFAULT_ERROR_MESSAGE.'25035',0),
25036 => array(DEFAULT_ERROR_MESSAGE.'25036',0),
25037 => array(DEFAULT_ERROR_MESSAGE.'25037',0),
25038 => array(DEFAULT_ERROR_MESSAGE.'25038',0),
25039 => array(DEFAULT_ERROR_MESSAGE.'25039',0),
25040 => array(DEFAULT_ERROR_MESSAGE.'25040',0),
25041 => array(DEFAULT_ERROR_MESSAGE.'25041',0),
25042 => array(DEFAULT_ERROR_MESSAGE.'25042',0),
25043 => array(DEFAULT_ERROR_MESSAGE.'25043',0),
25044 => array(DEFAULT_ERROR_MESSAGE.'25044',0),
25045 => array(DEFAULT_ERROR_MESSAGE.'25045',0),
25046 => array(DEFAULT_ERROR_MESSAGE.'25046',0),
25047 => array(DEFAULT_ERROR_MESSAGE.'25047',0),
25048 => array(DEFAULT_ERROR_MESSAGE.'25048',0),
25049 => array(DEFAULT_ERROR_MESSAGE.'25049',0),
25050 => array(DEFAULT_ERROR_MESSAGE.'25050',0),
25051 => array(DEFAULT_ERROR_MESSAGE.'25051',0),
25052 => array(DEFAULT_ERROR_MESSAGE.'25052',0),
25053 => array(DEFAULT_ERROR_MESSAGE.'25053',0),
25054 => array(DEFAULT_ERROR_MESSAGE.'25054',0),
25055 => array(DEFAULT_ERROR_MESSAGE.'25055',0),
25056 => array(DEFAULT_ERROR_MESSAGE.'25056',0),
25057 => array(DEFAULT_ERROR_MESSAGE.'25057',0),
25058 => array(DEFAULT_ERROR_MESSAGE.'25058',0),
25059 => array(DEFAULT_ERROR_MESSAGE.'25059',0),
25060 => array(DEFAULT_ERROR_MESSAGE.'25060',0),
25061 => array(DEFAULT_ERROR_MESSAGE.'25061',0),
25062 => array(DEFAULT_ERROR_MESSAGE.'25062',0),
25063 => array(DEFAULT_ERROR_MESSAGE.'25063',0),
25064 => array(DEFAULT_ERROR_MESSAGE.'25064',0),
25065 => array(DEFAULT_ERROR_MESSAGE.'25065',0),
25066 => array(DEFAULT_ERROR_MESSAGE.'25066',0),
25067 => array(DEFAULT_ERROR_MESSAGE.'25067',0),
25068 => array(DEFAULT_ERROR_MESSAGE.'25068',0),
25069 => array(DEFAULT_ERROR_MESSAGE.'25069',0),
25070 => array(DEFAULT_ERROR_MESSAGE.'25070',0),
25071 => array(DEFAULT_ERROR_MESSAGE.'25071',0),
25072 => array(DEFAULT_ERROR_MESSAGE.'25072',0),
25073 => array(DEFAULT_ERROR_MESSAGE.'25073',0),
25074 => array(DEFAULT_ERROR_MESSAGE.'25074',0),
25075 => array(DEFAULT_ERROR_MESSAGE.'25075',0),
25077 => array(DEFAULT_ERROR_MESSAGE.'25077',0),
25078 => array(DEFAULT_ERROR_MESSAGE.'25078',0),
25079 => array(DEFAULT_ERROR_MESSAGE.'25079',0),
25080 => array(DEFAULT_ERROR_MESSAGE.'25080',0),
25081 => array(DEFAULT_ERROR_MESSAGE.'25081',0),
25082 => array(DEFAULT_ERROR_MESSAGE.'25082',0),
25083 => array(DEFAULT_ERROR_MESSAGE.'25083',0),
25084 => array(DEFAULT_ERROR_MESSAGE.'25084',0),
25085 => array(DEFAULT_ERROR_MESSAGE.'25085',0),
25086 => array(DEFAULT_ERROR_MESSAGE.'25086',0),
25087 => array(DEFAULT_ERROR_MESSAGE.'25087',0),
25088 => array(DEFAULT_ERROR_MESSAGE.'25088',0),
25089 => array(DEFAULT_ERROR_MESSAGE.'25089',0),
25090 => array(DEFAULT_ERROR_MESSAGE.'25090',0),
25091 => array(DEFAULT_ERROR_MESSAGE.'25091',0),
25092 => array(DEFAULT_ERROR_MESSAGE.'25092',0),
25093 => array(DEFAULT_ERROR_MESSAGE.'25093',0),
25094 => array(DEFAULT_ERROR_MESSAGE.'25094',0),
25095 => array(DEFAULT_ERROR_MESSAGE.'25095',0),
25096 => array(DEFAULT_ERROR_MESSAGE.'25096',0),
25097 => array(DEFAULT_ERROR_MESSAGE.'25097',0),
25098 => array(DEFAULT_ERROR_MESSAGE.'25098',0),
25099 => array(DEFAULT_ERROR_MESSAGE.'25099',0),
25100 => array(DEFAULT_ERROR_MESSAGE.'25100',0),
25101 => array(DEFAULT_ERROR_MESSAGE.'25101',0),
25102 => array(DEFAULT_ERROR_MESSAGE.'25102',0),
25103 => array(DEFAULT_ERROR_MESSAGE.'25103',0),
25104 => array(DEFAULT_ERROR_MESSAGE.'25104',0),
25105 => array(DEFAULT_ERROR_MESSAGE.'25105',0),
25106 => array(DEFAULT_ERROR_MESSAGE.'25106',0),
25107 => array(DEFAULT_ERROR_MESSAGE.'25107',0),
25108 => array(DEFAULT_ERROR_MESSAGE.'25108',0),
25109 => array(DEFAULT_ERROR_MESSAGE.'25109',0),
25110 => array(DEFAULT_ERROR_MESSAGE.'25110',0),
25111 => array(DEFAULT_ERROR_MESSAGE.'25111',0),
25112 => array(DEFAULT_ERROR_MESSAGE.'25112',0),
25113 => array(DEFAULT_ERROR_MESSAGE.'25113',0),
25114 => array(DEFAULT_ERROR_MESSAGE.'25114',0),
25115 => array(DEFAULT_ERROR_MESSAGE.'25115',0),
25116 => array(DEFAULT_ERROR_MESSAGE.'25116',0),
25117 => array(DEFAULT_ERROR_MESSAGE.'25117',0),
25118 => array(DEFAULT_ERROR_MESSAGE.'25118',0),
25119 => array(DEFAULT_ERROR_MESSAGE.'25119',0),
25120 => array(DEFAULT_ERROR_MESSAGE.'25120',0),
25121 => array(DEFAULT_ERROR_MESSAGE.'25121',0),
25122 => array(DEFAULT_ERROR_MESSAGE.'25122',0),
25123 => array(DEFAULT_ERROR_MESSAGE.'25123',0),
25124 => array(DEFAULT_ERROR_MESSAGE.'25124',0),
25125 => array(DEFAULT_ERROR_MESSAGE.'25125',0),
25126 => array(DEFAULT_ERROR_MESSAGE.'25126',0),
25127 => array(DEFAULT_ERROR_MESSAGE.'25127',0),
25128 => array(DEFAULT_ERROR_MESSAGE.'25128',0),
25129 => array(DEFAULT_ERROR_MESSAGE.'25129',0),
25130 => array(DEFAULT_ERROR_MESSAGE.'25130',0),
25131 => array(DEFAULT_ERROR_MESSAGE.'25131',0),
25132 => array(DEFAULT_ERROR_MESSAGE.'25132',0),
25133 => array(DEFAULT_ERROR_MESSAGE.'25133',0),
25500 => array(DEFAULT_ERROR_MESSAGE.'25500',0),
24003 => array(DEFAULT_ERROR_MESSAGE.'24003',0),
24004 => array(DEFAULT_ERROR_MESSAGE.'24004',0),
24005 => array(DEFAULT_ERROR_MESSAGE.'24005',0),
24006 => array(DEFAULT_ERROR_MESSAGE.'24006',0),
24007 => array(DEFAULT_ERROR_MESSAGE.'24007',0),
24008 => array(DEFAULT_ERROR_MESSAGE.'24008',0),
24009 => array(DEFAULT_ERROR_MESSAGE.'24009',0),
24010 => array(DEFAULT_ERROR_MESSAGE.'24010',0),
24011 => array(DEFAULT_ERROR_MESSAGE.'24011',0),
24012 => array(DEFAULT_ERROR_MESSAGE.'24012',0),
24013 => array(DEFAULT_ERROR_MESSAGE.'24013',0),
24014 => array(DEFAULT_ERROR_MESSAGE.'24014',0),
24015 => array(DEFAULT_ERROR_MESSAGE.'24015',0),
22001 => array(DEFAULT_ERROR_MESSAGE.'22001',0),
22002 => array(DEFAULT_ERROR_MESSAGE.'22002',0),
22004 => array(DEFAULT_ERROR_MESSAGE.'22004',0),
22005 => array(DEFAULT_ERROR_MESSAGE.'22005',0),
22006 => array(DEFAULT_ERROR_MESSAGE.'22006',0),
22007 => array(DEFAULT_ERROR_MESSAGE.'22007',0),
22008 => array(DEFAULT_ERROR_MESSAGE.'22008',0),
22009 => array(DEFAULT_ERROR_MESSAGE.'22009',0),
22010 => array(DEFAULT_ERROR_MESSAGE.'22010',0),
22011 => array(DEFAULT_ERROR_MESSAGE.'22011',0),
22012 => array(DEFAULT_ERROR_MESSAGE.'22012',0),
22013 => array(DEFAULT_ERROR_MESSAGE.'22013',0),
22014 => array(DEFAULT_ERROR_MESSAGE.'22014',0),
22015 => array(DEFAULT_ERROR_MESSAGE.'22015',0),
22016 => array(DEFAULT_ERROR_MESSAGE.'22016',0),
22017 => array(DEFAULT_ERROR_MESSAGE.'22017',0),
22018 => array(DEFAULT_ERROR_MESSAGE.'22018',0),
22019 => array(DEFAULT_ERROR_MESSAGE.'22019',0),
22020 => array(DEFAULT_ERROR_MESSAGE.'22020',0),
13001 => array(DEFAULT_ERROR_MESSAGE.'13001',0),
13002 => array(DEFAULT_ERROR_MESSAGE.'13002',0),
1001 => array(DEFAULT_ERROR_MESSAGE.'1001',0),
1002 => array(DEFAULT_ERROR_MESSAGE.'1002',0),
1003 => array(DEFAULT_ERROR_MESSAGE.'1003',0),
1004 => array(DEFAULT_ERROR_MESSAGE.'1004',0),
1005 => array(DEFAULT_ERROR_MESSAGE.'1005',0),
1006 => array(DEFAULT_ERROR_MESSAGE.'1006',0),
1007 => array(DEFAULT_ERROR_MESSAGE.'1007',0),
1008 => array(DEFAULT_ERROR_MESSAGE.'1008',0),
1009 => array(DEFAULT_ERROR_MESSAGE.'1009',0),
1010 => array(DEFAULT_ERROR_MESSAGE.'1010',0),
1011 => array(DEFAULT_ERROR_MESSAGE.'1011',0),
26000 => array(DEFAULT_ERROR_MESSAGE.'26000',0),
26001 => array(DEFAULT_ERROR_MESSAGE.'26001',0),
26002 => array(DEFAULT_ERROR_MESSAGE.'26002',0),
26003 => array(DEFAULT_ERROR_MESSAGE.'26003',0),
26004 => array(DEFAULT_ERROR_MESSAGE.'26004',0),
26005 => array(DEFAULT_ERROR_MESSAGE.'26005',0),
26006 => array(DEFAULT_ERROR_MESSAGE.'26006',0),
26007 => array(DEFAULT_ERROR_MESSAGE.'26007',0),
26008 => array(DEFAULT_ERROR_MESSAGE.'26008',0),
26009 => array(DEFAULT_ERROR_MESSAGE.'26009',0),
26010 => array(DEFAULT_ERROR_MESSAGE.'26010',0),
26011 => array(DEFAULT_ERROR_MESSAGE.'26011',0),
26012 => array(DEFAULT_ERROR_MESSAGE.'26012',0),
26013 => array(DEFAULT_ERROR_MESSAGE.'26013',0),
26014 => array(DEFAULT_ERROR_MESSAGE.'26014',0),
26015 => array(DEFAULT_ERROR_MESSAGE.'26015',0),
26016 => array(DEFAULT_ERROR_MESSAGE.'26016',0),
27001 => array(DEFAULT_ERROR_MESSAGE.'27001',0),
27002 => array(DEFAULT_ERROR_MESSAGE.'27002',0),
27003 => array(DEFAULT_ERROR_MESSAGE.'27003',0),
27004 => array(DEFAULT_ERROR_MESSAGE.'27004',0),
27005 => array(DEFAULT_ERROR_MESSAGE.'27005',0),
27006 => array(DEFAULT_ERROR_MESSAGE.'27006',0),
27007 => array(DEFAULT_ERROR_MESSAGE.'27007',0),
27008 => array(DEFAULT_ERROR_MESSAGE.'27008',0),
27009 => array(DEFAULT_ERROR_MESSAGE.'27009',0),
27010 => array(DEFAULT_ERROR_MESSAGE.'27010',0),
27011 => array(DEFAULT_ERROR_MESSAGE.'27011',0),
27012 => array(DEFAULT_ERROR_MESSAGE.'27012',0),
27013 => array(DEFAULT_ERROR_MESSAGE.'27013',0),
27014 => array(DEFAULT_ERROR_MESSAGE.'27014',0),
27015 => array(DEFAULT_ERROR_MESSAGE.'27015',0),
28001 => array(DEFAULT_ERROR_MESSAGE.'28001',0),
28002 => array(DEFAULT_ERROR_MESSAGE.'28002',0),
28003 => array(DEFAULT_ERROR_MESSAGE.'28003',0),
28004 => array(DEFAULT_ERROR_MESSAGE.'28004',0),
28005 => array(DEFAULT_ERROR_MESSAGE.'28005',0),
28006 => array(DEFAULT_ERROR_MESSAGE.'28006',0),
28007 => array(DEFAULT_ERROR_MESSAGE.'28007',0),
29201 => array(DEFAULT_ERROR_MESSAGE.'28001',0),
29202 => array(DEFAULT_ERROR_MESSAGE.'28002',0),
29203 => array(DEFAULT_ERROR_MESSAGE.'28003',0),
29204 => array(DEFAULT_ERROR_MESSAGE.'28004',0),
29205 => array(DEFAULT_ERROR_MESSAGE.'28005',0),
29206 => array(DEFAULT_ERROR_MESSAGE.'28006',0),
29207 => array(DEFAULT_ERROR_MESSAGE.'28007',0),
29208 => array(DEFAULT_ERROR_MESSAGE.'28008',0),
29209 => array(DEFAULT_ERROR_MESSAGE.'28009',0),
29210 => array(DEFAULT_ERROR_MESSAGE.'28010',0),
);
?>

@ -0,0 +1,201 @@
<?php
/**
* Aqua Theme class
*/
class AquaTheme extends Theme
{
protected $font_color = '#0044CC';
protected $background_color = '#DDFFFF';
protected $axis_color = '#0066CC';
protected $grid_color = '#3366CC';
function GetColorList() {
return array(
'#183152',
'#C4D7ED',
'#375D81',
'#ABC8E2',
'#E1E6FA',
'#9BBAB2',
'#3B4259',
'#0063BC',
'#1D5A73',
'#ABABFF',
'#27ADC5',
'#EDFFCC',
/*
'#66FFFF',
'#00AABB',
'#00FFCC',
'#33CCFF',
'#008866',
'#99FFFF',
'#0099FF',
'#99FFCC',
'#3399FF',
'#2277FF',
'#445588',
'#003388',
'#338877',
'#55DDFF',
'#00FF99',
'#BBBBBB',
'#77AAFF',
'#00FFCC',
*/
);
}
function SetupGraph($graph) {
// graph
/*
$img = $graph->img;
$height = $img->height;
$graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25);
*/
$graph->SetFrame(false);
$graph->SetMarginColor('white');
$graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT);
// legend
$graph->legend->SetFrameWeight(0);
$graph->legend->Pos(0.5, 0.85, 'center', 'top');
$graph->legend->SetFillColor('white');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetColumns(3);
$graph->legend->SetShadow(false);
$graph->legend->SetMarkAbsSize(5);
// xaxis
$graph->xaxis->title->SetColor($this->font_color);
$graph->xaxis->SetColor($this->axis_color, $this->font_color);
$graph->xaxis->SetTickSide(SIDE_BOTTOM);
$graph->xaxis->SetLabelMargin(10);
// yaxis
$graph->yaxis->title->SetColor($this->font_color);
$graph->yaxis->SetColor($this->axis_color, $this->font_color);
$graph->yaxis->SetTickSide(SIDE_LEFT);
$graph->yaxis->SetLabelMargin(8);
$graph->yaxis->HideLine();
$graph->yaxis->HideTicks();
$graph->xaxis->SetTitleMargin(15);
// grid
$graph->ygrid->SetColor($this->grid_color);
$graph->ygrid->SetLineStyle('dotted');
// font
$graph->title->SetColor($this->font_color);
$graph->subtitle->SetColor($this->font_color);
$graph->subsubtitle->SetColor($this->font_color);
// $graph->img->SetAntiAliasing();
}
function SetupPieGraph($graph) {
// graph
$graph->SetFrame(false);
// legend
$graph->legend->SetFillColor('white');
$graph->legend->SetFrameWeight(0);
$graph->legend->Pos(0.5, 0.80, 'center', 'top');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetColumns(4);
$graph->legend->SetShadow(false);
$graph->legend->SetMarkAbsSize(5);
// title
$graph->title->SetColor($this->font_color);
$graph->subtitle->SetColor($this->font_color);
$graph->subsubtitle->SetColor($this->font_color);
$graph->SetAntiAliasing();
}
function PreStrokeApply($graph) {
if ($graph->legend->HasItems()) {
$img = $graph->img;
$graph->SetMargin(
$img->raw_left_margin,
$img->raw_right_margin,
$img->raw_top_margin,
is_numeric($img->raw_bottom_margin) ? $img->raw_bottom_margin : $img->height * 0.25
);
}
}
function ApplyPlot($plot) {
switch (get_class($plot))
{
case 'GroupBarPlot':
{
foreach ($plot->plots as $_plot) {
$this->ApplyPlot($_plot);
}
break;
}
case 'AccBarPlot':
{
foreach ($plot->plots as $_plot) {
$this->ApplyPlot($_plot);
}
break;
}
case 'BarPlot':
{
$plot->Clear();
$color = $this->GetNextColor();
$plot->SetColor($color);
$plot->SetFillColor($color);
//$plot->SetShadow();
break;
}
case 'LinePlot':
{
$plot->Clear();
$plot->SetColor($this->GetNextColor());
$plot->SetWeight(2);
// $plot->SetBarCenter();
break;
}
case 'PiePlot':
{
$plot->SetCenter(0.5, 0.45);
$plot->ShowBorder(false);
$plot->SetSliceColors($this->GetThemeColors());
break;
}
case 'PiePlot3D':
{
$plot->SetSliceColors($this->GetThemeColors());
break;
}
default:
{
}
}
}
}
?>

@ -0,0 +1,182 @@
<?php
/**
* Green Theme class
*/
class GreenTheme extends Theme
{
private $font_color = '#009900';
private $background_color = '#EEFFDD';
private $axis_color = '#00CC00';
private $grid_color = '#33CC33';
function GetColorList() {
return array(
'#66CC00',
'#009900',
'#AAFF77',
'#559922',
'#00CC33',
'#99FF00',
'#009966',
'#00FF99',
'#99BB66',
'#33FF00',
'#DDFFBB',
'#669933',
'#BBDDCC',
'#77CCBB',
'#668833',
'#BBEE66',
);
}
function SetupGraph($graph) {
// graph
/*
$img = $graph->img;
$height = $img->height;
$graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25);
*/
$graph->SetFrame(false);
$graph->SetMarginColor('white');
$graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT);
// legend
$graph->legend->SetFrameWeight(0);
$graph->legend->Pos(0.5, 0.85, 'center', 'top');
$graph->legend->SetFillColor('white');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetColumns(3);
$graph->legend->SetShadow(false);
$graph->legend->SetMarkAbsSize(5);
// xaxis
$graph->xaxis->title->SetColor($this->font_color);
$graph->xaxis->SetColor($this->axis_color, $this->font_color);
$graph->xaxis->SetTickSide(SIDE_BOTTOM);
$graph->xaxis->SetLabelMargin(10);
// yaxis
$graph->yaxis->title->SetColor($this->font_color);
$graph->yaxis->SetColor($this->axis_color, $this->font_color);
$graph->yaxis->SetTickSide(SIDE_LEFT);
$graph->yaxis->SetLabelMargin(8);
$graph->yaxis->HideLine();
$graph->yaxis->HideTicks();
$graph->xaxis->SetTitleMargin(15);
// grid
$graph->ygrid->SetColor($this->grid_color);
$graph->ygrid->SetLineStyle('dotted');
// font
$graph->title->SetColor($this->font_color);
$graph->subtitle->SetColor($this->font_color);
$graph->subsubtitle->SetColor($this->font_color);
// $graph->img->SetAntiAliasing();
}
function SetupPieGraph($graph) {
// graph
$graph->SetFrame(false);
// legend
$graph->legend->SetFillColor('white');
/*
$graph->legend->SetFrameWeight(0);
$graph->legend->Pos(0.5, 0.85, 'center', 'top');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetColumns(3);
*/
$graph->legend->SetShadow(false);
$graph->legend->SetMarkAbsSize(5);
// title
$graph->title->SetColor($this->font_color);
$graph->subtitle->SetColor($this->font_color);
$graph->subsubtitle->SetColor($this->font_color);
$graph->SetAntiAliasing();
}
function PreStrokeApply($graph) {
if ($graph->legend->HasItems()) {
$img = $graph->img;
$graph->SetMargin(
$img->raw_left_margin,
$img->raw_right_margin,
$img->raw_top_margin,
is_numeric($img->raw_bottom_margin) ? $img->raw_bottom_margin : $img->height * 0.25
);
}
}
function ApplyPlot($plot) {
switch (get_class($plot))
{
case 'GroupBarPlot':
{
foreach ($plot->plots as $_plot) {
$this->ApplyPlot($_plot);
}
break;
}
case 'AccBarPlot':
{
foreach ($plot->plots as $_plot) {
$this->ApplyPlot($_plot);
}
break;
}
case 'BarPlot':
{
$plot->Clear();
$color = $this->GetNextColor();
$plot->SetColor($color);
$plot->SetFillColor($color);
$plot->SetShadow('red', 3, 4, false);
break;
}
case 'LinePlot':
{
$plot->Clear();
$plot->SetColor($this->GetNextColor().'@0.4');
$plot->SetWeight(2);
break;
}
case 'PiePlot':
{
$plot->ShowBorder(false);
$plot->SetSliceColors($this->GetThemeColors());
break;
}
case 'PiePlot3D':
{
$plot->SetSliceColors($this->GetThemeColors());
break;
}
default:
{
}
}
}
}
?>

@ -0,0 +1,184 @@
<?php
/**
* Ocean Theme class
*/
class OceanTheme extends Theme
{
protected $font_color = '#0066FF';
private $background_color = '#DDEEFF';
private $axis_color = '#0000CC';
private $grid_color = '#3333CC';
function GetColorList() {
return array(
'#0066FF',
'#CCCCFF',
'#0000FF',
'#3366FF',
'#33CCFF',
'#660088',
'#3300FF',
'#0099FF',
'#6633FF',
'#0055EE',
'#2277EE',
'#3300FF',
'#AA00EE',
'#778899',
'#114499',
'#7744EE',
'#002288',
'#6666FF',
);
}
function SetupGraph($graph) {
// graph
/*
$img = $graph->img;
$height = $img->height;
$graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25);
*/
$graph->SetFrame(false);
$graph->SetMarginColor('white');
$graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT);
// legend
$graph->legend->SetFrameWeight(0);
$graph->legend->Pos(0.5, 0.85, 'center', 'top');
$graph->legend->SetFillColor('white');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetColumns(3);
$graph->legend->SetShadow(false);
$graph->legend->SetMarkAbsSize(5);
// xaxis
$graph->xaxis->title->SetColor($this->font_color);
$graph->xaxis->SetColor($this->axis_color, $this->font_color);
$graph->xaxis->SetTickSide(SIDE_BOTTOM);
$graph->xaxis->SetLabelMargin(10);
// yaxis
$graph->yaxis->title->SetColor($this->font_color);
$graph->yaxis->SetColor($this->axis_color, $this->font_color);
$graph->yaxis->SetTickSide(SIDE_LEFT);
$graph->yaxis->SetLabelMargin(8);
$graph->yaxis->HideLine();
$graph->yaxis->HideTicks();
$graph->xaxis->SetTitleMargin(15);
// grid
$graph->ygrid->SetColor($this->grid_color);
$graph->ygrid->SetLineStyle('dotted');
// font
$graph->title->SetColor($this->font_color);
$graph->subtitle->SetColor($this->font_color);
$graph->subsubtitle->SetColor($this->font_color);
// $graph->img->SetAntiAliasing();
}
function SetupPieGraph($graph) {
// graph
$graph->SetFrame(false);
// legend
$graph->legend->SetFillColor('white');
/*
$graph->legend->SetFrameWeight(0);
$graph->legend->Pos(0.5, 0.85, 'center', 'top');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetColumns(3);
*/
$graph->legend->SetShadow(false);
$graph->legend->SetMarkAbsSize(5);
// title
$graph->title->SetColor($this->font_color);
$graph->subtitle->SetColor($this->font_color);
$graph->subsubtitle->SetColor($this->font_color);
$graph->SetAntiAliasing();
}
function PreStrokeApply($graph) {
if ($graph->legend->HasItems()) {
$img = $graph->img;
$graph->SetMargin(
$img->raw_left_margin,
$img->raw_right_margin,
$img->raw_top_margin,
is_numeric($img->raw_bottom_margin) ? $img->raw_bottom_margin : $img->height * 0.25
);
}
}
function ApplyPlot($plot) {
switch (get_class($plot))
{
case 'GroupBarPlot':
{
foreach ($plot->plots as $_plot) {
$this->ApplyPlot($_plot);
}
break;
}
case 'AccBarPlot':
{
foreach ($plot->plots as $_plot) {
$this->ApplyPlot($_plot);
}
break;
}
case 'BarPlot':
{
$plot->Clear();
$color = $this->GetNextColor();
$plot->SetColor($color);
$plot->SetFillColor($color);
$plot->SetShadow('red', 3, 4, false);
break;
}
case 'LinePlot':
{
$plot->Clear();
$plot->SetColor($this->GetNextColor());
$plot->SetWeight(2);
break;
}
case 'PiePlot':
{
$plot->ShowBorder(false);
$plot->SetSliceColors($this->GetThemeColors());
break;
}
case 'PiePlot3D':
{
$plot->SetSliceColors($this->GetThemeColors());
break;
}
default:
{
}
}
}
}
?>

@ -0,0 +1,184 @@
<?php
/**
* Orange Theme class
*/
class OrangeTheme extends Theme
{
private $font_color = '#CC4400';
private $background_color = '#FFEEDD';
private $axis_color = '#CC6600';
private $grid_color = '#CC6633';
function GetColorList() {
return array(
'#FF9900',
'#FFCC00',
'#AA6600',
'#CCCC00',
'#CC6600',
'#FFFF66',
'#CCFF00',
'#CC3300',
'#669933',
'#EE7700',
'#AAEE33',
'#77AA00',
'#CCFF99',
'#FF6633',
'#885500',
'#AADD00',
'#99CC44',
'#887711',
);
}
function SetupGraph($graph) {
// graph
/*
$img = $graph->img;
$height = $img->height;
$graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25);
*/
$graph->SetFrame(false);
$graph->SetMarginColor('white');
$graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT);
// legend
$graph->legend->SetFrameWeight(0);
$graph->legend->Pos(0.5, 0.85, 'center', 'top');
$graph->legend->SetFillColor('white');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetColumns(3);
$graph->legend->SetShadow(false);
$graph->legend->SetMarkAbsSize(5);
// xaxis
$graph->xaxis->title->SetColor($this->font_color);
$graph->xaxis->SetColor($this->axis_color, $this->font_color);
$graph->xaxis->SetTickSide(SIDE_BOTTOM);
$graph->xaxis->SetLabelMargin(10);
// yaxis
$graph->yaxis->title->SetColor($this->font_color);
$graph->yaxis->SetColor($this->axis_color, $this->font_color);
$graph->yaxis->SetTickSide(SIDE_LEFT);
$graph->yaxis->SetLabelMargin(8);
$graph->yaxis->HideLine();
$graph->yaxis->HideTicks();
$graph->xaxis->SetTitleMargin(15);
// grid
$graph->ygrid->SetColor($this->grid_color);
$graph->ygrid->SetLineStyle('dotted');
// font
$graph->title->SetColor($this->font_color);
$graph->subtitle->SetColor($this->font_color);
$graph->subsubtitle->SetColor($this->font_color);
// $graph->img->SetAntiAliasing();
}
function SetupPieGraph($graph) {
// graph
$graph->SetFrame(false);
// legend
$graph->legend->SetFillColor('white');
/*
$graph->legend->SetFrameWeight(0);
$graph->legend->Pos(0.5, 0.85, 'center', 'top');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetColumns(3);
*/
$graph->legend->SetShadow(false);
$graph->legend->SetMarkAbsSize(5);
// title
$graph->title->SetColor($this->font_color);
$graph->subtitle->SetColor($this->font_color);
$graph->subsubtitle->SetColor($this->font_color);
$graph->SetAntiAliasing();
}
function PreStrokeApply($graph) {
if ($graph->legend->HasItems()) {
$img = $graph->img;
$graph->SetMargin(
$img->raw_left_margin,
$img->raw_right_margin,
$img->raw_top_margin,
is_numeric($img->raw_bottom_margin) ? $img->raw_bottom_margin : $img->height * 0.25
);
}
}
function ApplyPlot($plot) {
switch (get_class($plot))
{
case 'GroupBarPlot':
{
foreach ($plot->plots as $_plot) {
$this->ApplyPlot($_plot);
}
break;
}
case 'AccBarPlot':
{
foreach ($plot->plots as $_plot) {
$this->ApplyPlot($_plot);
}
break;
}
case 'BarPlot':
{
$plot->Clear();
$color = $this->GetNextColor();
$plot->SetColor($color);
$plot->SetFillColor($color);
$plot->SetShadow('red', 3, 4, false);
break;
}
case 'LinePlot':
{
$plot->Clear();
$plot->SetColor($this->GetNextColor().'@0.4');
$plot->SetWeight(2);
break;
}
case 'PiePlot':
{
$plot->ShowBorder(false);
$plot->SetSliceColors($this->GetThemeColors());
break;
}
case 'PiePlot3D':
{
$plot->SetSliceColors($this->GetThemeColors());
break;
}
default:
{
}
}
}
}
?>

@ -0,0 +1,179 @@
<?php
/**
* Pastel Theme class
*/
class PastelTheme extends Theme
{
private $font_color = '#0044CC';
private $background_color = '#DDFFFF';
private $axis_color = '#0066CC';
private $grid_color = '#3366CC';
function GetColorList() {
return array(
'#FFAACC',
'#AAEECC',
'#AACCFF',
'#CCAAFF',
'#EEDDFF',
'#FFCCAA',
'#CCBBDD',
'#CCFFAA',
'#C7D7C2',
'#FFEEDD',
'#FFCCEE',
'#BFECFA',
);
}
function SetupGraph($graph) {
// graph
/*
$img = $graph->img;
$height = $img->height;
$graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25);
*/
$graph->SetFrame(false);
$graph->SetMarginColor('white');
$graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT);
// legend
$graph->legend->SetFrameWeight(0);
$graph->legend->Pos(0.5, 0.85, 'center', 'top');
$graph->legend->SetFillColor('white');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetColumns(3);
$graph->legend->SetShadow(false);
$graph->legend->SetMarkAbsSize(5);
// xaxis
$graph->xaxis->title->SetColor($this->font_color);
$graph->xaxis->SetColor($this->axis_color, $this->font_color);
$graph->xaxis->SetTickSide(SIDE_BOTTOM);
$graph->xaxis->SetLabelMargin(10);
// yaxis
$graph->yaxis->title->SetColor($this->font_color);
$graph->yaxis->SetColor($this->axis_color, $this->font_color);
$graph->yaxis->SetTickSide(SIDE_LEFT);
$graph->yaxis->SetLabelMargin(8);
$graph->yaxis->HideLine();
$graph->yaxis->HideTicks();
$graph->xaxis->SetTitleMargin(15);
// grid
$graph->ygrid->SetColor($this->grid_color);
$graph->ygrid->SetLineStyle('dotted');
// font
$graph->title->SetColor($this->font_color);
$graph->subtitle->SetColor($this->font_color);
$graph->subsubtitle->SetColor($this->font_color);
// $graph->img->SetAntiAliasing();
}
function SetupPieGraph($graph) {
// graph
$graph->SetFrame(false);
// legend
$graph->legend->SetFillColor('white');
$graph->legend->SetFrameWeight(0);
$graph->legend->Pos(0.5, 0.80, 'center', 'top');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetColumns(4);
$graph->legend->SetShadow(false);
$graph->legend->SetMarkAbsSize(5);
// title
$graph->title->SetColor($this->font_color);
$graph->subtitle->SetColor($this->font_color);
$graph->subsubtitle->SetColor($this->font_color);
$graph->SetAntiAliasing();
}
function PreStrokeApply($graph) {
if ($graph->legend->HasItems()) {
$img = $graph->img;
$graph->SetMargin(
$img->raw_left_margin,
$img->raw_right_margin,
$img->raw_top_margin,
is_numeric($img->raw_bottom_margin) ? $img->raw_bottom_margin : $img->height * 0.25
);
}
}
function ApplyPlot($plot) {
switch (get_class($plot))
{
case 'GroupBarPlot':
{
foreach ($plot->plots as $_plot) {
$this->ApplyPlot($_plot);
}
break;
}
case 'AccBarPlot':
{
foreach ($plot->plots as $_plot) {
$this->ApplyPlot($_plot);
}
break;
}
case 'BarPlot':
{
$plot->Clear();
$color = $this->GetNextColor();
$plot->SetColor($color);
$plot->SetFillColor($color);
$plot->SetShadow('red', 3, 4, false);
break;
}
case 'LinePlot':
{
$plot->Clear();
$plot->SetColor($this->GetNextColor().'@0.4');
$plot->SetWeight(2);
// $plot->SetBarCenter();
break;
}
case 'PiePlot':
{
$plot->SetCenter(0.5, 0.45);
$plot->ShowBorder(false);
$plot->SetSliceColors($this->GetThemeColors());
break;
}
case 'PiePlot3D':
{
$plot->SetSliceColors($this->GetThemeColors());
break;
}
default:
{
}
}
}
}
?>

@ -0,0 +1,184 @@
<?php
/**
* Rose Theme class
*/
class RoseTheme extends Theme
{
private $font_color = '#CC0044';
private $background_color = '#FFDDDD';
private $axis_color = '#CC0000';
private $grid_color = '#CC3333';
function GetColorList() {
return array(
'#FF0000',
'#FF99FF',
'#AA0099',
'#FF00FF',
'#FF6666',
'#FF0099',
'#FFBB88',
'#AA2211',
'#FF6699',
'#BBAA88',
'#FF2200',
'#883333',
'#EE7777',
'#EE7711',
'#FF0066',
'#DD7711',
'#AA6600',
'#EE5500',
);
}
function SetupGraph($graph) {
// graph
/*
$img = $graph->img;
$height = $img->height;
$graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25);
*/
$graph->SetFrame(false);
$graph->SetMarginColor('white');
$graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT);
// legend
$graph->legend->SetFrameWeight(0);
$graph->legend->Pos(0.5, 0.85, 'center', 'top');
$graph->legend->SetFillColor('white');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetColumns(3);
$graph->legend->SetShadow(false);
$graph->legend->SetMarkAbsSize(5);
// xaxis
$graph->xaxis->title->SetColor($this->font_color);
$graph->xaxis->SetColor($this->axis_color, $this->font_color);
$graph->xaxis->SetTickSide(SIDE_BOTTOM);
$graph->xaxis->SetLabelMargin(10);
// yaxis
$graph->yaxis->title->SetColor($this->font_color);
$graph->yaxis->SetColor($this->axis_color, $this->font_color);
$graph->yaxis->SetTickSide(SIDE_LEFT);
$graph->yaxis->SetLabelMargin(8);
$graph->yaxis->HideLine();
$graph->yaxis->HideTicks();
$graph->xaxis->SetTitleMargin(15);
// grid
$graph->ygrid->SetColor($this->grid_color);
$graph->ygrid->SetLineStyle('dotted');
// font
$graph->title->SetColor($this->font_color);
$graph->subtitle->SetColor($this->font_color);
$graph->subsubtitle->SetColor($this->font_color);
// $graph->img->SetAntiAliasing();
}
function SetupPieGraph($graph) {
// graph
$graph->SetFrame(false);
// legend
$graph->legend->SetFillColor('white');
/*
$graph->legend->SetFrameWeight(0);
$graph->legend->Pos(0.5, 0.85, 'center', 'top');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetColumns(3);
*/
$graph->legend->SetShadow(false);
$graph->legend->SetMarkAbsSize(5);
// title
$graph->title->SetColor($this->font_color);
$graph->subtitle->SetColor($this->font_color);
$graph->subsubtitle->SetColor($this->font_color);
$graph->SetAntiAliasing();
}
function PreStrokeApply($graph) {
if ($graph->legend->HasItems()) {
$img = $graph->img;
$graph->SetMargin(
$img->raw_left_margin,
$img->raw_right_margin,
$img->raw_top_margin,
is_numeric($img->raw_bottom_margin) ? $img->raw_bottom_margin : $img->height * 0.25
);
}
}
function ApplyPlot($plot) {
switch (get_class($plot))
{
case 'GroupBarPlot':
{
foreach ($plot->plots as $_plot) {
$this->ApplyPlot($_plot);
}
break;
}
case 'AccBarPlot':
{
foreach ($plot->plots as $_plot) {
$this->ApplyPlot($_plot);
}
break;
}
case 'BarPlot':
{
$plot->Clear();
$color = $this->GetNextColor();
$plot->SetColor($color);
$plot->SetFillColor($color);
$plot->SetShadow('red', 3, 4, false);
break;
}
case 'LinePlot':
{
$plot->Clear();
$plot->SetColor($this->GetNextColor().'@0.4');
$plot->SetWeight(2);
break;
}
case 'PiePlot':
{
$plot->ShowBorder(false);
$plot->SetSliceColors($this->GetThemeColors());
break;
}
case 'PiePlot3D':
{
$plot->SetSliceColors($this->GetThemeColors());
break;
}
default:
{
}
}
}
}
?>

@ -0,0 +1,213 @@
<?php
/**
* Softy Theme class
*/
class SoftyTheme extends Theme
{
protected $font_color = '#000000';
protected $background_color = '#F7F8F4';
protected $axis_color = '#000000';
protected $grid_color = '#CCCCCC';
function GetColorList() {
return array(
'#CFE7FB',
'#F9D76F',
'#B9D566',
'#FFBB90',
'#66BBBB',
'#E69090',
'#BB90BB',
'#9AB67C',
'#D1CC66',
/*
'#AFD8F8',
'#F6BD0F',
'#8BBA00',
'#FF8E46',
'#008E8E',
'#D64646',
'#8E468E',
'#588526',
'#B3AA00',
'#008ED6',
'#9D080D',
'#A186BE',
*/
);
}
function SetupGraph($graph) {
// graph
$graph->SetFrame(false);
$graph->SetMarginColor('white');
// legend
$graph->legend->SetFrameWeight(0);
$graph->legend->Pos(0.5, 0.85, 'center', 'top');
$graph->legend->SetFillColor('white');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetColumns(3);
$graph->legend->SetShadow(false);
$graph->legend->SetMarkAbsSize(5);
// xaxis
$graph->xaxis->title->SetColor($this->font_color);
$graph->xaxis->SetColor($this->axis_color, $this->font_color);
$graph->xaxis->SetTickSide(SIDE_BOTTOM);
$graph->xaxis->SetLabelMargin(10);
// yaxis
$graph->yaxis->title->SetColor($this->font_color);
$graph->yaxis->SetColor($this->axis_color, $this->font_color);
$graph->yaxis->SetTickSide(SIDE_LEFT);
$graph->yaxis->SetLabelMargin(8);
$graph->yaxis->HideLine();
$graph->yaxis->HideTicks();
$graph->xaxis->SetTitleMargin(15);
// y2~
if (isset($graph->y2axis)) {
$graph->y2axis->title->SetColor($this->font_color);
$graph->y2axis->SetColor($this->axis_color, $this->font_color);
$graph->y2axis->SetTickSide(SIDE_LEFT);
$graph->y2axis->SetLabelMargin(8);
$graph->y2axis->HideLine();
$graph->y2axis->HideTicks();
}
// yn
if (isset($graph->y2axis)) {
foreach ($graph->ynaxis as $axis) {
$axis->title->SetColor($this->font_color);
$axis->SetColor($this->axis_color, $this->font_color);
$axis->SetTickSide(SIDE_LEFT);
$axis->SetLabelMargin(8);
$axis->HideLine();
$axis->HideTicks();
}
}
// grid
$graph->ygrid->SetColor($this->grid_color);
$graph->ygrid->SetLineStyle('dotted');
$graph->ygrid->SetFill(true, '#FFFFFF', $this->background_color);
$graph->xgrid->Show();
$graph->xgrid->SetColor($this->grid_color);
$graph->xgrid->SetLineStyle('dotted');
// font
$graph->title->SetColor($this->font_color);
$graph->subtitle->SetColor($this->font_color);
$graph->subsubtitle->SetColor($this->font_color);
// $graph->img->SetAntiAliasing();
}
function SetupPieGraph($graph) {
// graph
$graph->SetFrame(false);
// title
$graph->title->SetColor($this->font_color);
$graph->subtitle->SetColor($this->font_color);
$graph->subsubtitle->SetColor($this->font_color);
$graph->SetAntiAliasing();
}
function PreStrokeApply($graph) {
if ($graph->legend->HasItems()) {
$img = $graph->img;
$graph->SetMargin(
$img->raw_left_margin,
$img->raw_right_margin,
$img->raw_top_margin,
is_numeric($img->raw_bottom_margin) ? $img->raw_bottom_margin : $img->height * 0.25
);
}
}
function ApplyPlot($plot) {
switch (get_class($plot))
{
case 'BarPlot':
{
$plot->Clear();
$color = $this->GetNextColor();
$plot->SetColor($color);
$plot->SetFillColor($color);
$plot->SetShadow('red', 3, 4, false);
$plot->value->SetAlign('center', 'center');
break;
}
case 'LinePlot':
{
$plot->Clear();
$plot->SetColor($this->GetNextColor());
$plot->SetWeight(2);
// $plot->SetBarCenter();
break;
}
case 'PiePlot':
{
$plot->ShowBorder(false);
$plot->SetSliceColors($this->GetThemeColors());
break;
}
case 'GroupBarPlot':
{
foreach ($plot->plots as $_plot) {
$this->ApplyPlot($_plot);
}
break;
}
case 'AccBarPlot':
{
$plot->value->SetAlign('center', 'center');
foreach ($plot->plots as $_plot) {
$this->ApplyPlot($_plot);
$_plot->SetValuePos('center');
}
break;
}
case 'ScatterPlot':
{
break;
}
case 'PiePlot3D':
{
$plot->SetSliceColors($this->GetThemeColors());
break;
}
default:
{
}
}
}
}
?>

@ -0,0 +1,187 @@
<?php
/**
* Universal Theme class
*/
class UniversalTheme extends Theme
{
private $font_color = '#444444';
private $background_color = '#F4F4F4';
private $axis_color = '#888888';
private $grid_color = '#E3E3E3';
function GetColorList() {
return array(
'#61a9f3',#blue
'#f381b9',#red
'#61E3A9',#green
#'#D56DE2',
'#85eD82',
'#F7b7b7',
'#CFDF49',
'#88d8f2',
'#07AF7B',
'#B9E3F9',
'#FFF3AD',
'#EF606A',
'#EC8833',
'#FFF100',
'#87C9A5',
);
}
function SetupGraph($graph) {
// graph
/*
$img = $graph->img;
$height = $img->height;
$graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25);
*/
$graph->SetFrame(false);
$graph->SetMarginColor('white');
$graph->SetBox(true, '#DADADA');
// $graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT);
// legend
$graph->legend->SetFrameWeight(0);
$graph->legend->Pos(0.5, 0.85, 'center', 'top');
$graph->legend->SetFillColor('white');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetColumns(3);
$graph->legend->SetShadow(false);
$graph->legend->SetMarkAbsSize(5);
// xaxis
$graph->xaxis->title->SetColor($this->font_color);
$graph->xaxis->SetColor($this->axis_color, $this->font_color);
$graph->xaxis->SetTickSide(SIDE_BOTTOM);
$graph->xaxis->SetLabelMargin(10);
$graph->xaxis->HideTicks();
$graph->xaxis->SetTitleMargin(15);
//$graph->xaxis->SetLabelMargin(30);
// yaxis
$graph->yaxis->title->SetColor($this->font_color);
$graph->yaxis->SetColor($this->axis_color, $this->font_color);
$graph->yaxis->SetTickSide(SIDE_LEFT);
$graph->yaxis->SetLabelMargin(8);
// $graph->yaxis->SetTickPositions(array(50, 100, 150));
// $graph->yaxis->HideLine();
$graph->yaxis->HideTicks();
// grid
$graph->ygrid->SetColor($this->grid_color);
$graph->ygrid->SetFill(true, '#FFFFFF', $this->background_color);
// $graph->ygrid->SetLineStyle('dotted');
// font
$graph->title->SetColor($this->font_color);
$graph->subtitle->SetColor($this->font_color);
$graph->subsubtitle->SetColor($this->font_color);
$graph->img->SetAntiAliasing();
}
function SetupPieGraph($graph) {
// graph
$graph->SetFrame(false);
// legend
$graph->legend->SetFillColor('white');
$graph->legend->SetFrameWeight(0);
$graph->legend->Pos(0.5, 0.80, 'center', 'top');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetColumns(4);
$graph->legend->SetShadow(false);
$graph->legend->SetMarkAbsSize(5);
// title
$graph->title->SetColor($this->font_color);
$graph->subtitle->SetColor($this->font_color);
$graph->subsubtitle->SetColor($this->font_color);
$graph->SetAntiAliasing();
}
function PreStrokeApply($graph) {
if ($graph->legend->HasItems()) {
$img = $graph->img;
$graph->SetMargin(
$img->raw_left_margin,
$img->raw_right_margin,
$img->raw_top_margin,
is_numeric($img->raw_bottom_margin) ? $img->raw_bottom_margin : $img->height * 0.25
);
}
}
function ApplyPlot($plot) {
switch (get_class($plot))
{
case 'GroupBarPlot':
{
foreach ($plot->plots as $_plot) {
$this->ApplyPlot($_plot);
}
break;
}
case 'AccBarPlot':
{
foreach ($plot->plots as $_plot) {
$this->ApplyPlot($_plot);
}
break;
}
case 'BarPlot':
{
$plot->Clear();
$color = $this->GetNextColor();
$plot->SetColor($color);
$plot->SetFillColor($color);
$plot->SetShadow('red', 3, 4, false);
break;
}
case 'LinePlot':
{
$plot->Clear();
$plot->SetColor($this->GetNextColor().'@0.4');
$plot->SetWeight(2);
break;
}
case 'PiePlot':
{
$plot->SetCenter(0.5, 0.45);
$plot->ShowBorder(false);
$plot->SetSliceColors($this->GetThemeColors());
break;
}
case 'PiePlot3D':
{
$plot->SetSliceColors($this->GetThemeColors());
break;
}
default:
{
}
}
}
}
?>

@ -0,0 +1,179 @@
<?php
/**
* Vivid Theme class
*/
class VividTheme extends Theme
{
private $font_color = '#0044CC';
private $background_color = '#DDFFFF';
private $axis_color = '#0066CC';
private $grid_color = '#3366CC';
function GetColorList() {
return array(
'#FFFB11',
'#005EBC',
'#9AEB67',
'#FF4A26',
'#FDFF98',
'#6B7EFF',
'#BCE02E',
'#E0642E',
'#E0D62E',
'#2E97E0',
'#02927F',
'#FF005A',
);
}
function SetupGraph($graph) {
// graph
/*
$img = $graph->img;
$height = $img->height;
$graph->SetMargin($img->left_margin, $img->right_margin, $img->top_margin, $height * 0.25);
*/
$graph->SetFrame(false);
$graph->SetMarginColor('white');
$graph->SetBackgroundGradient($this->background_color, '#FFFFFF', GRAD_HOR, BGRAD_PLOT);
// legend
$graph->legend->SetFrameWeight(0);
$graph->legend->Pos(0.5, 0.85, 'center', 'top');
$graph->legend->SetFillColor('white');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetColumns(3);
$graph->legend->SetShadow(false);
$graph->legend->SetMarkAbsSize(5);
// xaxis
$graph->xaxis->title->SetColor($this->font_color);
$graph->xaxis->SetColor($this->axis_color, $this->font_color);
$graph->xaxis->SetTickSide(SIDE_BOTTOM);
$graph->xaxis->SetLabelMargin(10);
// yaxis
$graph->yaxis->title->SetColor($this->font_color);
$graph->yaxis->SetColor($this->axis_color, $this->font_color);
$graph->yaxis->SetTickSide(SIDE_LEFT);
$graph->yaxis->SetLabelMargin(8);
$graph->yaxis->HideLine();
$graph->yaxis->HideTicks();
$graph->xaxis->SetTitleMargin(15);
// grid
$graph->ygrid->SetColor($this->grid_color);
$graph->ygrid->SetLineStyle('dotted');
// font
$graph->title->SetColor($this->font_color);
$graph->subtitle->SetColor($this->font_color);
$graph->subsubtitle->SetColor($this->font_color);
// $graph->img->SetAntiAliasing();
}
function SetupPieGraph($graph) {
// graph
$graph->SetFrame(false);
// legend
$graph->legend->SetFillColor('white');
$graph->legend->SetFrameWeight(0);
$graph->legend->Pos(0.5, 0.80, 'center', 'top');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetColumns(4);
$graph->legend->SetShadow(false);
$graph->legend->SetMarkAbsSize(5);
// title
$graph->title->SetColor($this->font_color);
$graph->subtitle->SetColor($this->font_color);
$graph->subsubtitle->SetColor($this->font_color);
$graph->SetAntiAliasing();
}
function PreStrokeApply($graph) {
if ($graph->legend->HasItems()) {
$img = $graph->img;
$graph->SetMargin(
$img->raw_left_margin,
$img->raw_right_margin,
$img->raw_top_margin,
is_numeric($img->raw_bottom_margin) ? $img->raw_bottom_margin : $img->height * 0.25
);
}
}
function ApplyPlot($plot) {
switch (get_class($plot))
{
case 'GroupBarPlot':
{
foreach ($plot->plots as $_plot) {
$this->ApplyPlot($_plot);
}
break;
}
case 'AccBarPlot':
{
foreach ($plot->plots as $_plot) {
$this->ApplyPlot($_plot);
}
break;
}
case 'BarPlot':
{
$plot->Clear();
$color = $this->GetNextColor();
$plot->SetColor($color);
$plot->SetFillColor($color);
$plot->SetShadow('red', 3, 4, false);
break;
}
case 'LinePlot':
{
$plot->Clear();
$plot->SetColor($this->GetNextColor().'@0.4');
$plot->SetWeight(2);
// $plot->SetBarCenter();
break;
}
case 'PiePlot':
{
$plot->SetCenter(0.5, 0.45);
$plot->ShowBorder(false);
$plot->SetSliceColors($this->GetThemeColors());
break;
}
case 'PiePlot3D':
{
$plot->SetSliceColors($this->GetThemeColors());
break;
}
default:
{
}
}
}
}
?>
Loading…
Cancel
Save