Upgrade jpgrah to 4.3.4
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing

This commit is contained in:
Nigel Sheldon 2021-01-03 17:10:26 +01:00
parent 7c3999c5cd
commit b5868f05f6
72 changed files with 19048 additions and 10218 deletions

View file

@ -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/

View file

@ -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'
) ;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,391 @@
<?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

View file

@ -1,102 +1,102 @@
<?php
//=======================================================================
// File: IMGDATA_BEVELS.INC
// Description: Base64 encoded images for round bevels
// Created: 2003-03-20
// Ver: $Id: imgdata_bevels.inc.php 860 2007-03-23 19:16:19Z ljp $
// 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) Aditus Consulting. All rights reserved.
// 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 ;
public function ImgData_Bevels()
public 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'.
'==' ;
'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=' ;
'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=' ;
'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=' ;
'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==' ;
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
'BMVEX////+/v7i4eO/w8eHxcvKroNVormtfkjrMN2BeXQrepPc'.
'Esy4IL+OFaR7F25LHF8mFRh5XXtUAAAAAXRSTlMAQObYZgAAAA'.
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
'RQfTAxcBNgkjEpIxAAAAlElEQVR4nE2QAQ7FIAhDDTAVndL7n3'.
'ZV/7JfEwMvFIWUlkTMVNInbVv5ZeJqG7Smh2QTBwJBpsdizAZP'.
'5NyW0awhK8kYodnZxS6ECvPRp2sI+y7PBv1mN02KH7h77QCJ8D'.
'4VvY5NUgEmCwj6ZMzHtJRgRSXwC1gfcqJJH0GBnSnK1kUQ72DY'.
'CPBv+MCS/e0jib77eQAJxwiEWm7hFwAAAABJRU5ErkJggg==' ;
}
}

View file

@ -1,11 +1,11 @@
<?php
//=======================================================================
// File: IMGDATA_DIAMONDS.INC
// Description: Base64 encoded images for diamonds
// Created: 2003-03-20
// Ver: $Id: imgdata_diamonds.inc.php 860 2007-03-23 19:16:19Z ljp $
// 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) Aditus Consulting. All rights reserved.
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
class ImgData_Diamonds extends ImgData
@ -13,165 +13,165 @@ 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');
'blue','pink','purple','red','yellow');
protected $index = array('lightblue' =>7,'darkblue'=>2,'gray'=>6,
'blue'=>4,'pink'=>1,'purple'=>5,'red'=>0,'yellow'=>3);
'blue'=>4,'pink'=>1,'purple'=>5,'red'=>0,'yellow'=>3);
protected $maxidx = 7 ;
protected $imgdata ;
public function ImgData_Diamonds()
public 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'.
'nJzv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ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAA'.
'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'.
'==' ;
'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/TmW4AIM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R97g+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'.
'==' ;
'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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//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/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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'.
'==' ;
'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'.
'==' ;
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'.
'BMVEX///+AgIBmzP9m///M//+Z//8hMmBVAAAAAXRSTlMAQObY'.
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'.
'AHdElNRQfTAwsWEwCxm6egAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'.
'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'.
'6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'.
'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'.
'==' ;
}
}

View file

@ -1,19 +1,19 @@
<?php
//=======================================================================
// File: IMGDATA_PUSHPINS.INC
// Description: Base64 encoded images for pushpins
// Created: 2003-03-20
// Ver: $Id: imgdata_pushpins.inc.php 860 2007-03-23 19:16:19Z ljp $
// File: IMGDATA_PUSHPINS.INC
// Description: Base64 encoded images for pushpins
// Created: 2003-03-20
// Ver: $Id: imgdata_pushpins.inc.php 1106 2009-02-22 20:16:35Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
// 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');
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 ) ;
@ -21,10 +21,10 @@ class ImgData_PushPins extends ImgData
protected $imgdata_large;
protected $imgdata_small ;
public function ImgData_PushPins()
public function __construct()
{
// The anchor should be where the needle "hits" the paper
// The anchor should be where the needle "hits" the paper
// (bottom left corner)
$this->anchor_x = 0;
$this->anchor_y = 1;
@ -34,384 +34,384 @@ class ImgData_PushPins extends ImgData
//==========================================================
$this->imgdata_large[0][0]= 2490 ;
$this->imgdata_large[0][1]=
'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'.
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'.
'B3RJTUUH0wMKBh4Ryh89CgAACUdJREFUeJy9mNtTFFcexz+/7p'.
'4Lw1wZJKD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xx51bt/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'.
'/TWsVIWPJkvMFS4zMfMhUp5Bs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hYg4UiRALVHTCHSZvYBm4A//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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lVqu1dP3q1cLta9ekU6u1dat1J9b6Sk9kraV1rYXegW7apDYw'.
'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'.
'CLhIkPD6InY9S3djGLJVBtQP1Qb4HDAyoJY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336bCwr1JfAPB9r+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/FknnJS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FBzcA4370Cc'.
'S81nTRBUs9lkOByi1GuOPI4Rh3+26JZlnSkWi781DOPXvV4v3+'.
'/2G0R8kSBxB/jew+tERK+c49m2TblcxrZtXNfl+fPneJ6HZVmU'.
'y2VJJpNyaJ9TSinlOA5bW1u4rntkQA0oAG8D54gb9W3ianxM3A'.
'e/cn73U3Hq1Cm5du2aPjs7a+ztcSIShmE4ajQa6tatWzQajZ+0'.
'fbiKI+It4SvijVUj7kL2qvGfgkskEqTTaZmcnDROnTplJhIJTU'.
'QiwPd9P/Q8T6XTaQzDIAiCfzjP/wFVfszuFqdHXgAAAABJRU5E'.
'rkJggg==' ;
//==========================================================
@ -419,52 +419,52 @@ class ImgData_PushPins extends ImgData
//==========================================================
$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' ;
'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==' ;
'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=' ;
'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=' ;
//==========================================================
@ -472,47 +472,47 @@ class ImgData_PushPins extends ImgData
//==========================================================
$this->imgdata_small[3][0]= 883 ;
$this->imgdata_small[3][1]=
'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAACi1'.
'BMVEX///8AAAAAADMAAGYAAJkAAMwAAP8zAAAzADMzAGYzAJkz'.
'AMwzAP9mAABmADNmAGZmAJlmAMxmAP+ZAACZADOZAGa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zM////'.
'/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' ;
'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' ;
}
}

View file

@ -1,22 +1,22 @@
<?php
//=======================================================================
// File: IMGDATA_SQUARES.INC
// Description: Base64 encoded images for squares
// Created: 2003-03-20
// Ver: $Id: imgdata_squares.inc.php 860 2007-03-23 19:16:19Z ljp $
// File: IMGDATA_SQUARES.INC
// Description: Base64 encoded images for squares
// Created: 2003-03-20
// Ver: $Id: imgdata_squares.inc.php 1106 2009-02-22 20:16:35Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
// 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');
'lightblue','orange','purple','red','yellow');
protected $index = array('bluegreen' =>2,'blue'=>5,'green'=>6,
'lightblue'=>0,'orange'=>7,'purple'=>4,'red'=>3,'yellow'=>1);
'lightblue'=>0,'orange'=>7,'purple'=>4,'red'=>3,'yellow'=>1);
protected $maxidx = 7 ;
protected $imgdata ;
@ -27,124 +27,124 @@ class ImgData_Squares extends ImgData
//==========================================================
$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=' ;
'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=' ;
'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=' ;
'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' ;
'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->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oWpaa2FHUgvd/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==' ;
'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==' ;
'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' ;
'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' ;
}
}

View file

@ -1,11 +1,11 @@
<?php
//=======================================================================
// File: IMGDATA_STARS.INC
// Description: Base64 encoded images for stars
// Created: 2003-03-20
// Ver: $Id: imgdata_stars.inc.php 860 2007-03-23 19:16:19Z ljp $
// File: IMGDATA_STARS.INC
// Description: Base64 encoded images for stars
// Created: 2003-03-20
// Ver: $Id: imgdata_stars.inc.php 1106 2009-02-22 20:16:35Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
@ -16,129 +16,129 @@ class ImgData_Stars extends 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);
'blue'=>5,'green'=>0,'pink'=>7,'red'=>2,'yellow'=>6);
protected $maxidx = 7 ;
protected $imgdata ;
public function ImgData_Stars()
public 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=' ;
'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==' ;
'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==' ;
'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==' ;
'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==' ;
'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==' ;
'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==' ;
'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==' ;
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'.
'BMVEX///+/v7+eRJPzWN3SUr7nb9TvWNj2WOS7Tqi+TqnxZtyg'.
'Ro/KocPgVsjnV9LxV927nLa+XLTErL7scN24TarzY9/qWNemVJ'.
'jVU8LsV9VCwcc9AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'.
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJxi9ZY'.
'GoAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'.
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'.
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'.
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ;
}
}

View file

@ -1,15 +1,14 @@
<?php
//=======================================================================
// File: JPG-CONFIG.INC
// Description: Configuration file for JpGraph library
// Created: 2004-03-27
// Ver: $Id: jpg-config.inc.php 781 2006-10-08 08:07:47Z ljp $
// 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) Aditus Consulting. All rights reserved.
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
//------------------------------------------------------------------------
// Directories for cache and font directory.
//
@ -27,8 +26,8 @@
//
// UNIX:
// CACHE_DIR /tmp/jpgraph_cache/
// TTF_DIR /usr/X11R6/lib/X11/fonts/truetype/
// MBTTF_DIR /usr/share/fonts/ja/TrueType/
// TTF_DIR /usr/share/fonts/truetype/
// MBTTF_DIR /usr/share/fonts/truetype/
//
// WINDOWS:
// CACHE_DIR $SERVER_TEMP/jpgraph_cache/
@ -36,9 +35,9 @@
// 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/");
// 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
@ -51,70 +50,8 @@
// 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 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
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);
define('CSIMCACHE_DIR', 'csimcache/');
define('CSIMCACHE_HTTP_DIR', 'csimcache/');
//------------------------------------------------------------------------
// Various JpGraph Settings. Adjust accordingly to your
@ -124,12 +61,12 @@ DEFINE('ASSUME_EUCJP_ENCODING', false);
// Deafult locale for error messages.
// This defaults to English = 'en'
DEFINE('DEFAULT_ERR_LOCALE', 'en');
define('DEFAULT_ERR_LOCALE', 'en');
// Deafult graphic format set to "auto" which will automatically
// 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");
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.
@ -137,88 +74,63 @@ DEFINE("DEFAULT_GFORMAT", "auto");
// 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);
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);
// 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);
define('USE_IMAGE_ERROR_HANDLER', true);
// Should the library examin the global php_errmsg string and convert
// 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.
// 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);
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);
// 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);
// 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);
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 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")
// (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");
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);
// (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);
// Default theme class name
define('DEFAULT_THEME_CLASS', 'UniversalTheme');
// 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");
define('SUPERSAMPLING', true);
define('SUPERSAMPLING_SCALE', 1);

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,11 @@
<?php
//=======================================================================
// File: JPGRAPH_ANTISPAM.PHP
// Description: Genarate anti-spam challenge
// Created: 2004-10-07
// Ver: $Id: jpgraph_antispam-digits.php 781 2006-10-08 08:07:47Z ljp $
// 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) Aditus Consulting. All rights reserved.
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
class HandDigits
@ -14,152 +14,152 @@ class HandDigits
public $iHeight=30;
public $iWidth=30;
public function HandDigits()
public 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+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C8DruScmg6X8KkjZEhbaB9KEyFYSOw26Uqd+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' ;
'/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/xAAZAAAC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EAAwEAAAAAAAAA'.
'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/ANGvW4YVOeiRX5b4mv5Sin05IdlupP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CfkfWjRWs1ve249erQqQYjOtN1FqPUpCXQ4WIzQSsJwT0UpRwQPG0nzqyuNHobjsl9kBuWqoOoXtT1/'.
'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==' ;
'/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]= 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HRocHCAkLicg'.
'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'.
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0M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v/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/8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U23xLWkj5RlLYK0J7anW9gbAjCzkOtsVSUJUdtc6dVZK51UeaFm4LKbhpC'.
'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+11H9rDDjn8lr9yj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R7'.
'vck5C3YRKYEOEVJZj8kjKypXqWvirjk9h+dB9i4faa89TDZUfKlIyT8k+To10a6KTkpcJ/0vL/7o0TS//9k=' ;
}
}
class AntiSpam
{
public $iNumber='';
private $iNumber='';
public function AntiSpam($aNumber='')
public function __construct($aNumber='')
{
$this->iNumber = $aNumber;
}

View file

@ -1,11 +1,11 @@
<?php
//=======================================================================
// File: JPGRAPH_ANTISPAM.PHP
// Description: Genarate anti-spam challenge
// Created: 2004-10-07
// Ver: $Id: jpgraph_antispam.php 808 2006-11-28 19:10:40Z ljp $
// File: JPGRAPH_ANTISPAM.PHP
// Description: Genarate anti-spam challenge
// Created: 2004-10-07
// Ver: $Id: jpgraph_antispam.php 1106 2009-02-22 20:16:35Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
class HandDigits
@ -14,10 +14,10 @@ class HandDigits
public $iHeight=30;
public $iWidth=30;
public function HandDigits()
public function __construct()
{
//==========================================================
//==========================================================
// lj-small.jpg
//==========================================================
$this->chars['j'][0]= 658 ;
@ -151,7 +151,7 @@ class HandDigits
't2fmEIckqIZaaKuSGG0lQ4gduRoFRHQ9AOgs2lOJbk9aSUlpjGvAWeSVH2VKq/2dFPw3IjyJe8s281ct3I9UoHJXGiQkD2STrSZ7'.
'Yf8AOl7JTdw5eOCz0jw3+LbYCfA9nz71msb8KMxoTGTw+5srjsipAdDqFBQBIuiOl6KrdYyJMyTCshlw2G3Fr/HiNqNNAqJJUoGl'.
'KND+h47km1bZwsvCbYYjycxIyK1qDv2yEi0hQviK8atKDcy9j//Z' ;
//==========================================================
// lp-small.jpg
@ -548,7 +548,7 @@ class AntiSpam
private $iData='';
private $iDD=null;
public function AntiSpam($aData='')
public function __construct($aData='')
{
$this->iData = $aData;
$this->iDD = new HandDigits();

View file

@ -1,13 +1,13 @@
<?php
/*=======================================================================
// File: JPGRAPH_BAR.PHP
// Description: Bar plot extension for JpGraph
// Created: 2001-01-08
// Ver: $Id: jpgraph_bar.php 957 2007-12-01 14:00:29Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
// File: JPGRAPH_BAR.PHP
// Description: Bar plot extension for JpGraph
// Created: 2001-01-08
// Ver: $Id: jpgraph_bar.php 1905 2009-10-06 18:00:21Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
*/
require_once('jpgraph_plotband.php');
@ -48,30 +48,42 @@ class BarPlot extends Plot
protected $bar_shadow_color="black";
protected $bar_shadow_hsize=3;
protected $bar_shadow_vsize=3;
protected $bar_3d=false;
protected $bar_3d_hsize=3;
protected $bar_3d_vsize=3;
//---------------
// CONSTRUCTOR
public function BarPlot($datay, $datax=false)
public function __construct($datay, $datax=false)
{
$this->Plot($datay, $datax);
parent::__construct($datay, $datax);
++$this->numpoints;
}
//---------------
// PUBLIC METHODS
// Set a drop shadow for the bar (or rather an "up-right" shadow)
public function SetShadow($color="black", $hsize=3, $vsize=3, $show=true)
public function SetShadow($aColor="black", $aHSize=3, $aVSize=3, $aShow=true)
{
$this->bar_shadow=$show;
$this->bar_shadow_color=$color;
$this->bar_shadow_vsize=$vsize;
$this->bar_shadow_hsize=$hsize;
$this->bar_shadow=$aShow;
$this->bar_shadow_color=$aColor;
$this->bar_shadow_vsize=$aVSize;
$this->bar_shadow_hsize=$aHSize;
// Adjust the value margin to compensate for shadow
$this->value->margin += $vsize;
$this->value->margin += $aVSize;
}
public function Set3D($aHSize=3, $aVSize=3, $aShow=true)
{
$this->bar_3d=$aShow;
$this->bar_3d_vsize=$aVSize;
$this->bar_3d_hsize=$aHSize;
$this->value->margin += $aVSize;
}
// DEPRECATED use SetYBase instead
public function SetYMin($aYStartValue)
{
@ -84,7 +96,21 @@ class BarPlot extends Plot
{
$this->ybase=$aYStartValue;
}
// The method will take the specified pattern anre
// return a pattern index that corresponds to the original
// patterm being rotated 90 degreees. This is needed when plottin
// Horizontal bars
public function RotatePattern($aPat, $aRotate=true)
{
$rotate = array(1 => 2, 2 => 1, 3 => 3, 4 => 5, 5 => 4, 6 => 6, 7 => 7, 8 => 8);
if ($aRotate) {
return $rotate[$aPat];
} else {
return $aPat;
}
}
public function Legend($graph)
{
if ($this->grad && $this->legend!="" && !$this->fill) {
@ -101,14 +127,17 @@ class BarPlot extends Plot
);
} elseif ($this->legend!="" && ($this->iPattern > -1 || is_array($this->iPattern))) {
if (is_array($this->iPattern)) {
$p1 = $this->iPattern[0];
$p1 = $this->RotatePattern($this->iPattern[0], $graph->img->a == 90);
$p2 = $this->iPatternColor[0];
$p3 = $this->iPatternDensity[0];
} else {
$p1 = $this->iPattern;
$p1 = $this->RotatePattern($this->iPattern, $graph->img->a == 90);
$p2 = $this->iPatternColor;
$p3 = $this->iPatternDensity;
}
if ($p3 < 90) {
$p3 += 5;
}
$color = array($p1,$p2,$p3,$this->fill_color);
// A kludge: Too mark that we add a pattern we use a type value of < 100
$graph->legend->Add(
@ -156,7 +185,7 @@ class BarPlot extends Plot
if (substr($graph->axtype, -3, 3)=="log" && $this->ybase==0) {
$this->ybase = $graph->yaxis->scale->GetMinVal();
}
// For a "text" X-axis scale we will adjust the
// display of the bars a little bit.
if (substr($graph->axtype, 0, 3)=="tex") {
@ -180,7 +209,7 @@ class BarPlot extends Plot
if ($this->abswidth == -1) {
// Not set
// set width to a visuable sensible default
$this->abswidth = $graph->img->plotwidth/(2*count($this->coords[0]));
$this->abswidth = $graph->img->plotwidth/(2*$this->numpoints);
}
}
}
@ -202,7 +231,7 @@ class BarPlot extends Plot
}
return $m;
}
// Specify width as fractions of the major stepo size
public function SetWidth($aWidth)
{
@ -213,32 +242,37 @@ class BarPlot extends Plot
$this->width=$aWidth;
}
}
// Specify width in absolute pixels. If specified this
// overrides SetWidth()
public function SetAbsWidth($aWidth)
{
$this->abswidth=$aWidth;
}
public function SetAlign($aAlign)
{
$this->align=$aAlign;
}
public function SetNoFill()
{
$this->grad = false;
$this->fill_color=false;
$this->fill=false;
}
public function SetFillColor($aColor)
{
// Do an extra error check if the color is specified as an RGB array triple
// In that case convert it to a hex string since it will otherwise be
// interpretated as an array of colors for each individual bar.
$aColor = RGB::tryHexConversion($aColor);
$this->fill = true ;
$this->fill_color=$aColor;
}
public function SetFillGradient($aFromColor, $aToColor=null, $aStyle=null)
{
$this->grad = true;
@ -246,7 +280,7 @@ class BarPlot extends Plot
$this->grad_tocolor = $aToColor;
$this->grad_style = $aStyle;
}
public function SetValuePos($aPos)
{
$this->valuepos = $aPos;
@ -261,7 +295,7 @@ class BarPlot extends Plot
if (is_array($aColor)) {
$this->iPatternColor = array();
if (count($aColor) != $n) {
JpGraphError::Raise('NUmber of colors is not the same as the number of patterns in BarPlot::SetPattern()');
JpGraphError::RaiseL(2001);//('NUmber of colors is not the same as the number of patterns in BarPlot::SetPattern()');
}
} else {
$this->iPatternColor = $aColor;
@ -281,49 +315,62 @@ class BarPlot extends Plot
public function _SetPatternHelper($aPattern, &$aPatternValue, &$aDensity)
{
switch ($aPattern) {
case PATTERN_DIAG1:
$aPatternValue= 1;
$aDensity = 90;
break;
case PATTERN_DIAG2:
$aPatternValue= 1;
$aDensity = 75;
break;
case PATTERN_DIAG3:
$aPatternValue= 2;
$aDensity = 90;
break;
case PATTERN_DIAG4:
$aPatternValue= 2;
$aDensity = 75;
break;
case PATTERN_CROSS1:
$aPatternValue= 8;
$aDensity = 90;
break;
case PATTERN_CROSS2:
$aPatternValue= 8;
$aDensity = 78;
break;
case PATTERN_CROSS3:
$aPatternValue= 8;
$aDensity = 65;
break;
case PATTERN_CROSS4:
$aPatternValue= 7;
$aDensity = 90;
break;
case PATTERN_STRIPE1:
$aPatternValue= 5;
$aDensity = 90;
break;
case PATTERN_STRIPE2:
$aPatternValue= 5;
$aDensity = 75;
break;
default:
JpGraphError::Raise('Unknown pattern specified in call to BarPlot::SetPattern()');
case PATTERN_DIAG1:
$aPatternValue= 1;
$aDensity = 92;
break;
case PATTERN_DIAG2:
$aPatternValue= 1;
$aDensity = 78;
break;
case PATTERN_DIAG3:
$aPatternValue= 2;
$aDensity = 92;
break;
case PATTERN_DIAG4:
$aPatternValue= 2;
$aDensity = 78;
break;
case PATTERN_CROSS1:
$aPatternValue= 8;
$aDensity = 90;
break;
case PATTERN_CROSS2:
$aPatternValue= 8;
$aDensity = 78;
break;
case PATTERN_CROSS3:
$aPatternValue= 8;
$aDensity = 65;
break;
case PATTERN_CROSS4:
$aPatternValue= 7;
$aDensity = 90;
break;
case PATTERN_STRIPE1:
$aPatternValue= 5;
$aDensity = 94;
break;
case PATTERN_STRIPE2:
$aPatternValue= 5;
$aDensity = 85;
break;
default:
JpGraphError::RaiseL(2002);
//('Unknown pattern specified in call to BarPlot::SetPattern()');
}
}
/**
* @override
* Without overriding this method, $this->numpoints does not updated correctly.
*/
public function Clear()
{
$this->isRunningClear = true;
$this->__construct($this->inputValues['aDatay'], $this->inputValues['aDatax']);
$this->isRunningClear = false;
}
public function Stroke($img, $xscale, $yscale)
@ -331,15 +378,16 @@ class BarPlot extends Plot
$numpoints = count($this->coords[0]);
if (isset($this->coords[1])) {
if (count($this->coords[1])!=$numpoints) {
JpGraphError::Raise("Number of X and Y points are not equal. Number of X-points:".count($this->coords[1])."Number of Y-points:$numpoints");
JpGraphError::RaiseL(2003, count($this->coords[1]), $numpoints);
//"Number of X and Y points are not equal. Number of X-points:".count($this->coords[1])."Number of Y-points:$numpoints");
} else {
$exist_x = true;
}
} else {
$exist_x = false;
}
$numbars=count($this->coords[0]);
// Use GetMinVal() instead of scale[0] directly since in the case
@ -361,11 +409,11 @@ class BarPlot extends Plot
if (is_array($this->iPattern)) {
$np = count($this->iPattern);
}
$grad = null;
for ($i=0; $i < $numbars; ++$i) {
// If value is NULL, or 0 then don't draw a bar at all
// If value is NULL, or 0 then don't draw a bar at all
if ($this->coords[0][$i] === null || $this->coords[0][$i] === '') {
continue;
}
@ -375,25 +423,25 @@ class BarPlot extends Plot
} else {
$x=$i;
}
$x=$xscale->Translate($x);
// Comment Note: This confuses the positioning when using acc together with
// grouped bars. Workaround for fixing #191
/*
if( !$xscale->textscale ) {
if($this->align=="center")
$x -= $abswidth/2;
elseif($this->align=="right")
$x -= $abswidth;
}
if( !$xscale->textscale ) {
if($this->align=="center")
$x -= $abswidth/2;
elseif($this->align=="right")
$x -= $abswidth;
}
*/
// Stroke fill color and fill gradient
$pts=array(
$x,$zp,
$x,$yscale->Translate($this->coords[0][$i]),
$x+$abswidth,$yscale->Translate($this->coords[0][$i]),
$x+$abswidth,$zp);
$x,$zp,
$x,$yscale->Translate($this->coords[0][$i]),
$x+$abswidth,$yscale->Translate($this->coords[0][$i]),
$x+$abswidth,$zp);
if ($this->grad) {
if ($grad === null) {
$grad = new Gradient($img);
@ -411,6 +459,10 @@ class BarPlot extends Plot
$fromcolor = $this->grad_fromcolor;
$tocolor = $this->grad_tocolor;
$style = $this->grad_style;
} else {
$fromcolor = $this->grad_fromcolor[$i % $ng][0];
$tocolor = $this->grad_fromcolor[$i % $ng][1];
$style = $this->grad_fromcolor[$i % $ng][2];
}
} else {
$fromcolor = $this->grad_fromcolor[$i % $ng][0];
@ -446,13 +498,15 @@ class BarPlot extends Plot
$img->FilledPolygon($pts);
$img->PopColor();
}
/////////////////////////kokorahen rectangle polygon//////////////////////
// Remember value of this bar
$val=$this->coords[0][$i];
if (!empty($val) && !is_numeric($val)) {
JpGraphError::Raise('All values for a barplot must be numeric. You have specified value['.$i.'] == \''.$val.'\'');
JpGraphError::RaiseL(2004, $i, $val);
//'All values for a barplot must be numeric. You have specified value['.$i.'] == \''.$val.'\'');
}
// Determine the shadow
@ -490,7 +544,7 @@ class BarPlot extends Plot
if (is_array($this->bar_shadow_color)) {
$numcolors = count($this->bar_shadow_color);
if ($numcolors == 0) {
JpGraphError::Raise('You have specified an empty array for shadow colors in the bar plot.');
JpGraphError::RaiseL(2005);//('You have specified an empty array for shadow colors in the bar plot.');
}
$img->PushColor($this->bar_shadow_color[$i % $numcolors]);
} else {
@ -498,8 +552,62 @@ class BarPlot extends Plot
}
$img->FilledPolygon($sp);
$img->PopColor();
} elseif ($this->bar_3d && $val != 0) {
// Determine the 3D
$ssh = $this->bar_3d_hsize;
$ssv = $this->bar_3d_vsize;
// Create points to create a "upper-right" shadow
if ($val > 0) {
$sp1[0]=$pts[6];
$sp1[1]=$pts[7];
$sp1[2]=$pts[4];
$sp1[3]=$pts[5];
$sp1[4]=$pts[4]+$ssh;
$sp1[5]=$pts[5]-$ssv;
$sp1[6]=$pts[6]+$ssh;
$sp1[7]=$pts[7]-$ssv;
$sp2[0]=$pts[4];
$sp2[1]=$pts[5];
$sp2[2]=$pts[2];
$sp2[3]=$pts[3];
$sp2[4]=$pts[2]+$ssh;
$sp2[5]=$pts[3]-$ssv;
$sp2[6]=$pts[4]+$ssh;
$sp2[7]=$pts[5]-$ssv;
} elseif ($val < 0) {
$sp1[0]=$pts[4];
$sp1[1]=$pts[5];
$sp1[2]=$pts[6];
$sp1[3]=$pts[7];
$sp1[4]=$pts[6]+$ssh;
$sp1[5]=$pts[7]-$ssv;
$sp1[6]=$pts[4]+$ssh;
$sp1[7]=$pts[5]-$ssv;
$sp2[0]=$pts[6];
$sp2[1]=$pts[7];
$sp2[2]=$pts[0];
$sp2[3]=$pts[1];
$sp2[4]=$pts[0]+$ssh;
$sp2[5]=$pts[1]-$ssv;
$sp2[6]=$pts[6]+$ssh;
$sp2[7]=$pts[7]-$ssv;
}
$base_color = $this->fill_color;
$img->PushColor($base_color . ':0.7');
$img->FilledPolygon($sp1);
$img->PopColor();
$img->PushColor($base_color . ':1.1');
$img->FilledPolygon($sp2);
$img->PopColor();
}
// Stroke the pattern
if (is_array($this->iPattern)) {
$f = new RectPatternFactory();
@ -540,6 +648,7 @@ class BarPlot extends Plot
$prect->Stroke($img);
}
}
// Stroke the outline of the bar
if (is_array($this->color)) {
$img->SetColor($this->color[$i % count($this->color)]);
@ -554,9 +663,11 @@ class BarPlot extends Plot
$img->SetLineWeight($this->weight);
$img->Polygon($pts);
}
// Determine how to best position the values of the individual bars
$x=$pts[2]+($pts[4]-$pts[2])/2;
$this->value->SetMargin(5);
if ($this->valuepos=='top') {
$y=$pts[3];
if ($img->a === 90) {
@ -565,6 +676,14 @@ class BarPlot extends Plot
} else {
$this->value->SetAlign('left', 'center');
}
} else {
if ($val < 0) {
$this->value->SetMargin(-5);
$y=$pts[1];
$this->value->SetAlign('center', 'bottom');
} else {
$this->value->SetAlign('center', 'bottom');
}
}
$this->value->Stroke($img, $val, $x, $y);
} elseif ($this->valuepos=='max') {
@ -576,9 +695,13 @@ class BarPlot extends Plot
$this->value->SetAlign('right', 'center');
}
} else {
$this->value->SetAlign('center', 'top');
if ($val < 0) {
$this->value->SetAlign('center', 'bottom');
} else {
$this->value->SetAlign('center', 'top');
}
}
$this->value->SetMargin(-3);
$this->value->SetMargin(-5);
$this->value->Stroke($img, $val, $x, $y);
} elseif ($this->valuepos=='center') {
$y = ($pts[3] + $pts[1])/2;
@ -597,7 +720,8 @@ class BarPlot extends Plot
$this->value->SetMargin(3);
$this->value->Stroke($img, $val, $x, $y);
} else {
JpGraphError::Raise('Unknown position for values on bars :'.$this->valuepos);
JpGraphError::RaiseL(2006, $this->valuepos);
//'Unknown position for values on bars :'.$this->valuepos);
}
// Create the client side image map
$rpts = $img->ArrRotate($pts);
@ -631,21 +755,21 @@ class BarPlot extends Plot
//===================================================
class GroupBarPlot extends BarPlot
{
private $plots;
public $plots;
private $nbrplots=0;
//---------------
// CONSTRUCTOR
public function GroupBarPlot($plots)
public function __construct($plots)
{
$this->width=0.7;
$this->plots = $plots;
$this->nbrplots = count($plots);
if ($this->nbrplots < 1) {
JpGraphError::Raise('Cannot create GroupBarPlot from empty plot array.');
JpGraphError::RaiseL(2007);//('Cannot create GroupBarPlot from empty plot array.');
}
for ($i=0; $i < $this->nbrplots; ++$i) {
if (empty($this->plots[$i]) || !isset($this->plots[$i])) {
JpGraphError::Raise("Group bar plot element nbr $i is undefined or empty.");
JpGraphError::RaiseL(2008, $i);//("Group bar plot element nbr $i is undefined or empty.");
}
}
$this->numpoints = $plots[0]->numpoints;
@ -660,24 +784,25 @@ class GroupBarPlot extends BarPlot
for ($i=0; $i < $n; ++$i) {
$c = get_class($this->plots[$i]);
if (!($this->plots[$i] instanceof BarPlot)) {
JpGraphError::Raise('One of the objects submitted to GroupBar is not a BarPlot. Make sure that you create the Group Bar plot from an array of BarPlot or AccBarPlot objects. (Class = '.$c.')');
JpGraphError::RaiseL(2009, $c);
//('One of the objects submitted to GroupBar is not a BarPlot. Make sure that you create the Group Bar plot from an array of BarPlot or AccBarPlot objects. (Class = '.$c.')');
}
$this->plots[$i]->DoLegend($graph);
}
}
public function Min()
{
list($xmin, $ymin) = $this->plots[0]->Min();
$n = count($this->plots);
for ($i=0; $i < $n; ++$i) {
list($xm, $ym) = $this->plots[$i]->Min();
$xmin = max($xmin, $xm);
$xmin = min($xmin, $xm);
$ymin = min($ymin, $ym);
}
return array($xmin,$ymin);
}
public function Max()
{
list($xmax, $ymax) = $this->plots[0]->Max();
@ -689,7 +814,7 @@ class GroupBarPlot extends BarPlot
}
return array($xmax,$ymax);
}
public function GetCSIMareas()
{
$n = count($this->plots);
@ -699,7 +824,7 @@ class GroupBarPlot extends BarPlot
}
return $csimareas;
}
// Stroke all the bars next to each other
public function Stroke($img, $xscale, $yscale)
{
@ -710,7 +835,7 @@ class GroupBarPlot extends BarPlot
for ($i=0; $i < $n; ++$i) {
$this->plots[$i]->ymin=$this->ybase;
$this->plots[$i]->SetWidth($subwidth);
// If the client have used SetTextTickInterval() then
// major_step will be > 1 and the positioning will fail.
// If we assume it is always one the positioning will work
@ -729,22 +854,35 @@ class GroupBarPlot extends BarPlot
//===================================================
class AccBarPlot extends BarPlot
{
private $plots=null;
public $plots=null;
private $nbrplots=0;
//---------------
// CONSTRUCTOR
public function AccBarPlot($plots)
public function __construct($plots)
{
$this->plots = $plots;
$this->nbrplots = count($plots);
if ($this->nbrplots < 1) {
JpGraphError::Raise('Cannot create AccBarPlot from empty plot array.');
JpGraphError::RaiseL(2010);//('Cannot create AccBarPlot from empty plot array.');
}
for ($i=0; $i < $this->nbrplots; ++$i) {
if (empty($this->plots[$i]) || !isset($this->plots[$i])) {
JpGraphError::Raise("Acc bar plot element nbr $i is undefined or empty.");
JpGraphError::RaiseL(2011, $i);//("Acc bar plot element nbr $i is undefined or empty.");
}
}
// We can only allow individual plost which do not have specified X-positions
for ($i=0; $i < $this->nbrplots; ++$i) {
if (!empty($this->plots[$i]->coords[1])) {
JpGraphError::RaiseL(2015);
//'Individual bar plots in an AccBarPlot or GroupBarPlot can not have specified X-positions.');
}
}
// Use 0 weight by default which means that the individual bar
// weights will be used per part n the accumulated bar
$this->SetWeight(0);
$this->numpoints = $plots[0]->numpoints;
$this->value = new DisplayValue();
}
@ -757,7 +895,8 @@ class AccBarPlot extends BarPlot
for ($i=$n-1; $i >= 0; --$i) {
$c = get_class($this->plots[$i]);
if (!($this->plots[$i] instanceof BarPlot)) {
JpGraphError::Raise('One of the objects submitted to AccBar is not a BarPlot. Make sure that you create the AccBar plot from an array of BarPlot objects.(Class='.$c.')');
JpGraphError::RaiseL(2012, $c);
//('One of the objects submitted to AccBar is not a BarPlot. Make sure that you create the AccBar plot from an array of BarPlot objects.(Class='.$c.')');
}
$this->plots[$i]->DoLegend($graph);
}
@ -846,6 +985,7 @@ class AccBarPlot extends BarPlot
{
$pattern=null;
$img->SetLineWeight($this->weight);
$grad=null;
for ($i=0; $i < $this->numpoints-1; $i++) {
$accy = 0;
$accy_neg = 0;
@ -862,7 +1002,7 @@ class AccBarPlot extends BarPlot
$accyt=$yscale->Translate($accy_neg);
$accy_neg+=$this->plots[$j]->coords[0][$i];
}
$xt=$xscale->Translate($i);
if ($this->abswidth > -1) {
@ -870,13 +1010,13 @@ class AccBarPlot extends BarPlot
} else {
$abswidth=round($this->width*$xscale->scale_factor, 0);
}
$pts=array($xt,$accyt,$xt,$yt,$xt+$abswidth,$yt,$xt+$abswidth,$accyt);
if ($this->bar_shadow) {
$ssh = $this->bar_shadow_hsize;
$ssv = $this->bar_shadow_vsize;
// We must also differ if we are a positive or negative bar.
if ($j === 0) {
// This gets extra complicated since we have to
@ -909,7 +1049,7 @@ class AccBarPlot extends BarPlot
if (is_array($this->bar_shadow_color)) {
$numcolors = count($this->bar_shadow_color);
if ($numcolors == 0) {
JpGraphError::Raise('You have specified an empty array for shadow colors in the bar plot.');
JpGraphError::RaiseL(2013);//('You have specified an empty array for shadow colors in the bar plot.');
}
$img->PushColor($this->bar_shadow_color[$i % $numcolors]);
} else {
@ -944,16 +1084,53 @@ class AccBarPlot extends BarPlot
}
if ($this->plots[$j]->grad) {
$grad = new Gradient($img);
$grad->FilledRectangle(
$pts[2],
$pts[3],
$pts[6],
$pts[7],
$this->plots[$j]->grad_fromcolor,
$this->plots[$j]->grad_tocolor,
$this->plots[$j]->grad_style
);
if ($grad === null) {
$grad = new Gradient($img);
}
if (is_array($this->plots[$j]->grad_fromcolor)) {
// The first argument (grad_fromcolor) can be either an array or a single color. If it is an array
// then we have two choices. It can either a) be a single color specified as an RGB triple or it can be
// an array to specify both (from, to style) for each individual bar. The way to know the difference is
// to investgate the first element. If this element is an integer [0,255] then we assume it is an RGB
// triple.
$ng = count($this->plots[$j]->grad_fromcolor);
if ($ng === 3) {
if (is_numeric($this->plots[$j]->grad_fromcolor[0]) && $this->plots[$j]->grad_fromcolor[0] > 0 &&
$this->plots[$j]->grad_fromcolor[0] < 256) {
// RGB Triple
$fromcolor = $this->plots[$j]->grad_fromcolor;
$tocolor = $this->plots[$j]->grad_tocolor;
$style = $this->plots[$j]->grad_style;
} else {
$fromcolor = $this->plots[$j]->grad_fromcolor[$i % $ng][0];
$tocolor = $this->plots[$j]->grad_fromcolor[$i % $ng][1];
$style = $this->plots[$j]->grad_fromcolor[$i % $ng][2];
}
} else {
$fromcolor = $this->plots[$j]->grad_fromcolor[$i % $ng][0];
$tocolor = $this->plots[$j]->grad_fromcolor[$i % $ng][1];
$style = $this->plots[$j]->grad_fromcolor[$i % $ng][2];
}
$grad->FilledRectangle(
$pts[2],
$pts[3],
$pts[6],
$pts[7],
$fromcolor,
$tocolor,
$style
);
} else {
$grad->FilledRectangle(
$pts[2],
$pts[3],
$pts[6],
$pts[7],
$this->plots[$j]->grad_fromcolor,
$this->plots[$j]->grad_tocolor,
$this->plots[$j]->grad_style
);
}
} else {
if (is_array($this->plots[$j]->fill_color)) {
$numcolors = count($this->plots[$j]->fill_color);
@ -971,15 +1148,16 @@ class AccBarPlot extends BarPlot
if ($fillcolor !== false) {
$img->FilledPolygon($pts);
}
$img->SetColor($this->plots[$j]->color);
}
$img->SetColor($this->plots[$j]->color);
// Stroke the pattern
if ($this->plots[$j]->iPattern > -1) {
if ($pattern===null) {
$pattern = new RectPatternFactory();
}
$prect = $pattern->Create($this->plots[$j]->iPattern, $this->plots[$j]->iPatternColor, 1);
$prect->SetDensity($this->plots[$j]->iPatternDensity);
if ($this->plots[$j]->coords[0][$i] < 0) {
@ -1024,13 +1202,21 @@ class AccBarPlot extends BarPlot
$pts[] = $pts[0];
$pts[] = $pts[1];
$img->SetLineWeight($this->plots[$j]->line_weight);
$img->SetLineWeight($this->plots[$j]->weight);
$img->Polygon($pts);
$img->SetLineWeight(1);
}
// Daw potential bar around the entire accbar bar
if ($this->weight > 0) {
$y=$yscale->Translate(0);
$img->SetColor($this->color);
$img->SetLineWeight($this->weight);
$img->Rectangle($pts[0], $y, $pts[6], $pts[5]);
}
// Draw labels for each acc.bar
$x=$pts[2]+($pts[4]-$pts[2])/2;
if ($this->bar_shadow) {
$x += $ssh;
@ -1038,23 +1224,22 @@ class AccBarPlot extends BarPlot
// First stroke the accumulated value for the entire bar
// This value is always placed at the top/bottom of the bars
if ($accy_neg < 0) {
if ($accy + $accy_neg < 0) {
$y=$yscale->Translate($accy_neg);
$this->value->Stroke($img, $accy_neg, $x, $y);
} else {
$y=$yscale->Translate($accy);
$this->value->Stroke($img, $accy, $x, $y);
}
$this->value->Stroke($img, $accy + $accy_neg, $x, $y);
$accy = 0;
$accy_neg = 0;
for ($j=0; $j < $this->nbrplots; ++$j) {
// We don't print 0 values in an accumulated bar plot
// We don't print 0 values in an accumulated bar plot
if ($this->plots[$j]->coords[0][$i] == 0) {
continue;
}
if ($this->plots[$j]->coords[0][$i] > 0) {
$yt=$yscale->Translate($this->plots[$j]->coords[0][$i]+$accy);
$accyt=$yscale->Translate($accy);
@ -1098,7 +1283,7 @@ class AccBarPlot extends BarPlot
$this->plots[$j]->value->SetMargin(-1);
}
}
$this->plots[$j]->value->Stroke($img, $this->plots[$j]->coords[0][$i], $x, $y);
$this->plots[$j]->value->Stroke($img, $this->plots[$j]->coords[0][$i], round($x), round($y));
}
}
return true;

View file

@ -1,13 +1,13 @@
<?php
/*=======================================================================
// File: JPGRAPH_CANVAS.PHP
// Description: Canvas drawing extension for JpGraph
// Created: 2001-01-08
// Ver: $Id: jpgraph_canvas.php 781 2006-10-08 08:07:47Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
// 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
@ -21,9 +21,9 @@ class CanvasGraph extends Graph
{
//---------------
// CONSTRUCTOR
public function CanvasGraph($aWidth=300, $aHeight=200, $aCachedName="", $timeout=0, $inline=1)
public function __construct($aWidth=300, $aHeight=200, $aCachedName="", $timeout=0, $inline=1)
{
$this->Graph($aWidth, $aHeight, $aCachedName, $timeout, $inline);
parent::__construct($aWidth, $aHeight, $aCachedName, $timeout, $inline);
}
//---------------
@ -66,12 +66,12 @@ class CanvasGraph extends Graph
if (!$_csim) {
// Should we do any final image transformation
// Should we do any final image transformation
if ($this->iImgTrans) {
if (!class_exists('ImgTrans')) {
if (!class_exists('ImgTrans', false)) {
require_once('jpgraph_imgtrans.php');
}
$tform = new ImgTrans($this->img->img);
$this->img->img = $tform->Skew3D(
$this->iImgTransHorizon,
@ -83,7 +83,7 @@ class CanvasGraph extends Graph
$this->iImgTransBorder
);
}
// If the filename is given as the special _IMG_HANDLER
// then the image handler is returned and the image is NOT

View file

@ -1,18 +1,18 @@
<?php
/*=======================================================================
// File: JPGRAPH_CANVTOOLS.PHP
// Description: Some utilities for text and shape drawing on a canvas
// Created: 2002-08-23
// Ver: $Id: jpgraph_canvtools.php 781 2006-10-08 08:07:47Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
// File: JPGRAPH_CANVTOOLS.PHP
// Description: Some utilities for text and shape drawing on a canvas
// Created: 2002-08-23
// Ver: $Id: jpgraph_canvtools.php 1857 2009-09-28 14:38:14Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
*/
DEFINE('CORNER_TOPLEFT', 0);
DEFINE('CORNER_TOPRIGHT', 1);
DEFINE('CORNER_BOTTOMRIGHT', 2);
DEFINE('CORNER_BOTTOMLEFT', 3);
define('CORNER_TOPLEFT', 0);
define('CORNER_TOPRIGHT', 1);
define('CORNER_BOTTOMRIGHT', 2);
define('CORNER_BOTTOMLEFT', 3);
//===================================================
@ -20,7 +20,7 @@ DEFINE('CORNER_BOTTOMLEFT', 3);
// Description: Define a scale for canvas so we
// can abstract away with absolute pixels
//===================================================
class CanvasScale
{
private $g;
@ -31,7 +31,7 @@ class CanvasScale
private $iymin=0;
private $iymax=10;
public function CanvasScale($graph, $xmin=0, $xmax=10, $ymin=0, $ymax=10)
public function __construct($graph, $xmin=0, $xmax=10, $ymin=0, $ymax=10)
{
$this->g = $graph;
$this->w = $graph->img->width;
@ -41,7 +41,7 @@ class CanvasScale
$this->iymin = $ymin;
$this->iymax = $ymax;
}
public function Set($xmin=0, $xmax=10, $ymin=0, $ymax=10)
{
$this->ixmin = $xmin;
@ -50,6 +50,11 @@ class CanvasScale
$this->iymax = $ymax;
}
public function Get()
{
return array($this->ixmin,$this->ixmax,$this->iymin,$this->iymax);
}
public function Translate($x, $y)
{
$xp = round(($x-$this->ixmin)/($this->ixmax - $this->ixmin) * $this->w);
@ -80,7 +85,7 @@ class Shape
private $img;
private $scale;
public function Shape($aGraph, $scale)
public function __construct($aGraph, $scale)
{
$this->img = $aGraph->img;
$this->img->SetColor('black');
@ -99,6 +104,11 @@ class Shape
$this->img->Line($x1, $y1, $x2, $y2);
}
public function SetLineWeight($aWeight)
{
$this->img->SetLineWeight($aWeight);
}
public function Polygon($p, $aClosed=false)
{
$n=count($p);
@ -118,7 +128,7 @@ class Shape
}
$this->img->FilledPolygon($p);
}
// Draw a bezier curve with defining points in the $aPnts array
// using $aSteps steps.
@ -168,7 +178,7 @@ class Shape
list($x2, $y2) = $this->scale->Translate($x2, $y2);
$this->img->FilledRectangle($x1, $y1, $x2, $y2);
}
public function Circle($x1, $y1, $r)
{
list($x1, $y1) = $this->scale->Translate($x1, $y1);
@ -252,149 +262,149 @@ class Shape
list($xt, $yt) = $this->scale->Translate($xt, $yt);
list($w, $h) = $this->scale->Translate($w, $h);
list($iw, $ih) = $this->scale->Translate($iw, $ih);
$xr = $xt + $w - 0;
$yl = $yt + $h - 0;
switch ($aCorner) {
case 0: // Upper left
// Bottom line, left & right arc
$this->img->Line($xt+$r, $yl, $xr-$r, $yl);
$this->img->Arc($xt+$r, $yl-$r, $r*2, $r*2, 90, 180);
$this->img->Arc($xr-$r, $yl-$r, $r*2, $r*2, 0, 90);
case 0: // Upper left
// Bottom line, left & right arc
$this->img->Line($xt+$r, $yl, $xr-$r, $yl);
$this->img->Arc($xt+$r, $yl-$r, $r*2, $r*2, 90, 180);
$this->img->Arc($xr-$r, $yl-$r, $r*2, $r*2, 0, 90);
// Right line, Top right arc
$this->img->Line($xr, $yt+$r, $xr, $yl-$r);
$this->img->Arc($xr-$r, $yt+$r, $r*2, $r*2, 270, 360);
// Right line, Top right arc
$this->img->Line($xr, $yt+$r, $xr, $yl-$r);
$this->img->Arc($xr-$r, $yt+$r, $r*2, $r*2, 270, 360);
// Top line, Top left arc
$this->img->Line($xt+$iw+$r, $yt, $xr-$r, $yt);
$this->img->Arc($xt+$iw+$r, $yt+$r, $r*2, $r*2, 180, 270);
// Top line, Top left arc
$this->img->Line($xt+$iw+$r, $yt, $xr-$r, $yt);
$this->img->Arc($xt+$iw+$r, $yt+$r, $r*2, $r*2, 180, 270);
// Left line
$this->img->Line($xt, $yt+$ih+$r, $xt, $yl-$r);
// Left line
$this->img->Line($xt, $yt+$ih+$r, $xt, $yl-$r);
// Indent horizontal, Lower left arc
$this->img->Line($xt+$r, $yt+$ih, $xt+$iw-$r, $yt+$ih);
$this->img->Arc($xt+$r, $yt+$ih+$r, $r*2, $r*2, 180, 270);
// Indent horizontal, Lower left arc
$this->img->Line($xt+$r, $yt+$ih, $xt+$iw-$r, $yt+$ih);
$this->img->Arc($xt+$r, $yt+$ih+$r, $r*2, $r*2, 180, 270);
// Indent vertical, Indent arc
$this->img->Line($xt+$iw, $yt+$r, $xt+$iw, $yt+$ih-$r);
$this->img->Arc($xt+$iw-$r, $yt+$ih-$r, $r*2, $r*2, 0, 90);
// Indent vertical, Indent arc
$this->img->Line($xt+$iw, $yt+$r, $xt+$iw, $yt+$ih-$r);
$this->img->Arc($xt+$iw-$r, $yt+$ih-$r, $r*2, $r*2, 0, 90);
if ($aFillColor != '') {
$bc = $this->img->current_color_name;
$this->img->PushColor($aFillColor);
$this->img->FillToBorder($xr-$r, $yl-$r, $bc);
$this->img->PopColor();
if ($aFillColor != '') {
$bc = $this->img->current_color_name;
$this->img->PushColor($aFillColor);
$this->img->FillToBorder($xr-$r, $yl-$r, $bc);
$this->img->PopColor();
}
break;
case 1: // Upper right
// Bottom line, left & right arc
$this->img->Line($xt+$r, $yl, $xr-$r, $yl);
$this->img->Arc($xt+$r, $yl-$r, $r*2, $r*2, 90, 180);
$this->img->Arc($xr-$r, $yl-$r, $r*2, $r*2, 0, 90);
// Left line, Top left arc
$this->img->Line($xt, $yt+$r, $xt, $yl-$r);
$this->img->Arc($xt+$r, $yt+$r, $r*2, $r*2, 180, 270);
// Top line, Top right arc
$this->img->Line($xt+$r, $yt, $xr-$iw-$r, $yt);
$this->img->Arc($xr-$iw-$r, $yt+$r, $r*2, $r*2, 270, 360);
// Right line
$this->img->Line($xr, $yt+$ih+$r, $xr, $yl-$r);
// Indent horizontal, Lower right arc
$this->img->Line($xr-$iw+$r, $yt+$ih, $xr-$r, $yt+$ih);
$this->img->Arc($xr-$r, $yt+$ih+$r, $r*2, $r*2, 270, 360);
// Indent vertical, Indent arc
$this->img->Line($xr-$iw, $yt+$r, $xr-$iw, $yt+$ih-$r);
$this->img->Arc($xr-$iw+$r, $yt+$ih-$r, $r*2, $r*2, 90, 180);
if ($aFillColor != '') {
$bc = $this->img->current_color_name;
$this->img->PushColor($aFillColor);
$this->img->FillToBorder($xt+$r, $yl-$r, $bc);
$this->img->PopColor();
}
break;
case 2: // Lower right
// Top line, Top left & Top right arc
$this->img->Line($xt+$r, $yt, $xr-$r, $yt);
$this->img->Arc($xt+$r, $yt+$r, $r*2, $r*2, 180, 270);
$this->img->Arc($xr-$r, $yt+$r, $r*2, $r*2, 270, 360);
// Left line, Bottom left arc
$this->img->Line($xt, $yt+$r, $xt, $yl-$r);
$this->img->Arc($xt+$r, $yl-$r, $r*2, $r*2, 90, 180);
// Bottom line, Bottom right arc
$this->img->Line($xt+$r, $yl, $xr-$iw-$r, $yl);
$this->img->Arc($xr-$iw-$r, $yl-$r, $r*2, $r*2, 0, 90);
// Right line
$this->img->Line($xr, $yt+$r, $xr, $yl-$ih-$r);
// Indent horizontal, Lower right arc
$this->img->Line($xr-$r, $yl-$ih, $xr-$iw+$r, $yl-$ih);
$this->img->Arc($xr-$r, $yl-$ih-$r, $r*2, $r*2, 0, 90);
// Indent vertical, Indent arc
$this->img->Line($xr-$iw, $yl-$r, $xr-$iw, $yl-$ih+$r);
$this->img->Arc($xr-$iw+$r, $yl-$ih+$r, $r*2, $r*2, 180, 270);
if ($aFillColor != '') {
$bc = $this->img->current_color_name;
$this->img->PushColor($aFillColor);
$this->img->FillToBorder($xt+$r, $yt+$r, $bc);
$this->img->PopColor();
}
break;
case 3: // Lower left
// Top line, Top left & Top right arc
$this->img->Line($xt+$r, $yt, $xr-$r, $yt);
$this->img->Arc($xt+$r, $yt+$r, $r*2, $r*2, 180, 270);
$this->img->Arc($xr-$r, $yt+$r, $r*2, $r*2, 270, 360);
// Right line, Bottom right arc
$this->img->Line($xr, $yt+$r, $xr, $yl-$r);
$this->img->Arc($xr-$r, $yl-$r, $r*2, $r*2, 0, 90);
// Bottom line, Bottom left arc
$this->img->Line($xt+$iw+$r, $yl, $xr-$r, $yl);
$this->img->Arc($xt+$iw+$r, $yl-$r, $r*2, $r*2, 90, 180);
// Left line
$this->img->Line($xt, $yt+$r, $xt, $yl-$ih-$r);
// Indent horizontal, Lower left arc
$this->img->Line($xt+$r, $yl-$ih, $xt+$iw-$r, $yl-$ih);
$this->img->Arc($xt+$r, $yl-$ih-$r, $r*2, $r*2, 90, 180);
// Indent vertical, Indent arc
$this->img->Line($xt+$iw, $yl-$ih+$r, $xt+$iw, $yl-$r);
$this->img->Arc($xt+$iw-$r, $yl-$ih+$r, $r*2, $r*2, 270, 360);
if ($aFillColor != '') {
$bc = $this->img->current_color_name;
$this->img->PushColor($aFillColor);
$this->img->FillToBorder($xr-$r, $yt+$r, $bc);
$this->img->PopColor();
}
break;
}
break;
case 1: // Upper right
// Bottom line, left & right arc
$this->img->Line($xt+$r, $yl, $xr-$r, $yl);
$this->img->Arc($xt+$r, $yl-$r, $r*2, $r*2, 90, 180);
$this->img->Arc($xr-$r, $yl-$r, $r*2, $r*2, 0, 90);
// Left line, Top left arc
$this->img->Line($xt, $yt+$r, $xt, $yl-$r);
$this->img->Arc($xt+$r, $yt+$r, $r*2, $r*2, 180, 270);
// Top line, Top right arc
$this->img->Line($xt+$r, $yt, $xr-$iw-$r, $yt);
$this->img->Arc($xr-$iw-$r, $yt+$r, $r*2, $r*2, 270, 360);
// Right line
$this->img->Line($xr, $yt+$ih+$r, $xr, $yl-$r);
// Indent horizontal, Lower right arc
$this->img->Line($xr-$iw+$r, $yt+$ih, $xr-$r, $yt+$ih);
$this->img->Arc($xr-$r, $yt+$ih+$r, $r*2, $r*2, 270, 360);
// Indent vertical, Indent arc
$this->img->Line($xr-$iw, $yt+$r, $xr-$iw, $yt+$ih-$r);
$this->img->Arc($xr-$iw+$r, $yt+$ih-$r, $r*2, $r*2, 90, 180);
if ($aFillColor != '') {
$bc = $this->img->current_color_name;
$this->img->PushColor($aFillColor);
$this->img->FillToBorder($xt+$r, $yl-$r, $bc);
$this->img->PopColor();
}
break;
case 2: // Lower right
// Top line, Top left & Top right arc
$this->img->Line($xt+$r, $yt, $xr-$r, $yt);
$this->img->Arc($xt+$r, $yt+$r, $r*2, $r*2, 180, 270);
$this->img->Arc($xr-$r, $yt+$r, $r*2, $r*2, 270, 360);
// Left line, Bottom left arc
$this->img->Line($xt, $yt+$r, $xt, $yl-$r);
$this->img->Arc($xt+$r, $yl-$r, $r*2, $r*2, 90, 180);
// Bottom line, Bottom right arc
$this->img->Line($xt+$r, $yl, $xr-$iw-$r, $yl);
$this->img->Arc($xr-$iw-$r, $yl-$r, $r*2, $r*2, 0, 90);
// Right line
$this->img->Line($xr, $yt+$r, $xr, $yl-$ih-$r);
// Indent horizontal, Lower right arc
$this->img->Line($xr-$r, $yl-$ih, $xr-$iw+$r, $yl-$ih);
$this->img->Arc($xr-$r, $yl-$ih-$r, $r*2, $r*2, 0, 90);
// Indent vertical, Indent arc
$this->img->Line($xr-$iw, $yl-$r, $xr-$iw, $yl-$ih+$r);
$this->img->Arc($xr-$iw+$r, $yl-$ih+$r, $r*2, $r*2, 180, 270);
if ($aFillColor != '') {
$bc = $this->img->current_color_name;
$this->img->PushColor($aFillColor);
$this->img->FillToBorder($xt+$r, $yt+$r, $bc);
$this->img->PopColor();
}
break;
case 3: // Lower left
// Top line, Top left & Top right arc
$this->img->Line($xt+$r, $yt, $xr-$r, $yt);
$this->img->Arc($xt+$r, $yt+$r, $r*2, $r*2, 180, 270);
$this->img->Arc($xr-$r, $yt+$r, $r*2, $r*2, 270, 360);
// Right line, Bottom right arc
$this->img->Line($xr, $yt+$r, $xr, $yl-$r);
$this->img->Arc($xr-$r, $yl-$r, $r*2, $r*2, 0, 90);
// Bottom line, Bottom left arc
$this->img->Line($xt+$iw+$r, $yl, $xr-$r, $yl);
$this->img->Arc($xt+$iw+$r, $yl-$r, $r*2, $r*2, 90, 180);
// Left line
$this->img->Line($xt, $yt+$r, $xt, $yl-$ih-$r);
// Indent horizontal, Lower left arc
$this->img->Line($xt+$r, $yl-$ih, $xt+$iw-$r, $yl-$ih);
$this->img->Arc($xt+$r, $yl-$ih-$r, $r*2, $r*2, 90, 180);
// Indent vertical, Indent arc
$this->img->Line($xt+$iw, $yl-$ih+$r, $xt+$iw, $yl-$r);
$this->img->Arc($xt+$iw-$r, $yl-$ih+$r, $r*2, $r*2, 270, 360);
if ($aFillColor != '') {
$bc = $this->img->current_color_name;
$this->img->PushColor($aFillColor);
$this->img->FillToBorder($xr-$r, $yt+$r, $bc);
$this->img->PopColor();
}
break;
}
}
}
@ -420,7 +430,7 @@ class CanvasRectangleText
private $iShadowWidth=3;
private $iShadowColor='';
public function CanvasRectangleText($aTxt='', $xl=0, $yt=0, $w=0, $h=0)
public function __construct($aTxt='', $xl=0, $yt=0, $w=0, $h=0)
{
$this->iTxt = new Text($aTxt);
$this->ix = $xl;
@ -428,7 +438,7 @@ class CanvasRectangleText
$this->iw = $w;
$this->ih = $h;
}
public function SetShadow($aColor='gray', $aWidth=3)
{
$this->iShadowColor = $aColor;
@ -502,8 +512,8 @@ class CanvasRectangleText
public function Stroke($aImg, $scale)
{
// If coordinates are specifed as negative this means we should
// If coordinates are specifed as negative this means we should
// treat them as abolsute (pixels) coordinates
if ($this->ix > 0) {
$this->ix = $scale->TranslateX($this->ix) ;
@ -516,7 +526,7 @@ class CanvasRectangleText
} else {
$this->iy = -$this->iy;
}
list($this->iw, $this->ih) = $scale->Translate($this->iw, $this->ih) ;
if ($this->iw == 0) {
@ -561,7 +571,7 @@ class CanvasRectangleText
);
$aImg->PopColor();
}
$this->iTxt->Align('center', 'center');
$this->iTxt->ParagraphAlign($this->iParaAlign);
$this->iTxt->SetColor($this->iFontColor);

View file

@ -0,0 +1,613 @@
<?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;
private $nbrRows=0;
private $horizEdges = array();
private $vertEdges=array();
private $isobarValues = array();
private $stack = null;
private $isobarCoord = array();
private $nbrIsobars = 10;
private $isobarColors = array();
private $invert = true;
private $highcontrast = false;
private $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
*/
public 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)
*/
public function SetInvert($aFlg=true)
{
$this->invert = $aFlg;
}
/**
* Find the min and max values in the data matrice
*
* @return array(min_value,max_value)
*/
public 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
*/
public 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
*/
public 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
*/
public 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
*/
public 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
*/
public 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.
*
*/
public 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
*/
public function UseHighContrastColor($aFlg=true, $aBW=false)
{
$this->highcontrast = $aFlg;
$this->highcontrastbw = $aBW;
}
/**
* Calculate suitable colors for each defined isobar
*
*/
public 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 )
*/
public 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;
private $contourCoord;
private $contourVal;
private $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;
private $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
*/
public 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
*
*/
public function SetInvert($aFlg=true)
{
$this->flipData = $aFlg;
}
/**
* Set the colors for the isobar lines
*
* @param $aColorArray
*
*/
public function SetIsobarColors($aColorArray)
{
$this->manualIsobarColors = $aColorArray;
}
/**
* Show the legend
*
* @param $aFlg true if the legend should be shown
*
*/
public function ShowLegend($aFlg=true)
{
$this->showLegend = $aFlg;
}
/**
* @param $aFlg true if the legend should start with the lowest isobar on top
* @return unknown_type
*/
public function Invertlegend($aFlg=true)
{
$this->invertLegend = $aFlg;
}
/* Internal method. Give the min value to be used for the scaling
*
*/
public function Min()
{
return array(0,0);
}
/* Internal method. Give the max value to be used for the scaling
*
*/
public 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
*/
public 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)
*
*/
public 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
*/
public 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
*/
public 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

View file

@ -1,49 +1,49 @@
<?php
/*=======================================================================
// File: JPGRAPH_DATE.PHP
// Description: Classes to handle Date scaling
// Created: 2005-05-02
// Ver: $Id: jpgraph_date.php 912 2007-09-26 21:00:35Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
// 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('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('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('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('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('MONTHADJ_1', 0+20);
define('MONTHADJ_6', 1+20);
DEFINE('DAYADJ_1', 0);
DEFINE('DAYADJ_WEEK', 1);
DEFINE('DAYADJ_7', 1);
define('DAYADJ_1', 0);
define('DAYADJ_WEEK', 1);
define('DAYADJ_7', 1);
DEFINE('SECPERYEAR', 31536000);
DEFINE('SECPERDAY', 86400);
DEFINE('SECPERHOUR', 3600);
DEFINE('SECPERMIN', 60);
define('SECPERYEAR', 31536000);
define('SECPERDAY', 86400);
define('SECPERHOUR', 3600);
define('SECPERMIN', 60);
class DateScale extends LinearScale
@ -56,11 +56,11 @@ class DateScale extends LinearScale
//---------------
// CONSTRUCTOR
public function DateScale($aMin=0, $aMax=0, $aType='x')
public 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;
@ -113,14 +113,14 @@ class DateScale extends LinearScale
}
} 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;
}
}
$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 {
@ -256,73 +256,73 @@ class DateScale extends LinearScale
{
// 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) )
// 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) ),
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) ),
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)),
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)),
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)),
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)),
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) ),
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) ),
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) ),
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)),
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)),
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)),
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)),
array(1),
array(1,SECADJ_1)),
);
$ns = count($scalePoints);
@ -433,10 +433,16 @@ class DateScale extends LinearScale
// identical to LinearScale::AutoScale
if ($aStartTime == $aEndTime) {
// Special case when we only have one data point.
// Create a small artifical intervall to do the autoscaling
// 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) {
@ -447,19 +453,19 @@ class DateScale extends LinearScale
}
$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( 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');
@ -485,7 +491,7 @@ class DateScale extends LinearScale
}
if ($this->iStartAlign !== false) {
if ($this->iStartAlign >= 30) {
$adjstart = $this->AdjStartDate($aStartTime, $this->iStartAlign-30);

View file

@ -1,15 +1,22 @@
<?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 973 2008-03-09 15:29:44Z ljp $
// 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;
@ -17,7 +24,7 @@ $__jpg_err_locale = DEFAULT_ERR_LOCALE;
class ErrMsgText
{
private $lt=null;
public function ErrMsgText()
public function __construct()
{
global $__jpg_err_locale;
$file = 'lang/'.$__jpg_err_locale.'.inc.php';
@ -65,30 +72,30 @@ class ErrMsgText
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;
}
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
@ -96,14 +103,12 @@ class ErrMsgText
//
class JpGraphError
{
private static $__jpg_err;
public static function Install($aErrObject)
{
self::$__jpg_err = new $aErrObject;
}
private static $__iImgFlg = true;
private static $__iLogFile = '';
private static $__iTitle = 'JpGraph Error: ';
public static function Raise($aMsg, $aHalt=true)
{
self::$__jpg_err->Raise($aMsg, $aHalt);
throw new JpGraphException($aMsg);
}
public static function SetErrLocale($aLoc)
{
@ -112,12 +117,91 @@ class JpGraphError
}
public static function RaiseL($errnbr, $a1=null, $a2=null, $a3=null, $a4=null, $a5=null)
{
$t = new ErrMsgText();
$msg = $t->Get($errnbr, $a1, $a2, $a3, $a4, $a5);
self::$__jpg_err->Raise($msg);
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());
}
public static 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
//
@ -127,11 +211,11 @@ class JpGraphError
//=============================================================
class JpGraphErrObject
{
protected $iTitle = "JpGraph Error";
protected $iTitle = "JpGraph error: ";
protected $iDest = false;
public function JpGraphErrObject()
public function __construct()
{
// Empty. Reserved for future use
}
@ -147,20 +231,31 @@ class JpGraphErrObject
}
// If aHalt is true then execution can't continue. Typical used for fatal errors
public function Raise($aMsg, $aHalt=true)
public function Raise($aMsg, $aHalt=false)
{
$aMsg = $this->iTitle.' '.$aMsg;
if ($this->iDest) {
$f = @fopen($this->iDest, 'a');
if ($f) {
@fwrite($f, $aMsg);
@fclose($f);
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 {
echo $aMsg;
$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) {
die();
exit(1);
}
}
}
@ -170,25 +265,32 @@ class JpGraphErrObject
//==============================================================
class JpGraphErrObjectImg extends JpGraphErrObject
{
public function __construct()
{
parent::__construct();
// Empty. Reserved for future use
}
public 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==' ;
'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 {
@ -198,7 +300,7 @@ class JpGraphErrObjectImg extends JpGraphErrObject
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).
@ -224,7 +326,7 @@ class JpGraphErrObjectImg extends JpGraphErrObject
$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);
@ -234,7 +336,7 @@ class JpGraphErrObjectImg extends JpGraphErrObject
$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) {
@ -257,17 +359,18 @@ class JpGraphErrObjectImg extends JpGraphErrObject
// Window title
$m = floor($w/2-5);
$l = 100;
$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-50, 15, $this->iTitle);
$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) {
@ -283,9 +386,7 @@ class JpGraphErrObjectImg extends JpGraphErrObject
}
// Install the default error handler
if (USE_IMAGE_ERROR_HANDLER) {
JpGraphError::Install("JpGraphErrObjectImg");
} else {
JpGraphError::Install("JpGraphErrObject");
if (! USE_IMAGE_ERROR_HANDLER) {
JpGraphError::SetImageFlag(false);
}

View file

@ -1,14 +1,14 @@
<?php
/*=======================================================================
// File: JPGRAPH_ERROR.PHP
// Description: Error plot extension for JpGraph
// Created: 2001-01-08
// Ver: $Id: jpgraph_error.php 781 2006-10-08 08:07:47Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
// 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
@ -17,16 +17,17 @@
class ErrorPlot extends Plot
{
private $errwidth=2;
//---------------
// CONSTRUCTOR
public function ErrorPlot($datay, $datax=false)
public function __construct($datay, $datax=false)
{
$this->Plot($datay, $datax);
parent::__construct($datay, $datax);
$this->numpoints /= 2;
}
//---------------
// PUBLIC METHODS
// Gets called before any axis are stroked
public function PreStrokeAdjust($graph)
{
@ -42,7 +43,7 @@ class ErrorPlot extends Plot
$graph->SetTextScaleOff($b);
//$graph->xaxis->scale->ticks->SupressMinorTickMarks();
}
// Method description
public function Stroke($img, $xscale, $yscale)
{
@ -70,7 +71,7 @@ class ErrorPlot extends Plot
}
if (!is_numeric($x) ||
!is_numeric($this->coords[0][$i*2]) || !is_numeric($this->coords[0][$i*2+1])) {
!is_numeric($this->coords[0][$i*2]) || !is_numeric($this->coords[0][$i*2+1])) {
continue;
}
@ -97,9 +98,9 @@ class ErrorLinePlot extends ErrorPlot
public $line=null;
//---------------
// CONSTRUCTOR
public function ErrorLinePlot($datay, $datax=false)
public function __construct($datay, $datax=false)
{
$this->ErrorPlot($datay, $datax);
parent::__construct($datay, $datax);
// Calculate line coordinates as the average of the error limits
$n = count($datay);
for ($i=0; $i < $n; $i+=2) {
@ -117,7 +118,7 @@ class ErrorLinePlot extends ErrorPlot
}
$this->line->Legend($graph);
}
public function Stroke($img, $xscale, $yscale)
{
parent::Stroke($img, $xscale, $yscale);
@ -136,7 +137,7 @@ class LineErrorPlot extends ErrorPlot
//---------------
// CONSTRUCTOR
// Data is (val, errdeltamin, errdeltamax)
public function LineErrorPlot($datay, $datax=false)
public function __construct($datay, $datax=false)
{
$ly=array();
$ey=array();
@ -150,7 +151,7 @@ class LineErrorPlot extends ErrorPlot
$ey[]=$datay[$i]+$datay[$i+1];
$ey[]=$datay[$i]+$datay[$i+2];
}
$this->ErrorPlot($ey, $datax);
parent::__construct($ey, $datax);
$this->line=new LinePlot($ly, $datax);
}
@ -163,7 +164,7 @@ class LineErrorPlot extends ErrorPlot
}
$this->line->Legend($graph);
}
public function Stroke($img, $xscale, $yscale)
{
parent::Stroke($img, $xscale, $yscale);

View file

@ -1,11 +1,11 @@
<?php
//=======================================================================
// File: JPGRAPH_FLAGS.PHP
// Description: Class Jpfile. Handles plotmarks
// Created: 2003-06-28
// Ver: $Id: jpgraph_flags.php 957 2007-12-01 14:00:29Z ljp $
// 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) Aditus Consulting. All rights reserved.
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
//------------------------------------------------------------
@ -267,22 +267,22 @@ class FlagImages
private $iFlagData ;
private $iOrdIdx=array();
public function FlagImages($aSize=FLAGSIZE1)
public 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.')');
}
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);
}
@ -304,7 +304,7 @@ class FlagImages
return Image::CreateFromString($d);
} else {
JpGraphError::RaiseL(5002, $aIdx);
//("Flag index \" $aIdx\" does not exist.");
//("Flag index \"<EFBFBD>$aIdx\" does not exist.");
}
}
@ -313,10 +313,9 @@ class FlagImages
$aOrd--;
$n = count($this->iOrdIdx);
if ($n == 0) {
reset($this->iCountryNameMap);
$this->iOrdIdx=array();
$i=0;
while (list($key, $val) = each($this->iCountryNameMap)) {
foreach ($this->iCountryNameMap as $key => $val) {
$this->iOrdIdx[$i++] = array($val,$key);
}
$tmp=$this->iOrdIdx[$aOrd];
@ -342,18 +341,16 @@ class FlagImages
$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)) {
foreach ($this->iCountryNameMap as $key => $val) {
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)) {
foreach ($this->iCountryNameMap as $key => $val) {
if (strpos(strtolower($key), $aName) !== false) {
$found=true;
break;

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,28 +1,28 @@
<?php
/*=======================================================================
// File: JPGRAPH_GRADIENT.PHP
// Description: Create a color gradient
// Created: 2003-02-01
// Ver: $Id: jpgraph_gradient.php 947 2007-10-19 22:14:19Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
// 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);
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
@ -34,7 +34,7 @@ class Gradient
private $numcolors=100;
//---------------
// CONSTRUCTOR
public function Gradient(&$img)
public function __construct(&$img)
{
$this->img = $img;
}
@ -48,286 +48,287 @@ class Gradient
// 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?
// ($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?
public 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));
$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_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));
$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_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_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_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) {
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];
$y = $yt+($i/$steps)*($yb-$yt)*$delta;
$this->img->Line($x, $yt, $xl, $y);
$x += $delta;
}
for ($j=0; $j< $steps; ++$j) {
$this->img->Line($x, $yb, $x, $yt);
$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) {
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];
$x = $xl+($i/$steps)*($xr-$xl)*$delta;
$this->img->Line($x, $yt, $xl, $y);
$y += $delta;
}
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;
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;
}
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;
}
break;
default:
JpGraphError::RaiseL(7001, $style);
//("Unknown gradient style (=$style).");
break;
}
}
// Fill a special case of a polygon with a flat bottom
@ -340,7 +341,7 @@ class Gradient
if (count($pts) == 0) {
return;
}
$maxy=$pts[1];
$miny=$pts[1];
$n = count($pts) ;
@ -350,7 +351,7 @@ class Gradient
$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) {
@ -362,14 +363,14 @@ class Gradient
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;
}
@ -406,22 +407,23 @@ class Gradient
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];
$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;
$colors[$i] = $colidx;
} else {
$r = floor($from_color[0] + $colnum*$rdelta);
$g = floor($from_color[1] + $colnum*$gdelta);

View file

@ -1,11 +1,11 @@
<?php
//=======================================================================
// File: JPGRAPH_ICONPLOT.PHP
// Description: PHP4 Graph Plotting library. Extension module.
// Created: 2004-02-18
// Ver: $Id: jpgraph_iconplot.php 781 2006-10-08 08:07:47Z ljp $
// File: JPGRAPH_ICONPLOT.PHP
// Description: Extension module to add icons to plots
// Created: 2004-02-18
// Ver: $Id: jpgraph_iconplot.php 1404 2009-06-28 15:25:41Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
@ -31,7 +31,7 @@ class IconPlot
private $iImgString='';
public function IconPlot($aFile="", $aX=0, $aY=0, $aScale=1.0, $aMix=100)
public function __construct($aFile="", $aX=0, $aY=0, $aScale=1.0, $aMix=100)
{
$this->iFile = $aFile;
$this->iX=$aX;
@ -95,7 +95,7 @@ class IconPlot
$this->iHorAnchor=$aXAnchor;
$this->iVertAnchor=$aYAnchor;
}
public function PreStrokeAdjust($aGraph)
{
// Nothing to do ...
@ -143,15 +143,15 @@ class IconPlot
return true;
}
public function Stroke($aImg, $axscale, $ayscale)
public function Stroke($aImg, $axscale=null, $ayscale=null)
{
$this->StrokeWithScale($aImg, $axscale, $ayscale);
}
public function StrokeWithScale($aImg, $axscale, $ayscale)
{
if ($this->iScalePosX === null ||
$this->iScalePosY === null) {
if ($this->iScalePosX === null || $this->iScalePosY === null ||
$axscale === null || $ayscale === null) {
$this->_Stroke($aImg);
} else {
$this->_Stroke(
@ -188,7 +188,7 @@ class IconPlot
$iconw = imagesx($gdimg);
$iconh = imagesy($gdimg);
if ($aReturnWidthHeight) {
return array(round($iconw*$this->iScale),round($iconh*$this->iScale));
}

View file

@ -1,11 +1,11 @@
<?php
//=======================================================================
// File: JPGRAPH_IMGTRANS.PHP
// Description: Extension for JpGraph to do some simple img transformations
// Created: 2003-09-06
// Ver: $Id: jpgraph_imgtrans.php 781 2006-10-08 08:07:47Z ljp $
// 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) Aditus Consulting. All rights reserved.
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
//------------------------------------------------------------------------
@ -16,7 +16,7 @@ class ImgTrans
{
private $gdImg=null;
public function ImgTrans($aGdImg)
public function __construct($aGdImg)
{
// Constructor
$this->gdImg = $aGdImg;
@ -30,7 +30,7 @@ class ImgTrans
{
// Parameter check
// 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.");
@ -46,7 +46,7 @@ class ImgTrans
} else {
$hh = $h;
}
$newgdh = imagecreatetruecolor($ww, $hh);
$crgb = new RGB($newgdh);
$fillColor = $crgb->Allocate($aFillColor);
@ -58,7 +58,7 @@ class ImgTrans
}
$mid = round($w * $aHorizonPos);
$last=$h;
for ($y=0; $y < $h; ++$y) {
$yp = $h-$y-1;
@ -127,7 +127,7 @@ class ImgTrans
} else {
$ww = $w;
}
$newgdh = imagecreatetruecolor($ww, $hh);
$crgb = new RGB($newgdh);
$fillColor = $crgb->Allocate($aFillColor);

View file

@ -1,53 +1,16 @@
<?php
//=======================================================================
// File: JPGRAPH_LED.PHP
// Description: Module to generate Dotted LED-like digits
// Created: 2006-11-26
// Ver: $Id: jpgraph_led.php 957 2007-12-01 14:00:29Z ljp $
// File: JPGRAPH_LED.PHP
// Description: Module to generate Dotted LED-like digits
// Created: 2006-11-26
// Ver: $Id: jpgraph_led.php 1674 2009-07-22 19:42:23Z ljp $
//
// Copyright 2006 (c) Aditus Consulting. All rights reserved.
// Copyright 2006 (c) Asial Corporation. All rights reserved.
//
// Changed: 2007-08-06 by Alexander Kurochkin (inspector@list.ru)
// Added: Decipher 4-bit mask.
// Added: Chars Latin > 'L', Cyrilic, other symbols and special symbols for
// simulation some latin and cyrilic chars.
// Added: New Color schemas.
// Deleted: Some minor bugs (StrokeNumber first parameter may be eq empty string,
// false or null - added check see line 294;
// change color schema check for easy maintenance: 291;
// change check on key exist in chars array: moved from StrokeNumber
// function to _GetLED: 251;
//
//========================================================================
// Samples for troubled chars: "Ô¡ Ø\r Ù\r Û| ÞÎ Ì\r >\n< W\r"
// Ô Ø Ù Û Þ Ì Æ W
//----------------------------------------------------------------------------
// Each character is encoded line by line with the "On"-LEDs corresponding to
// a '1' in the bianry mask of 4 bits.
//
// 4-bit mask:
//
// 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
//----------------------------------------------------------------------------
// Constants for color schema. See definition of iColorSchema below
// Constants for color schema
DEFINE('LEDC_RED', 0);
DEFINE('LEDC_GREEN', 1);
DEFINE('LEDC_BLUE', 2);
@ -64,7 +27,13 @@ DEFINE('LEDC_TEAL', 12);
DEFINE('LEDC_STEELBLUE', 13);
DEFINE('LEDC_NAVY', 14);
DEFINE('LEDC_INVERTGRAY', 15);
// ! It correlate with two-dimensional array $iColorSchema
// 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
@ -78,156 +47,171 @@ class DigitalLED74
private $iLED_Y=7;
// fg-up, fg-down, bg
private $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
);
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
*/
private $iLEDSpec = array(
0 => array(6,9,11,15,13,9,6),
//0 => array(6,9,9,9,9,9,6),
//0 => array(15,9,9,9,9,9,15),
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(0,6,9,9,9,9,6),
'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(9,9,9,9,6,6,6),
'Y' => array(10,10,10,10,4,4,4),
'Z' => array(15,1,2,6,4,8,15),
// russian cp1251
'À' => 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)
);
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)
);
private $iSuperSampling = 3;
private $iMarg = 1;
private $iRad = 4;
public function DigitalLED74($aRadius = 2, $aMargin= 0.6)
public function __construct($aRadius = 2, $aMargin= 0.6)
{
$this->iRad = $aRadius;
$this->iMarg = $aMargin;
}
public function SetSupersampling($aSuperSampling = 2)
{
$this->iSuperSampling = $aSuperSampling;
@ -243,7 +227,7 @@ class DigitalLED74
// Margin in between "Led" dots
$marg = $this->iMarg * $this->iSuperSampling;
$swidth = $width*$this->iSuperSampling;
$sheight = $height*$this->iSuperSampling;
@ -281,20 +265,27 @@ class DigitalLED74
return $img;
}
public function StrokeNumber($aValStr, $aColor = 0)
public function Stroke($aValStr, $aColor = 0, $aFileName = '')
{
$this->StrokeNumber($aValStr, $aColor, $aFileName);
}
public function StrokeNumber($aValStr, $aColor = 0, $aFileName = '')
{
if ($aColor < 0 || $aColor >= sizeof($this->iColorSchema)) {
$aColor = 0;
}
if (($n = strlen($aValStr)) == 0) {
if (($n = mb_strlen($aValStr, 'utf8')) == 0) {
$aValStr = ' ';
$n = 1;
}
for ($i = 0; $i < $n; ++$i) {
$d = substr($aValStr, $i, 1);
if ($d >= '0' && $d <= '9') {
$d = mb_substr($aValStr, $i, 1, 'utf8');
if (ctype_digit($d)) {
$d = (int)$d;
} else {
$d = strtoupper($d);
@ -311,7 +302,11 @@ class DigitalLED74
$number_img->Copy($digit_img[$i]->img, $i*$w, 0, 0, 0, $w, $h, $w, $h);
}
$number_img->Headers();
$number_img->Stream();
if ($aFileName != '') {
$number_img->Stream($aFileName);
} else {
$number_img->Headers();
$number_img->Stream();
}
}
}

View file

@ -0,0 +1,557 @@
<?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;
public $font_style=FS_NORMAL;
public $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;
private $mark_abs_vsize=_DEFAULT_LPM_SIZE;
private $xmargin=10;
private $ymargin=0;
private $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;
private $ypos=0.15;
private $xabspos=-1;
private $yabspos=-1;
private $halign="right";
private $valign="top";
private $font_color='black';
private $hide=false;
private $layout_n=1;
private $weight=1;
private $frameweight=1;
private $csimareas='';
private $reverse = false ;
private $bkg_gradtype=-1;
private $bkg_gradfrom='lightgray';
private $bkg_gradto='gray';
//---------------
// CONSTRUCTOR
public function __construct()
{
// Empty
}
//---------------
// PUBLIC METHODS
public function Hide($aHide=true)
{
$this->hide=$aHide;
}
public function SetHColMargin($aXMarg)
{
$this->xmargin = $aXMarg;
}
public function SetVColMargin($aSpacing)
{
$this->ylinespacing = $aSpacing ;
}
public function SetLeftMargin($aXMarg)
{
$this->xlmargin = $aXMarg;
}
// Synonym
public function SetLineSpacing($aSpacing)
{
$this->ylinespacing = $aSpacing ;
}
public 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;
}
public function SetMarkAbsSize($aSize)
{
$this->mark_abs_vsize = $aSize ;
$this->mark_abs_hsize = $aSize ;
}
public function SetMarkAbsVSize($aSize)
{
$this->mark_abs_vsize = $aSize ;
}
public function SetMarkAbsHSize($aSize)
{
$this->mark_abs_hsize = $aSize ;
}
public function SetLineWeight($aWeight)
{
$this->weight = $aWeight;
}
public function SetFrameWeight($aWeight)
{
$this->frameweight = $aWeight;
}
public function SetLayout($aDirection=LEGEND_VERT)
{
$this->layout_n = $aDirection==LEGEND_VERT ? 1 : 99 ;
}
public function SetColumns($aCols)
{
$this->layout_n = $aCols ;
}
public function SetReverse($f=true)
{
$this->reverse = $f ;
}
// Set color on frame around box
public function SetColor($aFontColor, $aColor='black')
{
$this->font_color=$aFontColor;
$this->color=$aColor;
}
public function SetFont($aFamily, $aStyle=FS_NORMAL, $aSize=10)
{
$this->font_family = $aFamily;
$this->font_style = $aStyle;
$this->font_size = $aSize;
}
public function SetPos($aX, $aY, $aHAlign='right', $aVAlign='top')
{
$this->Pos($aX, $aY, $aHAlign, $aVAlign);
}
public function SetAbsPos($aX, $aY, $aHAlign='right', $aVAlign='top')
{
$this->xabspos=$aX;
$this->yabspos=$aY;
$this->halign=$aHAlign;
$this->valign=$aVAlign;
}
public 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;
}
public function SetFillColor($aColor)
{
$this->fill_color=$aColor;
}
public function Clear()
{
$this->txtcol = array();
}
public function Add($aTxt, $aColor, $aPlotmark='', $aLinestyle=0, $csimtarget='', $csimalt='', $csimwintarget='')
{
$this->txtcol[]=array($aTxt,$aColor,$aPlotmark,$aLinestyle,$csimtarget,$csimalt,$csimwintarget);
}
public function GetCSIMAreas()
{
return $this->csimareas;
}
public function SetBackgroundGradient($aFrom='navy', $aTo='silver', $aGradType=2)
{
$this->bkg_gradtype=$aGradType;
$this->bkg_gradfrom = $aFrom;
$this->bkg_gradto = $aTo;
}
public function HasItems()
{
return (boolean)(count($this->txtcol));
}
public 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

View file

@ -1,13 +1,13 @@
<?php
/*=======================================================================
// File: JPGRAPH_LINE.PHP
// Description: Line plot extension for JpGraph
// Created: 2001-01-08
// Ver: $Id: jpgraph_line.php 981 2008-03-24 11:51:12Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
// File: JPGRAPH_LINE.PHP
// Description: Line plot extension for JpGraph
// Created: 2001-01-08
// Ver: $Id: jpgraph_line.php 1921 2009-12-11 11:46:39Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
*/
require_once('jpgraph_plotmark.inc.php');
@ -28,10 +28,11 @@ class LinePlot extends Plot
protected $fill_color='blue';
protected $step_style=false;
protected $center=false;
protected $line_style=1; // Default to solid
protected $line_style=1; // Default to solid
protected $filledAreas = array(); // array of arrays(with min,max,col,filled in them)
public $barcenter=false; // When we mix line and bar. Should we center the line in the bar.
protected $fillFromMin = false ;
protected $fillFromMin = false;
protected $fillFromMax = false;
protected $fillgrad=false;
protected $fillgrad_fromcolor='navy';
protected $fillgrad_tocolor='silver';
@ -40,20 +41,21 @@ class LinePlot extends Plot
//---------------
// CONSTRUCTOR
public function LinePlot($datay, $datax=false)
public function __construct($datay, $datax=false)
{
$this->Plot($datay, $datax);
parent::__construct($datay, $datax);
$this->mark = new PlotMark() ;
$this->color = ColorFactory::getColor();
$this->fill_color = $this->color;
}
//---------------
// PUBLIC METHODS
// Set style, filled or open
public function SetFilled($aFlag=true)
public function SetFilled($aFlg=true)
{
JpGraphError::RaiseL(10001);//('LinePlot::SetFilled() is deprecated. Use SetFillColor()');
$this->filled = $aFlg;
}
public function SetBarCenter($aFlag=true)
{
$this->barcenter=$aFlag;
@ -63,24 +65,30 @@ class LinePlot extends Plot
{
$this->line_style=$aStyle;
}
public function SetStepStyle($aFlag=true)
{
$this->step_style = $aFlag;
}
public function SetColor($aColor)
{
parent::SetColor($aColor);
}
public function SetFillFromYMin($f=true)
{
$this->fillFromMin = $f ;
}
public function SetFillFromYMax($f=true)
{
$this->fillFromMax = $f ;
}
public function SetFillColor($aColor, $aFilled=true)
{
//$this->color = $aColor;
$this->fill_color=$aColor;
$this->filled=$aFilled;
}
@ -93,7 +101,7 @@ class LinePlot extends Plot
$this->filled = $aFilled;
$this->fillgrad = true;
}
public function Legend($graph)
{
if ($this->legend!="") {
@ -143,17 +151,16 @@ class LinePlot extends Plot
}
$this->filledAreas[] = array($aMin,$aMax,$aColor,$aFilled,$aBorder);
}
// Gets called before any axis are stroked
public function PreStrokeAdjust($graph)
{
// If another plot type have already adjusted the
// If another plot type have already adjusted the
// offset we don't touch it.
// (We check for empty in case the scale is a log scale
// and hence doesn't contain any xlabel_offset)
if (empty($graph->xaxis->scale->ticks->xlabel_offset) ||
$graph->xaxis->scale->ticks->xlabel_offset == 0) {
if (empty($graph->xaxis->scale->ticks->xlabel_offset) || $graph->xaxis->scale->ticks->xlabel_offset == 0) {
if ($this->center) {
++$this->numpoints;
$a=0.5;
@ -167,7 +174,7 @@ class LinePlot extends Plot
//$graph->xaxis->scale->ticks->SupressMinorTickMarks();
}
}
public function SetFastStroke($aFlg=true)
{
$this->iFastStroke = $aFlg;
@ -210,7 +217,7 @@ class LinePlot extends Plot
$img->Polygon($cord, false, true);
}
public function Stroke($img, $xscale, $yscale)
{
$idx=0;
@ -218,9 +225,8 @@ class LinePlot extends Plot
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 {
} else {
$exist_x = true;
}
} else {
@ -260,18 +266,22 @@ class LinePlot extends Plot
$yscale->Translate($this->coords[0][$startpoint])
);
if ($this->filled) {
$min = $yscale->GetMinVal();
if ($min > 0 || $this->fillFromMin) {
$fillmin = $yscale->scale_abs[0];
}//Translate($min);
else {
$fillmin = $yscale->Translate(0);
}
if ($this->fillFromMax) {
//$max = $yscale->GetMaxVal();
$cord[$idx++] = $xscale->Translate($xs);
$cord[$idx++] = $yscale->scale_abs[1];
} else {
$min = $yscale->GetMinVal();
if ($min > 0 || $this->fillFromMin) {
$fillmin = $yscale->scale_abs[0];//Translate($min);
} else {
$fillmin = $yscale->Translate(0);
}
$cord[$idx++] = $xscale->Translate($xs);
$cord[$idx++] = $fillmin;
$cord[$idx++] = $xscale->Translate($xs);
$cord[$idx++] = $fillmin;
}
}
$xt = $xscale->Translate($xs);
$yt = $yscale->Translate($this->coords[0][$startpoint]);
@ -298,7 +308,7 @@ class LinePlot extends Plot
}
$xt = $xscale->Translate($x);
$yt = $yscale->Translate($this->coords[0][$pnts]);
$y=$this->coords[0][$pnts];
if ($this->step_style) {
// To handle null values within step style we need to record the
@ -373,10 +383,14 @@ class LinePlot extends Plot
if ($this->filled) {
$cord[$idx++] = $xt;
if ($min > 0 || $this->fillFromMin) {
$cord[$idx++] = $yscale->Translate($min);
if ($this->fillFromMax) {
$cord[$idx++] = $yscale->scale_abs[1];
} else {
$cord[$idx++] = $yscale->Translate(0);
if ($min > 0 || $this->fillFromMin) {
$cord[$idx++] = $yscale->Translate($min);
} else {
$cord[$idx++] = $yscale->Translate(0);
}
}
if ($this->fillgrad) {
$img->SetLineWeight(1);
@ -388,9 +402,13 @@ class LinePlot extends Plot
$img->SetColor($this->fill_color);
$img->FilledPolygon($cord);
}
if ($this->line_weight > 0) {
if ($this->weight > 0) {
$img->SetLineWeight($this->weight);
$img->SetColor($this->color);
$img->Polygon($cord);
// Remove first and last coordinate before drawing the line
// sine we otherwise get the vertical start and end lines which
// doesn't look appropriate
$img->Polygon(array_slice($cord, 2, count($cord)-4));
}
}
@ -405,28 +423,26 @@ class LinePlot extends Plot
$areaCoords[] = $minY;
$areaCoords =
array_merge(
$areaCoords,
array_slice(
array_merge(
$areaCoords,
array_slice(
$cord,
$this->filledAreas[$i][0] * $factor,
($this->filledAreas[$i][1] - $this->filledAreas[$i][0] + ($this->step_style ? 0 : 1)) * $factor
)
);
);
$areaCoords[] = $areaCoords[sizeof($areaCoords)-2]; // last x
$areaCoords[] = $minY; // last y
if ($this->filledAreas[$i][3]) {
$img->SetColor($this->filledAreas[$i][2]);
$img->FilledPolygon($areaCoords);
$img->SetColor($this->color);
}
$areaCoords[] = $minY; // last y
if ($this->filledAreas[$i][3]) {
$img->SetColor($this->filledAreas[$i][2]);
$img->FilledPolygon($areaCoords);
$img->SetColor($this->color);
}
// Check if we should draw the frame.
// If not we still re-draw the line since it might have been
// partially overwritten by the filled area and it doesn't look
// very good.
// TODO: The behaviour is undefined if the line does not have
// any line at the position of the area.
if ($this->filledAreas[$i][4]) {
$img->Polygon($areaCoords);
} else {
@ -484,7 +500,7 @@ class AccLinePlot extends Plot
private $iStartEndZero=true;
//---------------
// CONSTRUCTOR
public function AccLinePlot($plots)
public function __construct($plots)
{
$this->plots = $plots;
$this->nbrplots = count($plots);
@ -510,7 +526,7 @@ class AccLinePlot extends Plot
$p->DoLegend($graph);
}
}
public function Max()
{
list($xmax) = $this->plots[0]->Max();
@ -570,11 +586,11 @@ class AccLinePlot extends Plot
public function PreStrokeAdjust($graph)
{
// If another plot type have already adjusted the
// If another plot type have already adjusted the
// offset we don't touch it.
// (We check for empty in case the scale is a log scale
// and hence doesn't contain any xlabel_offset)
if (empty($graph->xaxis->scale->ticks->xlabel_offset) ||
$graph->xaxis->scale->ticks->xlabel_offset == 0) {
if ($this->center) {
@ -603,7 +619,7 @@ class AccLinePlot extends Plot
{
$n=count($aData);
$i=0;
// If first point is undefined we will set it to the same as the first
// valid data
if ($aData[$i]==='-') {
@ -661,8 +677,6 @@ class AccLinePlot extends Plot
return true;
}
// To avoid duplicate of line drawing code here we just
// change the y-values for each plot and then restore it
// after we have made the stroke. We must do this copy since

View file

@ -1,13 +1,13 @@
<?php
/*=======================================================================
// File: JPGRAPH_LOG.PHP
// Description: Log scale plot extension for JpGraph
// Created: 2001-01-08
// Ver: $Id: jpgraph_log.php 957 2007-12-01 14:00:29Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
// 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);
@ -22,9 +22,9 @@ class LogScale extends LinearScale
// CONSTRUCTOR
// Log scale is specified using the log of min and max
public function LogScale($min, $max, $type="y")
public function __construct($min, $max, $type="y")
{
$this->LinearScale($min, $max, $type);
parent::__construct($min, $max, $type);
$this->ticks = new LogTicks();
$this->name = 'log';
}
@ -38,8 +38,8 @@ class LogScale extends LinearScale
if (!is_numeric($a)) {
if ($a != '' && $a != '-' && $a != 'x') {
JpGraphError::RaiseL(11001);
// ('Your data contains non-numeric values.');
}
//('Your data contains non-numeric values.');
return 1;
}
if ($a < 0) {
@ -61,8 +61,8 @@ class LogScale extends LinearScale
if (!is_numeric($a)) {
if ($a != '' && $a != '-' && $a != 'x') {
JpGraphError::RaiseL(11001);
//('Your data contains non-numeric values.');
}
//('Your data contains non-numeric values.');
return 1;
}
if ($a==0) {
@ -71,7 +71,7 @@ class LogScale extends LinearScale
$a=log10($a);
return round(($a*1.0 - $this->scale[0]) * $this->scale_factor);
}
// Use bcpow() for increased precision
public function GetMinVal()
{
@ -81,7 +81,7 @@ class LogScale extends LinearScale
return round(pow(10, $this->scale[0]), 14);
}
}
public function GetMaxVal()
{
if (function_exists("bcpow")) {
@ -90,7 +90,7 @@ class LogScale extends LinearScale
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
@ -101,7 +101,7 @@ class LogScale extends LinearScale
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.');
@ -127,7 +127,7 @@ class LogScale extends LinearScale
$this->Update($img, $smin, $smax);
}
//---------------
// PRIVATE METHODS
// PRIVATE METHODS
} // Class
//===================================================
@ -140,7 +140,7 @@ class LogTicks extends Ticks
private $ticklabels_pos = array();
//---------------
// CONSTRUCTOR
public function LogTicks()
public function __construct()
{
}
//---------------
@ -154,7 +154,7 @@ class LogTicks extends Ticks
{
$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() )
@ -184,16 +184,16 @@ class LogTicks extends Ticks
$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);
@ -227,7 +227,7 @@ class LogTicks extends Ticks
$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);

View file

@ -0,0 +1,108 @@
<?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
*/
public 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
*/
public 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;
}
}

View file

@ -1,13 +1,13 @@
<?php
/*=======================================================================
// File: JPGRAPH_MGRAPH.PHP
// Description: Class to handle multiple graphs in the same image
// Created: 2006-01-15
// Ver: $Id: jpgraph_mgraph.php 781 2006-10-08 08:07:47Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
// 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
@ -15,21 +15,28 @@
//=============================================================================
class MGraph
{
public $title = null;
public $subtitle = null;
public $subsubtitle = null;
protected $img=null;
protected $iCnt=0;
protected $iGraphs = array(); // image_handle, x, y, fx, fy, sizex, sizey
protected $iFillColor='white';
protected $iCurrentColor=0;
protected $lm=0;
protected $rm=0;
protected $tm=0;
protected $bm=0;
protected $lm=4;
protected $rm=4;
protected $tm=4;
protected $bm=4;
protected $iDoFrame = false;
protected $iFrameColor = 'black';
protected $iFrameWeight = 1;
protected $iLineWeight = 1;
protected $expired=false;
protected $img_format='png';
protected $cache=null;
protected $cache_name = '';
protected $inline=true;
protected $image_format='png';
protected $image_quality=75;
protected $iWidth=null;
protected $iHeight=null;
@ -39,12 +46,50 @@ class MGraph
protected $background_image_mix=100;
protected $background_image_y=null;
protected $background_image_x=null;
private $doshadow=false;
private $shadow_width=4;
private $shadow_color='gray@0.5';
public $footer;
// Create a new instane of the combined graph
public function MGraph($aWidth=null, $aHeight=null)
public 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
@ -75,10 +120,6 @@ class MGraph
$aCenter=true;
$aX=null;
if ($GLOBALS['gd2'] && !USE_TRUECOLOR) {
JpGraphError::RaiseL(12001);
//("You are using GD 2.x and are trying to use a background images on a non truecolor image. To use background images with GD 2.x you <b>must</b> enable truecolor by setting the USE_TRUECOLOR constant to TRUE. Due to a bug in GD 2.0.1 using any truetype fonts with truecolor images will result in very poor quality fonts.");
}
if (is_numeric($aCenter_aX)) {
$aX=$aCenter_aX;
}
@ -89,7 +130,7 @@ class MGraph
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') {
@ -106,62 +147,27 @@ class MGraph
$this->background_image_y = $aY;
}
// Private helper function for backgound image
public function _loadBkgImage($aFile='')
{
if ($aFile == '') {
$aFile = $this->background_image;
}
// Remove case sensitivity and setup appropriate function to create image
// Get file extension. This should be the LAST '.' separated part of the filename
$e = explode('.', $aFile);
$ext = strtolower($e[count($e)-1]);
if ($ext == "jpeg") {
$ext = "jpg";
}
if (trim($ext) == '') {
$ext = 'png';
} // Assume PNG if no extension specified
$supported = imagetypes();
if (($ext == 'jpg' && !($supported & IMG_JPG)) ||
($ext == 'gif' && !($supported & IMG_GIF)) ||
($ext == 'png' && !($supported & IMG_PNG))) {
JpGraphError::RaiseL(12004, $aFile);//('The image format of your background image ('.$aFile.') is not supported in your system configuration. ');
}
if ($ext == "jpg" || $ext == "jpeg") {
$f = "imagecreatefromjpeg";
$ext = "jpg";
} else {
$f = "imagecreatefrom".$ext;
}
$img = @$f($aFile);
if (!$img) {
JpGraphError::RaiseL(12005, $aFile);
//(" Can't read background image: '".$aFile."'");
}
return $img;
}
public function _strokeBackgroundImage()
{
if ($this->background_image == '') {
return;
}
$bkgimg = $this->_loadBkgImage();
$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
@ -176,87 +182,14 @@ class MGraph
$x = $this->background_image_x;
$y = $this->background_image_y;
}
$this->_imageCp($bkgimg, $x, $y, 0, 0, $bw, $bh, $this->background_image_mix);
}
public function _imageCp($aSrcImg, $x, $y, $fx, $fy, $w, $h, $mix=100)
{
imagecopymerge($this->img, $aSrcImg, $x, $y, $fx, $fy, $w, $h, $mix);
}
public function _imageCreate($aWidth, $aHeight)
{
if ($aWidth <= 1 || $aHeight <= 1) {
JpGraphError::RaiseL(12006, $aWidth, $aHeight);
//("Illegal sizes specified for width or height when creating an image, (width=$aWidth, height=$aHeight)");
}
if (@$GLOBALS['gd2']==true && USE_TRUECOLOR) {
$this->img = @imagecreatetruecolor($aWidth, $aHeight);
if ($this->img < 1) {
JpGraphError::RaiseL(12011);
// die("<b>JpGraph Error:</b> Can't create truecolor image. Check that you really have GD2 library installed.");
}
ImageAlphaBlending($this->img, true);
} else {
$this->img = @imagecreate($aWidth, $aHeight);
if ($this->img < 1) {
JpGraphError::RaiseL(12012);
// die("<b>JpGraph Error:</b> Can't create image. Check that you really have the GD library installed.");
}
}
}
public function _polygon($p, $closed=false)
{
if ($this->iLineWeight==0) {
return;
}
$n=count($p);
$oldx = $p[0];
$oldy = $p[1];
for ($i=2; $i < $n; $i+=2) {
imageline($this->img, $oldx, $oldy, $p[$i], $p[$i+1], $this->iCurrentColor);
$oldx = $p[$i];
$oldy = $p[$i+1];
}
if ($closed) {
imageline($this->img, $p[$n*2-2], $p[$n*2-1], $p[0], $p[1], $this->iCurrentColor);
}
}
public function _filledPolygon($pts)
{
$n=count($pts);
for ($i=0; $i < $n; ++$i) {
$pts[$i] = round($pts[$i]);
}
imagefilledpolygon($this->img, $pts, count($pts)/2, $this->iCurrentColor);
}
public function _rectangle($xl, $yu, $xr, $yl)
{
for ($i=0; $i < $this->iLineWeight; ++$i) {
$this->_polygon(array($xl+$i,$yu+$i,$xr-$i,$yu+$i,
$xr-$i,$yl-$i,$xl+$i,$yl-$i,
$xl+$i,$yu+$i));
}
}
public function _filledRectangle($xl, $yu, $xr, $yl)
{
$this->_filledPolygon(array($xl,$yu,$xr,$yu,$xr,$yl,$xl,$yl));
}
public function _setColor($aColor)
{
$this->iCurrentColor = $this->iRGB->Allocate($aColor);
imagecopymerge($this->img, $bkgimg, $x, $y, 0, 0, $bw, $bh, $this->background_image_mix);
}
public 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);
}
public 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);
@ -291,90 +224,72 @@ class MGraph
$this->expired = $aFlg;
}
// Generate image header
public function Headers()
{
// In case we are running from the command line with the client version of
// PHP we can't send any headers.
$sapi = php_sapi_name();
if ($sapi == 'cli') {
return;
}
if (headers_sent()) {
echo "<table border=1><tr><td><font color=darkred size=4><b>JpGraph Error:</b>
HTTP headers have already been sent.</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>";
die();
}
if ($this->expired) {
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
}
header("Content-type: image/$this->img_format");
}
public function SetImgFormat($aFormat, $aQuality=75)
{
$this->image_format = $aFormat;
$this->image_quality = $aQuality;
$aFormat = strtolower($aFormat);
$tst = true;
$supported = imagetypes();
if ($aFormat=="auto") {
if ($supported & IMG_PNG) {
$this->img_format="png";
} elseif ($supported & IMG_JPG) {
$this->img_format="jpeg";
} elseif ($supported & IMG_GIF) {
$this->img_format="gif";
} else {
JpGraphError::RaiseL(12008);
}
//(" Your PHP (and GD-lib) installation does not appear to support any known graphic formats.".
return true;
} else {
if ($aFormat=="jpeg" || $aFormat=="png" || $aFormat=="gif") {
if ($aFormat=="jpeg" && !($supported & IMG_JPG)) {
$tst=false;
} elseif ($aFormat=="png" && !($supported & IMG_PNG)) {
$tst=false;
} elseif ($aFormat=="gif" && !($supported & IMG_GIF)) {
$tst=false;
} else {
$this->img_format=$aFormat;
return true;
}
} else {
$tst=false;
}
if (!$tst) {
JpGraphError::RaiseL(12009, $aFormat);
}
//(" Your PHP installation does not support the chosen graphic format: $aFormat");
}
}
// Stream image to browser or to file
public function Stream($aFile="")
// Set the shadow around the whole image
public function SetShadow($aShowShadow=true, $aShadowWidth=4, $aShadowColor='gray@0.3')
{
$func="image".$this->img_format;
if ($this->img_format=="jpeg" && $this->image_quality != null) {
$res = @$func($this->img, $aFile, $this->image_quality);
} else {
if ($aFile != "") {
$res = @$func($this->img, $aFile);
} else {
$res = @$func($this->img);
$this->doshadow = $aShowShadow;
$this->shadow_color = $aShadowColor;
$this->shadow_width = $aShadowWidth;
$this->footer->iBottomMargin += $aShadowWidth;
$this->footer->iRightMargin += $aShadowWidth;
}
public 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);
}
if (!$res) {
JpGraphError::RaiseL(12010, $aFile);
}
//("Can't create or stream image to file $aFile Check that PHP has enough permission to write a file to the current directory.");
}
public function Stroke($aFileName='')
@ -392,30 +307,44 @@ HTTP headers have already been sent.</font></td></tr><tr><td><b>Explanation:</b>
$h += $this->tm+$this->bm;
// User specified width,height overrides
if ($this->iWidth !== null) {
if ($this->iWidth !== null && $this->iWidth !== 0) {
$w = $this->iWidth;
}
if ($this->iHeight!== null) {
if ($this->iHeight!== null && $this->iHeight !== 0) {
$h = $this->iHeight;
}
$this->_imageCreate($w, $h);
$this->iRGB = new RGB($this->img);
if ($this->doshadow) {
$w += $this->shadow_width;
$h += $this->shadow_width;
}
$this->_setcolor($this->iFillColor);
$this->_filledRectangle(0, 0, $w-1, $h-1);
$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->_setColor($this->iFrameColor);
$this->iLineWeight=$this->iFrameWeight;
$this->_rectangle(0, 0, $w-1, $h-1);
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) {
$this->_imageCp(
$image->CopyMerge(
$this->iGraphs[$i][0],
$this->iGraphs[$i][1]+$this->lm,
$this->iGraphs[$i][2]+$this->tm,
@ -423,16 +352,24 @@ HTTP headers have already been sent.</font></td></tr><tr><td><b>Explanation:</b>
$this->iGraphs[$i][4],
$this->iGraphs[$i][5],
$this->iGraphs[$i][6],
$this->iGraphs[$i][7]
-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 $this->img;
return $image->img;
} else {
$this->Headers();
$this->Stream($aFileName);
//Finally stream the generated picture
$this->cache = new ImgStreamCache();
$this->cache->PutAndStream($image, $this->cache_name, $this->inline, $aFileName);
}
}
}
// EOF

View file

@ -1,21 +1,21 @@
<?php
/*=======================================================================
// File: JPGRAPH_PIE.PHP
// Description: Pie plot extension for JpGraph
// Created: 2001-02-14
// Ver: $Id: jpgraph_pie.php 1006 2008-06-09 22:32:05Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
// File: JPGRAPH_PIE.PHP
// Description: Pie plot extension for JpGraph
// Created: 2001-02-14
// Ver: $Id: jpgraph_pie.php 1926 2010-01-11 16:33:07Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
*/
// Defines for PiePlot::SetLabelType()
DEFINE("PIE_VALUE_ABS", 1);
DEFINE("PIE_VALUE_PER", 0);
DEFINE("PIE_VALUE_PERCENTAGE", 0);
DEFINE("PIE_VALUE_ADJPERCENTAGE", 2);
DEFINE("PIE_VALUE_ADJPER", 2);
define("PIE_VALUE_ABS", 1);
define("PIE_VALUE_PER", 0);
define("PIE_VALUE_PERCENTAGE", 0);
define("PIE_VALUE_ADJPERCENTAGE", 2);
define("PIE_VALUE_ADJPER", 2);
//===================================================
// CLASS PiePlot
@ -25,6 +25,9 @@ class PiePlot
{
public $posx=0.5;
public $posy=0.5;
public $is_using_plot_theme = false;
public $theme="earth";
protected $use_plot_theme_colors = false;
protected $radius=0.3;
protected $explode_radius=array();
protected $explode_all=false;
@ -33,8 +36,8 @@ class PiePlot
protected $legends=null;
protected $csimtargets=null;
protected $csimwintargets=null; // Array of targets for CSIM
protected $csimareas=''; // Generated CSIM text
protected $csimalts=null; // ALT tags for corresponding target
protected $csimareas=''; // Generated CSIM text
protected $csimalts=null; // ALT tags for corresponding target
protected $data=null;
public $title;
protected $startangle=0;
@ -43,11 +46,10 @@ class PiePlot
protected $legend_margin=6;
protected $show_labels=true;
protected $themearr = array(
"earth" => array(136,34,40,45,46,62,63,134,74,10,120,136,141,168,180,77,209,218,346,395,89,430),
"pastel" => array(27,415,128,59,66,79,105,110,42,147,152,230,236,240,331,337,405,38),
"water" => array(8,370,24,40,335,56,213,237,268,14,326,387,10,388),
"sand" => array(27,168,34,170,19,50,65,72,131,209,46,393));
protected $theme="earth";
"earth" => array(136,34,40,45,46,62,63,134,74,10,120,136,141,168,180,77,209,218,346,395,89,430),
"pastel" => array(27,415,128,59,66,79,105,110,42,147,152,230,236,240,331,337,405,38),
"water" => array(8,370,24,40,335,56,213,237,268,14,326,387,10,388),
"sand" => array(27,168,34,170,19,50,65,72,131,209,46,393));
protected $setslicecolors=array();
protected $labeltype=0; // Default to percentage
protected $pie_border=true;
@ -67,14 +69,14 @@ class PiePlot
protected $iGuideVFactor=1.4;
protected $iGuideLineRFactor=0.8;
protected $la = array(); // Holds the exact angle for each label
//---------------
// CONSTRUCTOR
public function PiePlot($data)
public function __construct($data)
{
$this->data = array_reverse($data);
$this->title = new Text("");
$this->title->SetFont(FF_FONT1, FS_BOLD);
$this->title->SetFont(FF_DEFAULT, FS_BOLD);
$this->value = new DisplayValue();
$this->value->Show();
$this->value->SetFormat('%.1f%%');
@ -108,12 +110,12 @@ class PiePlot
{
$this->color = $aColor;
}
public function SetSliceColors($aColors)
{
$this->setslicecolors = $aColors;
}
public function SetShadow($aColor='darkgray', $aDropWidth=4)
{
$this->ishadowcolor = $aColor;
@ -130,7 +132,7 @@ class PiePlot
$this->csimalts=array_reverse($aAlts);
}
}
public function GetCSIMareas()
{
return $this->csimareas;
@ -165,7 +167,7 @@ class PiePlot
$xp = floor(($radius*cos($ea))+$xc);
$yp = floor($yc-$radius*sin($ea));
$coords.= ", $xp, $yp";
//add coordinates every 0.2 radians
$a=$ea+0.2;
@ -188,7 +190,7 @@ class PiePlot
$coords.= ", $xp, $yp";
$a += 0.2;
}
//Add the last point on the arc
$xp = floor($radius*cos($sa)+$xc);
$yp = floor($yc-$radius*sin($sa));
@ -207,16 +209,20 @@ class PiePlot
}
}
public function SetTheme($aTheme)
{
// JpGraphError::RaiseL(15012,$aTheme);
// return;
if (in_array($aTheme, array_keys($this->themearr))) {
$this->theme = $aTheme;
$this->is_using_plot_theme = true;
} else {
JpGraphError::RaiseL(15001, $aTheme);
}//("PiePLot::SetTheme() Unknown theme: $aTheme");
JpGraphError::RaiseL(15001, $aTheme);//("PiePLot::SetTheme() Unknown theme: $aTheme");
}
}
public function ExplodeSlice($e, $radius=20)
{
if (! is_integer($e)) {
@ -245,15 +251,14 @@ class PiePlot
if ($aStart < 0 || $aStart > 360) {
JpGraphError::RaiseL(15004);//('Slice start angle must be between 0 and 360 degrees.');
}
$this->startangle = 360-$aStart;
$this->startangle *= M_PI/180;
if ($aStart == 0) {
$this->startangle = 0;
} else {
$this->startangle = 360-$aStart;
$this->startangle *= M_PI/180;
}
}
public function SetFont($family, $style=FS_NORMAL, $size=10)
{
JpGraphError::RaiseL(15005);//('PiePlot::SetFont() is deprecated. Use PiePlot->value->SetFont() instead.');
}
// Size in percentage
public function SetSize($aSize)
{
@ -264,13 +269,7 @@ class PiePlot
}
//("PiePlot::SetSize() Radius for pie must either be specified as a fraction [0, 0.5] of the size of the image or as an absolute size in pixels in the range [10, 1000]");
}
public function SetFontColor($aColor)
{
JpGraphError::RaiseL(15007);
//('PiePlot::SetFontColor() is deprecated. Use PiePlot->value->SetColor() instead.');
}
// Set label arrays
public function SetLegends($aLegend)
{
@ -288,15 +287,15 @@ class PiePlot
{
$this->ilabelposadj=$aLblPosAdj;
}
// Should we display actual value or percentage?
public function SetLabelType($t)
public function SetLabelType($aType)
{
if ($t < 0 || $t > 2) {
JpGraphError::RaiseL(15008, $t);
if ($aType < 0 || $aType > 2) {
JpGraphError::RaiseL(15008, $aType);
}
//("PiePlot::SetLabelType() Type for pie plots must be 0 or 1 (not $t).");
$this->labeltype=$t;
$this->labeltype = $aType;
}
// Deprecated.
@ -311,7 +310,7 @@ class PiePlot
$this->pie_border = $exterior;
$this->pie_interior_border = $interior;
}
// Setup the legends
public function Legend($graph)
{
@ -332,7 +331,7 @@ class PiePlot
$this->setslicecolors = array_reverse($this->setslicecolors);
}
}
$sum=0;
for ($i=0; $i < $n; ++$i) {
$sum += $this->data[$i];
@ -345,14 +344,16 @@ class PiePlot
// Make sure we don't plot more values than data points
// (in case the user added more legends than data points)
$n = min(count($this->legends), count($this->data));
$legendsCount = is_array($this->legends) ? count($this->legends) : 0;
$n = min($legendsCount, count($this->data));
if ($this->legends != "") {
$this->legends = array_reverse(array_slice($this->legends, 0, $n));
}
for ($i=$n-1; $i >= 0; --$i) {
$l = $this->legends[$i];
// Replace possible format with actual values
if (count($this->csimalts) > $i) {
$count = is_array($this->csimalts) ? count($this->csimalts) : 0;
if ($count > $i) {
$fmt = $this->csimalts[$i];
} else {
$fmt = "%d"; // Deafult Alt if no other has been specified
@ -375,13 +376,15 @@ class PiePlot
}
if ($this->setslicecolors==null) {
$graph->legend->Add($l, $colors[$ta[$i%$numcolors]], "", 0, $this->csimtargets[$i], $alt, $wintarg);
$csimtarget = isset($this->csimtargets[$i]) ? $this->csimtargets[$i] : null;
$graph->legend->Add($l, $colors[$ta[$i%$numcolors]], "", 0, $csimtarget, $alt, $wintarg);
} else {
$graph->legend->Add($l, $this->setslicecolors[$i%$numcolors], "", 0, $this->csimtargets[$i], $alt, $wintarg);
$csimtarget = isset($this->csimtargets[$i]) ? $this->csimtargets[$i] : null;
$graph->legend->Add($l, $this->setslicecolors[$i%$numcolors], "", 0, $csimtarget, $alt, $wintarg);
}
}
}
// Adjust the rounded percetage value so that the sum of
// of the pie slices are always 100%
// Using the Hare/Niemeyer method
@ -395,7 +398,7 @@ class PiePlot
$mul=10000;
}
}
$tmp = array();
$result = array();
$quote_sum=0;
@ -441,7 +444,7 @@ class PiePlot
// aaoption == 1 just the body
// aaoption == 2 just the values
// Explode scaling. If anti anti alias we scale the image
// Explode scaling. If anti alias we scale the image
// twice and we also need to scale the exploding distance
$expscale = $aaoption === 1 ? 2 : 1;
@ -450,11 +453,15 @@ class PiePlot
$this->adjusted_data = $this->AdjPercentage($this->data);
}
if ($this->use_plot_theme_colors) {
$this->setslicecolors = null;
}
$colors = array_keys($img->rgb->rgb_table);
sort($colors);
$ta=$this->themearr[$this->theme];
$n = count($this->data);
if ($this->setslicecolors==null) {
$numcolors=count($ta);
} else {
@ -476,12 +483,12 @@ class PiePlot
for ($i=0; $i < $n; ++$i) {
$sum += $this->data[$i];
}
// Bail out with error if the sum is 0
if ($sum==0) {
JpGraphError::RaiseL(15009);
}//("Sum of all data is 0 for Pie.");
JpGraphError::RaiseL(15009);//("Sum of all data is 0 for Pie.");
}
// Set up the pie-circle
if ($this->radius <= 1) {
$radius = floor($this->radius*min($img->width, $img->height));
@ -494,13 +501,13 @@ class PiePlot
} else {
$xc = $this->posx ;
}
if ($this->posy <= 1 && $this->posy > 0) {
$yc = round($this->posy*$img->height);
} else {
$yc = $this->posy ;
}
$n = count($this->data);
if ($this->explode_all) {
@ -532,7 +539,7 @@ class PiePlot
$xcm = $xc + $this->explode_radius[$j]*cos($la)*$expscale;
$ycm = $yc - $this->explode_radius[$j]*sin($la)*$expscale;
$xcm += $this->ishadowdrop*$expscale;
$ycm += $this->ishadowdrop*$expscale;
@ -550,8 +557,7 @@ class PiePlot
$radius-1,
$angle1*180/M_PI,
$angle2*180/M_PI,
$slicecolor,
$arccolor
$this->ishadowcolor
);
}
}
@ -570,7 +576,7 @@ class PiePlot
// There are n slices in total
for ($i=0; $sum>0 && $i < $n; ++$i) {
// $j is the actual index used for the slice
// $j is the actual index used for the slice
$j = $n-$i-1;
// Make sure we havea valid distance to explode the slice
@ -593,19 +599,18 @@ class PiePlot
// We avoid some trouble by not allowing end angle to be 0, in that case
// we translate to 360
// la is used to hold the label angle, which is centered on the slice
if ($angle2 < 0.0001 && $angle1 > 0.0001) {
$this->la[$i] = 2*M_PI - (abs(2*M_PI-$angle1)/2.0+$angle1);
} elseif ($angle1 > $angle2) {
// The case where the slice crosses the 3 a'clock line
// Remember that the slices are counted clockwise and
// labels are counted counter clockwise so we need to revert with 2 PI
$this->la[$i] = 2*M_PI-$this->NormAngle($angle1 + ((2*M_PI - $angle1)+$angle2)/2);
} else {
$this->la[$i] = 2*M_PI - (abs($angle2-$angle1)/2.0+$angle1);
}
$_sa = round($angle1*180/M_PI);
$_ea = round($angle2*180/M_PI);
$_la = round($this->la[$i]*180/M_PI);
//echo "ang1=$_sa , ang2=$_ea - la=$_la<br>";
// Too avoid rounding problems we skip the slice if it is too small
if ($d < 0.00001) {
continue;
@ -618,7 +623,13 @@ class PiePlot
} else {
$slicecolor=$this->setslicecolors[$i%$numcolors];
}
// $_sa = round($angle1*180/M_PI);
// $_ea = round($angle2*180/M_PI);
// $_la = round($this->la[$i]*180/M_PI);
// echo "Slice#$i: ang1=$_sa , ang2=$_ea, la=$_la, color=$slicecolor<br>";
// If we have enabled antialias then we don't draw any border so
// make the bordedr color the same as the slice color
if ($this->pie_interior_border && $aaoption===0) {
@ -641,12 +652,11 @@ class PiePlot
$_ea = round($angle2*180/M_PI);
$_la = round($this->la[$i]*180/M_PI);
//echo "[$i] sa=$_sa, ea=$_ea, la[$i]=$_la, (color=$slicecolor)<br>";
// The CakeSlice method draws a full circle in case of start angle = end angle
// for pie slices we don't want this behaviour unless we only have one
// slice in the pie in case it is the wanted behaviour
if (abs($_ea-$_sa) > 0.1 || $n==1) {
// for pie slices we want this in case the slice have a value larger than 99% of the
// total sum
if (abs($_ea-$_sa) >= 1 || $d == $sum) {
$img->CakeSlice($xcm, $ycm, $radius-1, $radius-1, $_sa, $_ea, $slicecolor, $arccolor);
}
}
@ -731,16 +741,16 @@ class PiePlot
$n = count($this->labels);
//-----------------------------------------------------------------------
// Step 1 of the algorithm is to construct a number of clusters
// a cluster is defined as all slices within the same quadrant (almost)
// that has an angular distance less than the treshold
//-----------------------------------------------------------------------
$tresh_hold=25 * M_PI/180; // 25 degrees difference to be in a cluster
$incluster=false; // flag if we are currently in a cluster or not
$clusters = array(); // array of clusters
$cidx=-1; // running cluster index
// Step 1 of the algorithm is to construct a number of clusters
// a cluster is defined as all slices within the same quadrant (almost)
// that has an angular distance less than the treshold
//-----------------------------------------------------------------------
$tresh_hold=25 * M_PI/180; // 25 degrees difference to be in a cluster
$incluster=false; // flag if we are currently in a cluster or not
$clusters = array(); // array of clusters
$cidx=-1; // running cluster index
// Go through all the labels and construct a number of clusters
// Go through all the labels and construct a number of clusters
for ($i=0; $i < $n-1; ++$i) {
// Calc the angle distance between two consecutive slices
$a1=$this->la[$i];
@ -787,7 +797,7 @@ class PiePlot
$clusters[$cidx][1]++;
$i++;
}
$incluster = false;
}
} elseif ($q1 == $q2) {
@ -797,8 +807,8 @@ class PiePlot
// cluster. If we don't do this then we risk that the label
// for the cluster of one will cross the guide-line
if ($q1 == 0 && $cidx > -1 &&
$clusters[$cidx][1] == 1 &&
$this->Quadrant($this->la[$clusters[$cidx][0]]) == 0) {
$clusters[$cidx][1] == 1 &&
$this->Quadrant($this->la[$clusters[$cidx][0]]) == 0) {
$clusters[$cidx][1]++;
} else {
$cidx++;
@ -834,18 +844,18 @@ class PiePlot
}
/*
if( true ) {
// Debug printout in labels
for( $i=0; $i <= $cidx; ++$i ) {
for( $j=0; $j < $clusters[$i][1]; ++$j ) {
$a = $this->la[$clusters[$i][0]+$j];
$aa = round($a*180/M_PI);
$q = $this->Quadrant($a);
$this->labels[$clusters[$i][0]+$j]="[$q:$aa] $i:$j";
}
}
}
*/
if( true ) {
// Debug printout in labels
for( $i=0; $i <= $cidx; ++$i ) {
for( $j=0; $j < $clusters[$i][1]; ++$j ) {
$a = $this->la[$clusters[$i][0]+$j];
$aa = round($a*180/M_PI);
$q = $this->Quadrant($a);
$this->labels[$clusters[$i][0]+$j]="[$q:$aa] $i:$j";
}
}
}
*/
//-----------------------------------------------------------------------
// Step 2 of the algorithm is use the clusters and draw the labels
@ -865,7 +875,7 @@ class PiePlot
// Walk through all the clusters
for ($i=0; $i < $nc; ++$i) {
// Start angle and number of slices in this cluster
// Start angle and number of slices in this cluster
$csize = $clusters[$i][1];
$a = $this->la[$clusters[$i][0]];
$q = $this->Quadrant($a);
@ -901,12 +911,12 @@ class PiePlot
// Now adjust the position of the labels in each cluster starting
// with the slice that is closest to the equator of the pie
$a = $this->la[$clusters[$i][0]+$idx];
// Guide line start in the center of the arc of the slice
$r = $radius+$this->explode_radius[$n-1-($clusters[$i][0]+$idx)];
$x = round($r*cos($a)+$xc);
$y = round($yc-$r*sin($a));
// The distance from the arc depends on chosen font and the "R-Factor"
$r += $fh*$this->iGuideLineRFactor;
@ -1023,7 +1033,7 @@ class PiePlot
public function StrokeLabel($label, $img, $xc, $yc, $a, $r)
{
// Default value
// Default value
if ($this->ilabelposadj === 'auto') {
$this->ilabelposadj = 0.65;
}
@ -1033,16 +1043,16 @@ class PiePlot
if ($this->ilabelposadj < 1.0) {
$this->value->SetAlign('center', 'center');
$this->value->margin = 0;
$xt=round($this->ilabelposadj*$r*cos($a)+$xc);
$yt=round($yc-$this->ilabelposadj*$r*sin($a));
$this->value->Stroke($img, $label, $xt, $yt);
} else {
$this->value->halign = "left";
$this->value->valign = "top";
$this->value->margin = 0;
// Position the axis title.
// dx, dy is the offset from the top left corner of the bounding box that sorrounds the text
// that intersects with the extension of the corresponding axis. The code looks a little
@ -1065,7 +1075,7 @@ class PiePlot
if ($this->ilabelposadj > 1.0 && $this->ilabelposadj < 5.0) {
$r *= $this->ilabelposadj;
}
$r += $img->GetFontHeight()/1.5;
$xt=round($r*cos($a)+$xc);
@ -1091,7 +1101,7 @@ class PiePlot
if ($a>=5*M_PI/4 && $a <= 7*M_PI/4) {
$dx=(1-($a-M_PI*5/4)*2/M_PI);
}
if ($a>=7*M_PI/4) {
$dy=(($a-M_PI)-3*M_PI/4)*2/M_PI;
}
@ -1107,10 +1117,15 @@ class PiePlot
if ($a>=5*M_PI/4 && $a <= 7*M_PI/4) {
$dy=0;
}
$this->value->Stroke($img, $label, $xt-$dx*$w, $yt-$dy*$h);
}
}
public function UsePlotThemeColors($flag = true)
{
$this->use_plot_theme_colors = $flag;
}
} // Class
@ -1121,16 +1136,16 @@ class PiePlot
//===================================================
class PiePlotC extends PiePlot
{
private $imidsize=0.5; // Fraction of total width
private $imidsize=0.5; // Fraction of total width
private $imidcolor='white';
public $midtitle='';
private $middlecsimtarget='';
private $middlecsimwintarget='';
private $middlecsimalt='';
public function PiePlotC($data, $aCenterTitle='')
public function __construct($data, $aCenterTitle='')
{
parent::PiePlot($data);
parent::__construct($data);
$this->midtitle = new Text();
$this->midtitle->ParagraphAlign('center');
}
@ -1189,7 +1204,7 @@ class PiePlotC extends PiePlot
$xp = floor(($this->imidsize*$radius*cos($ea))+$xc);
$yp = floor($yc-($this->imidsize*$radius*sin($ea)));
$coords = "$xp, $yp";
//add coordinates every 0.25 radians
$a=$ea+0.25;
@ -1230,7 +1245,7 @@ class PiePlotC extends PiePlot
$coords.= ", $xp, $yp";
$a -= 0.25;
}
//Add the last point on the arc
$xp = floor($radius*cos($ea)+$xc);
$yp = floor($yc-$radius*sin($ea));
@ -1243,7 +1258,7 @@ class PiePlotC extends PiePlot
if (!empty($this->csimtargets[$i])) {
$this->csimareas .= "<area shape=\"poly\" coords=\"$coords\" href=\"".
$this->csimtargets[$i]."\"";
$this->csimtargets[$i]."\"";
if (!empty($this->csimwintargets[$i])) {
$this->csimareas .= " target=\"".$this->csimwintargets[$i]."\" ";
}
@ -1259,7 +1274,7 @@ class PiePlotC extends PiePlot
public function Stroke($img, $aaoption=0)
{
// Stroke the pie but don't stroke values
// Stroke the pie but don't stroke values
$tmp = $this->value->show;
$this->value->show = false;
parent::Stroke($img, $aaoption);
@ -1343,12 +1358,16 @@ class PieGraph extends Graph
public $pieaa = false ;
//---------------
// CONSTRUCTOR
public function PieGraph($width=300, $height=200, $cachedName="", $timeout=0, $inline=1)
public function __construct($width=300, $height=200, $cachedName="", $timeout=0, $inline=1)
{
$this->Graph($width, $height, $cachedName, $timeout, $inline);
parent::__construct($width, $height, $cachedName, $timeout, $inline);
$this->posx=$width/2;
$this->posy=$height/2;
$this->SetColor(array(255,255,255));
if ($this->graph_theme) {
$this->graph_theme->ApplyGraph($this);
}
}
//---------------
@ -1369,19 +1388,32 @@ class PieGraph extends Graph
if (is_array($aObj)) {
$n = count($aObj);
for ($i=0; $i < $n; ++$i) {
//if ($aObj[$i]->theme) {
// $this->ClearTheme();
//}
$this->plots[] = $aObj[$i];
}
} else {
//if ($aObj->theme) {
// $this->ClearTheme();
//}
$this->plots[] = $aObj;
}
}
if ($this->graph_theme) {
$this->graph_theme->SetupPlot($aObj);
if ($aObj->is_using_plot_theme) {
$aObj->UsePlotThemeColors();
}
}
}
public function SetAntiAliasing($aFlg=true)
{
$this->pieaa = $aFlg;
}
public function SetColor($c)
{
$this->SetMarginColor($c);
@ -1394,7 +1426,8 @@ class PieGraph extends Graph
foreach ($this->plots as $p) {
$csim .= $p->GetCSIMareas();
}
//$csim.= $this->legend->GetCSIMareas();
$csim.= $this->legend->GetCSIMareas();
if (preg_match_all("/area shape=\"(\w+)\" coords=\"([0-9\, ]+)\"/", $csim, $coords)) {
$this->img->SetColor($this->csimcolor);
$n = count($coords[0]);
@ -1421,6 +1454,7 @@ class PieGraph extends Graph
// Method description
public function Stroke($aStrokeFileName="")
{
// If the filename is the predefined value = '_csim_special_'
// we assume that the call to stroke only needs to do enough
// to correctly generate the CSIM maps.
@ -1430,6 +1464,12 @@ class PieGraph extends Graph
// code below.
$_csim = ($aStrokeFileName===_CSIM_SPECIALFILE);
// If we are called the second time (perhaps the user has called GetHTMLImageMap()
// himself then the legends have alsready been populated once in order to get the
// CSIM coordinats. Since we do not want the legends to be populated a second time
// we clear the legends
$this->legend->Clear();
// We need to know if we have stroked the plot in the
// GetCSIMareas. Otherwise the CSIM hasn't been generated
// and in the case of GetCSIM called before stroke to generate
@ -1454,7 +1494,7 @@ class PieGraph extends Graph
$oldimg = $this->img->img;
$this->img->CreateImgCanvas(2*$w, 2*$h);
$this->img->SetColor($this->margin_color);
$this->img->FilledRectangle(0, 0, 2*$w-1, 2*$h-1);
@ -1520,6 +1560,7 @@ class PieGraph extends Graph
$this->StrokeFrameBackground();
} else {
$this->StrokeFrame();
$this->StrokeBackgroundGrad();
}
}
@ -1537,7 +1578,7 @@ class PieGraph extends Graph
if (!$_csim) {
// Stroke texts
// Stroke texts
if ($this->texts != null) {
$n = count($this->texts);
for ($i=0; $i < $n; ++$i) {
@ -1555,7 +1596,7 @@ class PieGraph extends Graph
require_once('jpgraph_imgtrans.php');
//JpGraphError::Raise('In order to use image transformation you must include the file jpgraph_imgtrans.php in your script.');
}
$tform = new ImgTrans($this->img->img);
$this->img->img = $tform->Skew3D(
$this->iImgTransHorizon,

View file

@ -1,13 +1,13 @@
<?php
/*=======================================================================
// File: JPGRAPH_PIE3D.PHP
// Description: 3D Pie plot extension for JpGraph
// Created: 2001-03-24
// Ver: $Id: jpgraph_pie3d.php 956 2007-11-17 13:19:20Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
// File: JPGRAPH_PIE3D.PHP
// Description: 3D Pie plot extension for JpGraph
// Created: 2001-03-24
// Ver: $Id: jpgraph_pie3d.php 1329 2009-06-20 19:23:30Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
*/
//===================================================
// CLASS PiePlot3D
@ -20,13 +20,12 @@ class PiePlot3D extends PiePlot
private $showlabelhint=true;
private $angle=50;
private $edgecolor="";
private $edgeweight=1;
private $iThickness=false;
//---------------
// CONSTRUCTOR
public function PiePlot3d($data)
public function __construct($data)
{
$this->radius = 0.5;
$this->data = $data;
@ -39,7 +38,7 @@ class PiePlot3D extends PiePlot
//---------------
// PUBLIC METHODS
// Set label arrays
public function SetLegends($aLegend)
{
@ -72,22 +71,14 @@ class PiePlot3D extends PiePlot
$this->edgeweight = $aWeight;
}
// Dummy function to make Pie3D behave in a similair way to 2D
public function ShowBorder($exterior=true, $interior=true)
{
JpGraphError::RaiseL(14001);
//('Pie3D::ShowBorder() . Deprecated function. Use Pie3D::SetEdge() to control the edges around slices.');
}
// Specify projection angle for 3D in degrees
// Must be between 20 and 70 degrees
public function SetAngle($a)
{
if ($a<5 || $a>90) {
JpGraphError::RaiseL(14002);
}
//("PiePlot3D::SetAngle() 3D Pie projection angle must be between 5 and 85 degrees.");
else {
} else {
$this->angle = $a;
}
}
@ -111,7 +102,7 @@ class PiePlot3D extends PiePlot
$yp = floor($yp+$thick);
$coords.= ", $xp, $yp";
}
//add coordinates every 0.2 radians
$a=$sa+0.2;
while ($a<$ea) {
@ -124,7 +115,7 @@ class PiePlot3D extends PiePlot
$coords.= ", $xp, $yp";
$a += 0.2;
}
//Add the last point on the arc
$xp = floor($width*cos($ea)/2+$xc);
$yp = floor($yc-$height*sin($ea)/2);
@ -138,11 +129,11 @@ class PiePlot3D extends PiePlot
if (!empty($this->csimtargets[$i])) {
$this->csimareas .= "<area shape=\"poly\" coords=\"$coords\" href=\"".$this->csimtargets[$i]."\"";
if (!empty($this->csimwintargets[$i])) {
$this->csimareas .= " target=\"".$this->csimwintargets[$i]."\" ";
}
if (!empty($this->csimalts[$i])) {
$tmp=sprintf($this->csimalts[$i], $this->data[$i]);
$this->csimareas .= "alt=\"$tmp\" title=\"$tmp\" ";
@ -157,19 +148,19 @@ class PiePlot3D extends PiePlot
$this->ilabelposadj=$aLblPosAdj;
}
// Distance from the pie to the labels
public function SetLabelMargin($m)
{
$this->value->SetMargin($m);
}
// Show a thin line from the pie to the label for a specific slice
public function ShowLabelHint($f=true)
{
$this->showlabelhint=$f;
}
// Set color of hint line to label for each slice
public function SetLabelHintColor($c)
{
@ -206,13 +197,13 @@ class PiePlot3D extends PiePlot
return $a;
}
// Draw one 3D pie slice at position ($xc,$yc) with height $z
public function Pie3DSlice($img, $xc, $yc, $w, $h, $sa, $ea, $z, $fillcolor, $shadow=0.65)
{
// Due to the way the 3D Pie algorithm works we are
// Due to the way the 3D Pie algorithm works we are
// guaranteed that any slice we get into this method
// belongs to either the left or right side of the
// pie ellipse. Hence, no slice will cross 90 or 270
@ -225,9 +216,9 @@ class PiePlot3D extends PiePlot
$p[] = array();
// Setup pre-calculated values
$rsa = $sa/180*M_PI; // to Rad
$rea = $ea/180*M_PI; // to Rad
$sinsa = sin($rsa);
$rsa = $sa/180*M_PI; // to Rad
$rea = $ea/180*M_PI; // to Rad
$sinsa = sin($rsa);
$cossa = cos($rsa);
$sinea = sin($rea);
$cosea = cos($rea);
@ -246,7 +237,7 @@ class PiePlot3D extends PiePlot
}
$p = array($xc,$yc,$xc,$yc+$z,
$xc+$w*$cossa,$z+$yc-$h*$sinsa);
$xc+$w*$cossa,$z+$yc-$h*$sinsa);
$pt = array($xc,$yc,$xc+$w*$cossa,$yc-$h*$sinsa);
for ($a=$rsa; $a < 2*M_PI; $a += $step) {
@ -272,16 +263,16 @@ class PiePlot3D extends PiePlot
$pt[] = $xc + $w*cos($a);
$pt[] = $yc - $h*sin($a);
}
$pt[] = $xc+$w*$cosea;
$pt[] = $yc-$h*$sinea;
$pt[] = $xc;
$pt[] = $yc;
} else {
$p = array($xc,$yc,$xc,$yc+$z,
$xc+$w*$cossa,$z+$yc-$h*$sinsa);
$xc+$w*$cossa,$z+$yc-$h*$sinsa);
$pt = array($xc,$yc,$xc+$w*$cossa,$yc-$h*$sinsa);
$rea = $rea == 0.0 ? 2*M_PI : $rea;
for ($a=$rsa; $a < $rea; $a += $step) {
$tca = cos($a);
@ -296,7 +287,7 @@ class PiePlot3D extends PiePlot
$pt[] = $yc-$h*$sinea;
$pt[] = $xc;
$pt[] = $yc;
$p[] = $xc+$w*$cosea;
$p[] = $z+$yc-$h*$sinea;
$p[] = $xc+$w*$cosea;
@ -307,7 +298,7 @@ class PiePlot3D extends PiePlot
} elseif ($sa >= 180) {
$p = array($xc,$yc,$xc,$yc+$z,$xc+$w*$cosea,$z+$yc-$h*$sinea);
$pt = array($xc,$yc,$xc+$w*$cosea,$yc-$h*$sinea);
for ($a=$rea; $a>$rsa; $a -= $step) {
$tca = cos($a);
$tsa = sin($a);
@ -321,7 +312,7 @@ class PiePlot3D extends PiePlot
$pt[] = $yc-$h*$sinsa;
$pt[] = $xc;
$pt[] = $yc;
$p[] = $xc+$w*$cossa;
$p[] = $z+$yc-$h*$sinsa;
$p[] = $xc+$w*$cossa;
@ -365,9 +356,9 @@ class PiePlot3D extends PiePlot
$pt[] = $yc;
} else { // $sa >= 90 && $ea <= 180
$p = array($xc,$yc,$xc,$yc+$z,
$xc+$w*$cosea,$z+$yc-$h*$sinea,
$xc+$w*$cosea,$yc-$h*$sinea,
$xc,$yc);
$xc+$w*$cosea,$z+$yc-$h*$sinea,
$xc+$w*$cosea,$yc-$h*$sinea,
$xc,$yc);
$pt = array($xc,$yc,$xc+$w*$cosea,$yc-$h*$sinea);
@ -384,9 +375,9 @@ class PiePlot3D extends PiePlot
} else { // sa > 0 && ea < 90
$p = array($xc,$yc,$xc,$yc+$z,
$xc+$w*$cossa,$z+$yc-$h*$sinsa,
$xc+$w*$cossa,$yc-$h*$sinsa,
$xc,$yc);
$xc+$w*$cossa,$z+$yc-$h*$sinsa,
$xc+$w*$cossa,$yc-$h*$sinsa,
$xc,$yc);
$pt = array($xc,$yc,$xc+$w*$cossa,$yc-$h*$sinsa);
@ -400,7 +391,7 @@ class PiePlot3D extends PiePlot
$pt[] = $xc;
$pt[] = $yc;
}
$img->PushColor($fillcolor.":".$shadow);
$img->FilledPolygon($p);
$img->PopColor();
@ -417,7 +408,7 @@ class PiePlot3D extends PiePlot
}
$this->startangle = $aStart;
}
// Draw a 3D Pie
public function Pie3D(
$aaoption,
@ -433,9 +424,10 @@ class PiePlot3D extends PiePlot
$startangle=0,
$edgecolor="",
$edgeweight=1
) {
)
{
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// As usual the algorithm get more complicated than I originally
// envisioned. I believe that this is as simple as it is possible
// to do it with the features I want. It's a good exercise to start
@ -471,7 +463,7 @@ class PiePlot3D extends PiePlot
// slice. Not a major problem though.
//---------------------------------------------------------------------------
// Determine the height of the ellippse which gives an
// indication of the inclination angle
$h = ($angle/90.0)*$d;
@ -479,7 +471,7 @@ class PiePlot3D extends PiePlot
for ($i=0; $i<count($data); ++$i) {
$sum += $data[$i];
}
// Special optimization
if ($sum==0) {
return;
@ -514,7 +506,7 @@ class PiePlot3D extends PiePlot
$la = $a + $da/2;
$explode = array( $xc + $this->explode_radius[$i]*cos($la*M_PI/180)*$expscale,
$yc - $this->explode_radius[$i]*sin($la*M_PI/180) * ($h/$d) *$expscale );
$yc - $this->explode_radius[$i]*sin($la*M_PI/180) * ($h/$d) *$expscale );
$adjexplode[$idx] = $explode;
$labeldata[$i] = array($la,$explode[0],$explode[1]);
$originalangles[$i] = array($a,$a+$da);
@ -522,15 +514,15 @@ class PiePlot3D extends PiePlot
$ne = $this->NormAngle($a+$da);
if ($da <= 180) {
// If the slice size is <= 90 it can at maximum cut across
// one boundary (either 90 or 270) where it needs to be split
$split=-1; // no split
if (($da<=90 && ($a <= 90 && $ne > 90)) ||
(($da <= 180 && $da >90) && (($a < 90 || $a >= 270) && $ne > 90))) {
$split = 90;
} elseif (($da<=90 && ($a <= 270 && $ne > 270)) ||
// one boundary (either 90 or 270) where it needs to be split
$split=-1; // no split
if (($da<=90 && ($a <= 90 && $ne > 90)) ||
(($da <= 180 && $da >90) && (($a < 90 || $a >= 270) && $ne > 90))) {
$split = 90;
} elseif (($da<=90 && ($a <= 270 && $ne > 270)) ||
(($da<=180 && $da>90) && ($a >= 90 && $a < 270 && ($a+$da) > 270))) {
$split = 270;
}
$split = 270;
}
if ($split > 0) { // split in two
$angles[$idx] = array($a,$split);
$adjcolors[$idx] = $colors[$i % $numcolors];
@ -574,9 +566,7 @@ class PiePlot3D extends PiePlot
// c) If start is > 270 (hence the firstr split is at 90)
// and the slice is so large that it goes all the way
// around 270.
if (($a < 90 && ($a+$da > 270)) ||
($a > 90 && $a<=270 && ($a+$da>360+90)) ||
($a > 270 && $this->NormAngle($a+$da)>270)) {
if (($a < 90 && ($a+$da > 270)) || ($a > 90 && $a<=270 && ($a+$da>360+90)) || ($a > 270 && $this->NormAngle($a+$da)>270)) {
$angles[++$idx] = array($split,360-$split);
$adjcolors[$idx] = $colors[$i % $numcolors];
$adjexplode[$idx] = $explode;
@ -632,10 +622,10 @@ class PiePlot3D extends PiePlot
// Step 3. Print slices in z-order
//
$cnt = 0;
// First stroke all the slices between 90 and 270 (left half circle)
// counterclockwise
while ($angles[$j][0] < 270 && $aaoption !== 2) {
list($x, $y) = $adjexplode[$j];
@ -651,7 +641,7 @@ class PiePlot3D extends PiePlot
$adjcolors[$j],
$shadow
);
$last = array($x,$y,$j);
$j++;
@ -664,14 +654,14 @@ class PiePlot3D extends PiePlot
}
++$cnt;
}
$slice_left = $n-$cnt;
$j=$start-1;
if ($j<0) {
$j=$n-1;
}
$cnt = 0;
// The stroke all slices from 90 to -90 (right half circle)
// clockwise
while ($cnt < $slice_left && $aaoption !== 2) {
@ -699,7 +689,7 @@ class PiePlot3D extends PiePlot
}
$cnt++;
}
// Now do a special thing. Stroke the last slice on the left
// halfcircle one more time. This is needed in the case where
// the slice close to 270 have been exploded. In that case the
@ -750,7 +740,7 @@ class PiePlot3D extends PiePlot
}
$this->StrokeLabels($l, $img, $labeldata[$i][0]*M_PI/180, $x, $y, $z);
$this->Add3DSliceToCSIM(
$i,
$labeldata[$i][1],
@ -781,7 +771,7 @@ class PiePlot3D extends PiePlot
$idx=0;
$img->PushColor($edgecolor);
$img->SetLineWeight($edgeweight);
$fulledge = true;
for ($i=0; $i < count($data) && $fulledge; ++$i) {
if (empty($this->explode_radius[$i])) {
@ -791,7 +781,7 @@ class PiePlot3D extends PiePlot
$fulledge = false;
}
}
for ($i=0; $i < count($data); ++$i, ++$idx) {
$da = $data[$i]/$sum * 2*M_PI;
@ -849,15 +839,15 @@ class PiePlot3D extends PiePlot
if ($sa < M_PI && $ea > M_PI) {
$sa = M_PI;
}
if ($sa < 2*M_PI && (($ea >= 2*M_PI) || ($ea > 0 && $ea < $sa))) {
$ea = 2*M_PI;
}
if ($sa >= M_PI && $ea <= 2*M_PI) {
$p = array($xc + $w*cos($sa),$yc - $h*sin($sa),
$xc + $w*cos($sa),$z + $yc - $h*sin($sa));
$xc + $w*cos($sa),$z + $yc - $h*sin($sa));
for ($a=$sa+$step; $a < $ea; $a += $step) {
$p[] = $xc + $w*cos($a);
$p[] = $z + $yc - $h*sin($a);
@ -890,20 +880,20 @@ class PiePlot3D extends PiePlot
} else {
$ca = $this->setslicecolors;
}
if ($this->posx <= 1 && $this->posx > 0) {
$xc = round($this->posx*$img->width);
} else {
$xc = $this->posx ;
}
if ($this->posy <= 1 && $this->posy > 0) {
$yc = round($this->posy*$img->height);
} else {
$yc = $this->posy ;
}
if ($this->radius <= 1) {
$width = floor($this->radius*min($img->width, $img->height));
// Make sure that the pie doesn't overflow the image border
@ -923,7 +913,7 @@ class PiePlot3D extends PiePlot
// pie slice width (=pie radius) but since the perspective depends
// on the inclination angle we use some heuristics to make the edge
// slightly thicker the less the angle.
// Has user specified an absolute thickness? In that case use
// that instead
@ -934,6 +924,7 @@ class PiePlot3D extends PiePlot
$thick = $width/12;
}
$a = $this->angle;
if ($a <= 30) {
$thick *= 1.6;
} elseif ($a <= 40) {
@ -1008,9 +999,11 @@ class PiePlot3D extends PiePlot
} else {
$w=$img->GetTextWidth($label);
}
while ($a > 2*M_PI) {
$a -= 2*M_PI;
}
if ($a>=7*M_PI/4 || $a <= M_PI/4) {
$dx=0;
}
@ -1023,7 +1016,7 @@ class PiePlot3D extends PiePlot
if ($a>=5*M_PI/4 && $a <= 7*M_PI/4) {
$dx=(1-($a-M_PI*5/4)*2/M_PI);
}
if ($a>=7*M_PI/4) {
$dy=(($a-M_PI)-3*M_PI/4)*2/M_PI;
}
@ -1039,17 +1032,17 @@ class PiePlot3D extends PiePlot
if ($a>=5*M_PI/4 && $a <= 7*M_PI/4) {
$dy=0;
}
$x = round($xp-$dx*$w);
$y = round($yp-$dy*$h);
// Mark anchor point for debugging
/*
$img->SetColor('red');
$img->Line($xp-10,$yp,$xp+10,$yp);
$img->Line($xp,$yp-10,$xp,$yp+10);
*/
$oldmargin = $this->value->margin;
$this->value->margin=0;
$this->value->Stroke($img, $label, $x, $y);

View file

@ -1,22 +1,22 @@
<?php
//=======================================================================
// File: JPGRAPH_PLOTBAND.PHP
// Description: PHP4 Graph Plotting library. Extension module.
// Created: 2004-02-18
// Ver: $Id: jpgraph_plotband.php 781 2006-10-08 08:07:47Z ljp $
// File: JPGRAPH_PLOTBAND.PHP
// Description: PHP4 Graph Plotting library. Extension module.
// Created: 2004-02-18
// Ver: $Id: jpgraph_plotband.php 1106 2009-02-22 20:16:35Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
// Constants for types of static bands in plot area
DEFINE("BAND_RDIAG", 1); // Right diagonal lines
DEFINE("BAND_LDIAG", 2); // Left diagonal lines
DEFINE("BAND_SOLID", 3); // Solid one color
DEFINE("BAND_VLINE", 4); // Vertical lines
DEFINE("BAND_HLINE", 5); // Horizontal lines
DEFINE("BAND_3DPLANE", 6); // "3D" Plane
DEFINE("BAND_HVCROSS", 7); // Vertical/Hor crosses
DEFINE("BAND_DIAGCROSS", 8); // Diagonal crosses
define("BAND_RDIAG", 1); // Right diagonal lines
define("BAND_LDIAG", 2); // Left diagonal lines
define("BAND_SOLID", 3); // Solid one color
define("BAND_VLINE", 4); // Vertical lines
define("BAND_HLINE", 5); // Horizontal lines
define("BAND_3DPLANE", 6); // "3D" Plane
define("BAND_HVCROSS", 7); // Vertical/Hor crosses
define("BAND_DIAGCROSS", 8); // Diagonal crosses
// Utility class to hold coordinates for a rectangle
@ -28,7 +28,7 @@ class Rectangle
public $h;
public $xe;
public $ye;
public function Rectangle($aX, $aY, $aWidth, $aHeight)
public function __construct($aX, $aY, $aWidth, $aHeight)
{
$this->x=$aX;
$this->y=$aY;
@ -52,10 +52,10 @@ class RectPattern
protected $weight;
protected $rect=null;
protected $doframe=true;
protected $linespacing; // Line spacing in pixels
protected $linespacing; // Line spacing in pixels
protected $iBackgroundColor=-1; // Default is no background fill
public function RectPattern($aColor, $aWeight=1)
public function __construct($aColor, $aWeight=1)
{
$this->color = $aColor;
$this->weight = $aWeight;
@ -70,7 +70,7 @@ class RectPattern
{
$this->rect = $aRect;
}
public function ShowFrame($aShow=true)
{
$this->doframe=$aShow;
@ -119,9 +119,9 @@ class RectPattern
//=====================================================================
class RectPatternSolid extends RectPattern
{
public function RectPatternSolid($aColor="black", $aWeight=1)
public function __construct($aColor="black", $aWeight=1)
{
parent::RectPattern($aColor, $aWeight);
parent::__construct($aColor, $aWeight);
}
public function DoPattern($aImg)
@ -142,12 +142,12 @@ class RectPatternSolid extends RectPattern
//=====================================================================
class RectPatternHor extends RectPattern
{
public function RectPatternHor($aColor="black", $aWeight=1, $aLineSpacing=7)
public function __construct($aColor="black", $aWeight=1, $aLineSpacing=7)
{
parent::RectPattern($aColor, $aWeight);
parent::__construct($aColor, $aWeight);
$this->linespacing = $aLineSpacing;
}
public function DoPattern($aImg)
{
$x0 = $this->rect->x;
@ -166,9 +166,9 @@ class RectPatternHor extends RectPattern
//=====================================================================
class RectPatternVert extends RectPattern
{
public function RectPatternVert($aColor="black", $aWeight=1, $aLineSpacing=7)
public function __construct($aColor="black", $aWeight=1, $aLineSpacing=7)
{
parent::RectPattern($aColor, $aWeight);
parent::__construct($aColor, $aWeight);
$this->linespacing = $aLineSpacing;
}
@ -194,9 +194,9 @@ class RectPatternVert extends RectPattern
//=====================================================================
class RectPatternRDiag extends RectPattern
{
public function RectPatternRDiag($aColor="black", $aWeight=1, $aLineSpacing=12)
public function __construct($aColor="black", $aWeight=1, $aLineSpacing=12)
{
parent::RectPattern($aColor, $aWeight);
parent::__construct($aColor, $aWeight);
$this->linespacing = $aLineSpacing;
}
@ -230,7 +230,7 @@ class RectPatternRDiag extends RectPattern
$x0 += $this->linespacing;
$x1 += $this->linespacing;
}
$y0=$this->rect->y + ($x0-$xe);
$x0=$xe;
} else {
@ -244,7 +244,7 @@ class RectPatternRDiag extends RectPattern
$y1 += $this->linespacing;
$y0 += $this->linespacing;
}
$diff = $y1-$ye;
$y1 = $ye;
$x1 = $diff + $this->rect->x;
@ -257,17 +257,17 @@ class RectPatternRDiag extends RectPattern
}
}
}
//=====================================================================
// Class RectPatternLDiag
// Implements left diagonal pattern
//=====================================================================
class RectPatternLDiag extends RectPattern
{
public function RectPatternLDiag($aColor="black", $aWeight=1, $aLineSpacing=12)
public function __construct($aColor="black", $aWeight=1, $aLineSpacing=12)
{
$this->linespacing = $aLineSpacing;
parent::RectPattern($aColor, $aWeight);
parent::__construct($aColor, $aWeight);
}
public function DoPattern($aImg)
@ -299,7 +299,7 @@ class RectPatternLDiag extends RectPattern
$x0 += $this->linespacing;
$x1 += $this->linespacing;
}
$y0=$this->rect->ye - ($x0-$xe);
$x0=$xe;
} else {
@ -335,9 +335,9 @@ class RectPattern3DPlane extends RectPattern
// top of the band. Specifies how fast the lines
// converge.
public function RectPattern3DPlane($aColor="black", $aWeight=1)
public function __construct($aColor="black", $aWeight=1)
{
parent::RectPattern($aColor, $aWeight);
parent::__construct($aColor, $aWeight);
$this->SetDensity(10); // Slightly larger default
}
@ -345,7 +345,7 @@ class RectPattern3DPlane extends RectPattern
{
$this->alpha=$aHorizon;
}
public function DoPattern($aImg)
{
// "Fake" a nice 3D grid-effect.
@ -395,43 +395,43 @@ class RectPattern3DPlane extends RectPattern
$x0_right = $middle + $dist * $factor;
$c = $apa - $d*$apa/$dist;
}
// Horizontal lines
// They need some serious consideration since they are a function
// of perspective depth (alpha) and density (linespacing)
$x0=$this->rect->x;
$x1=$this->rect->xe;
$y=$this->rect->ye;
// The first line is drawn directly. Makes the loop below slightly
// more readable.
$aImg->Line($x0, $y, $x1, $y);
$hls = $this->linespacing;
// A correction factor for vertical "brick" line spacing to account for
// a) the difference in number of pixels hor vs vert
// b) visual apperance to make the first layer of "bricks" look more
// square.
$vls = $this->linespacing*0.6;
$ds = $hls*($apa-$vls)/$apa;
// Get the slope for the "perspective line" going from bottom right
// corner to top left corner of the "first" brick.
// Uncomment the following lines if you want to get a visual understanding
// of what this helpline does. BTW this mimics the way you would get the
// perspective right when drawing on paper.
/*
$x0 = $middle;
$y0 = $this->rect->ye;
$len=floor(($this->rect->ye-$this->rect->y)/$vls);
$x1 = $middle+round($len*$ds);
$y1 = $this->rect->ye-$len*$vls;
$aImg->PushColor("red");
$aImg->Line($x0,$y0,$x1,$y1);
$aImg->PopColor();
$x0 = $middle;
$y0 = $this->rect->ye;
$len=floor(($this->rect->ye-$this->rect->y)/$vls);
$x1 = $middle+round($len*$ds);
$y1 = $this->rect->ye-$len*$vls;
$aImg->PushColor("red");
$aImg->Line($x0,$y0,$x1,$y1);
$aImg->PopColor();
*/
$y -= $vls;
$k=($this->rect->ye-($this->rect->ye-$vls))/($middle-($middle-$ds));
$dist = $hls;
@ -455,9 +455,9 @@ class RectPatternCross extends RectPattern
{
private $vert=null;
private $hor=null;
public function RectPatternCross($aColor="black", $aWeight=1)
public function __construct($aColor="black", $aWeight=1)
{
parent::RectPattern($aColor, $aWeight);
parent::__construct($aColor, $aWeight);
$this->vert = new RectPatternVert($aColor, $aWeight);
$this->hor = new RectPatternHor($aColor, $aWeight);
}
@ -497,9 +497,9 @@ class RectPatternDiagCross extends RectPattern
{
private $left=null;
private $right=null;
public function RectPatternDiagCross($aColor="black", $aWeight=1)
public function __construct($aColor="black", $aWeight=1)
{
parent::RectPattern($aColor, $aWeight);
parent::__construct($aColor, $aWeight);
$this->right = new RectPatternRDiag($aColor, $aWeight);
$this->left = new RectPatternLDiag($aColor, $aWeight);
}
@ -536,41 +536,41 @@ class RectPatternDiagCross extends RectPattern
//=====================================================================
class RectPatternFactory
{
public function RectPatternFactory()
public function __construct()
{
// Empty
}
public function Create($aPattern, $aColor, $aWeight=1)
{
switch ($aPattern) {
case BAND_RDIAG:
$obj = new RectPatternRDiag($aColor, $aWeight);
break;
case BAND_LDIAG:
$obj = new RectPatternLDiag($aColor, $aWeight);
break;
case BAND_SOLID:
$obj = new RectPatternSolid($aColor, $aWeight);
break;
case BAND_VLINE:
$obj = new RectPatternVert($aColor, $aWeight);
break;
case BAND_HLINE:
$obj = new RectPatternHor($aColor, $aWeight);
break;
case BAND_3DPLANE:
$obj = new RectPattern3DPlane($aColor, $aWeight);
break;
case BAND_HVCROSS:
$obj = new RectPatternCross($aColor, $aWeight);
break;
case BAND_DIAGCROSS:
$obj = new RectPatternDiagCross($aColor, $aWeight);
break;
default:
JpGraphError::RaiseL(16003, $aPattern);
//(" Unknown pattern specification ($aPattern)");
}
case BAND_RDIAG:
$obj = new RectPatternRDiag($aColor, $aWeight);
break;
case BAND_LDIAG:
$obj = new RectPatternLDiag($aColor, $aWeight);
break;
case BAND_SOLID:
$obj = new RectPatternSolid($aColor, $aWeight);
break;
case BAND_VLINE:
$obj = new RectPatternVert($aColor, $aWeight);
break;
case BAND_HLINE:
$obj = new RectPatternHor($aColor, $aWeight);
break;
case BAND_3DPLANE:
$obj = new RectPattern3DPlane($aColor, $aWeight);
break;
case BAND_HVCROSS:
$obj = new RectPatternCross($aColor, $aWeight);
break;
case BAND_DIAGCROSS:
$obj = new RectPatternDiagCross($aColor, $aWeight);
break;
default:
JpGraphError::RaiseL(16003, $aPattern);
//(" Unknown pattern specification ($aPattern)");
}
return $obj;
}
}
@ -590,7 +590,7 @@ class PlotBand
private $min;
private $max;
public function PlotBand($aDir, $aPattern, $aMin, $aMax, $aColor="black", $aWeight=1, $aDepth=DEPTH_BACK)
public function __construct($aDir, $aPattern, $aMin, $aMax, $aColor="black", $aWeight=1, $aDepth=DEPTH_BACK)
{
$f = new RectPatternFactory();
$this->prect = $f->Create($aPattern, $aColor, $aWeight);
@ -603,14 +603,14 @@ class PlotBand
$this->max = $aMax;
$this->depth=$aDepth;
}
// Set position. aRect contains absolute image coordinates
public function SetPos($aRect)
{
assert($this->prect != null) ;
$this->prect->SetPos($aRect);
}
public function ShowFrame($aFlag=true)
{
$this->prect->ShowFrame($aFlag);
@ -621,22 +621,22 @@ class PlotBand
{
$this->depth=$aDepth;
}
public function SetDensity($aDens)
{
$this->prect->SetDensity($aDens);
}
public function GetDir()
{
return $this->dir;
}
public function GetMin()
{
return $this->min;
}
public function GetMax()
{
return $this->max;
@ -646,7 +646,7 @@ class PlotBand
{
// Nothing to do
}
// Display band
public function Stroke($aImg, $aXScale, $aYScale)
{
@ -661,8 +661,8 @@ class PlotBand
// Only draw the bar if it actually appears in the range
if ($this->min < $aYScale->GetMaxVal() && $this->max > $aYScale->GetMinVal()) {
// Trucate to limit of axis
// Trucate to limit of axis
$this->min = max($this->min, $aYScale->GetMinVal());
$this->max = min($this->max, $aYScale->GetMaxVal());
@ -673,18 +673,18 @@ class PlotBand
$this->prect->SetPos(new Rectangle($x, $y, $width, $height));
$this->prect->Stroke($aImg);
}
} else { // VERTICAL
} else { // VERTICAL
if ($this->min === 'min') {
$this->min = $aXScale->GetMinVal();
}
if ($this->max === 'max') {
$this->max = $aXScale->GetMaxVal();
}
// Only draw the bar if it actually appears in the range
if ($this->min < $aXScale->GetMaxVal() && $this->max > $aXScale->GetMinVal()) {
// Trucate to limit of axis
// Trucate to limit of axis
$this->min = max($this->min, $aXScale->GetMinVal());
$this->max = min($this->max, $aXScale->GetMaxVal());

View file

@ -0,0 +1,171 @@
<?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;
public $direction=-1;
protected $weight=1;
protected $color = 'black';
private $legend='';
private $hidelegend=false;
private $legendcsimtarget='';
private $legendcsimalt='';
private $legendcsimwintarget='';
private $iLineStyle='solid';
public $numpoints=0; // Needed since the framework expects this property
public function __construct($aDir=HORIZONTAL, $aPos=0, $aColor='black', $aWeight=1)
{
$this->direction = $aDir;
$this->color=$aColor;
$this->weight=$aWeight;
$this->scaleposition=$aPos;
}
public function SetLegend($aLegend, $aCSIM='', $aCSIMAlt='', $aCSIMWinTarget='')
{
$this->legend = $aLegend;
$this->legendcsimtarget = $aCSIM;
$this->legendcsimwintarget = $aCSIMWinTarget;
$this->legendcsimalt = $aCSIMAlt;
}
public function HideLegend($f=true)
{
$this->hidelegend = $f;
}
public function SetPosition($aScalePosition)
{
$this->scaleposition=$aScalePosition;
}
public function SetDirection($aDir)
{
$this->direction = $aDir;
}
public function SetColor($aColor)
{
$this->color=$aColor;
}
public function SetWeight($aWeight)
{
$this->weight=$aWeight;
}
public function SetLineStyle($aStyle)
{
$this->iLineStyle = $aStyle;
}
public function GetCSIMAreas()
{
return '';
}
//---------------
// PRIVATE METHODS
public function DoLegend($graph)
{
if (!$this->hidelegend) {
$this->Legend($graph);
}
}
// Framework function the chance for each plot class to set a legend
public 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
);
}
}
public function PreStrokeAdjust($aGraph)
{
// Nothing to do
}
// Called by framework to allow the object to draw
// optional information in the margin area
public function StrokeMargin($aImg)
{
// Nothing to do
}
// Framework function to allow the object to adjust the scale
public function PrescaleSetup($aGraph)
{
// Nothing to do
}
public function Min()
{
return array(null,null);
}
public function Max()
{
return array(null,null);
}
public 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);
}
public 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)
);
}
}

View file

@ -1,11 +1,11 @@
<?php
//=======================================================================
// File: JPGRAPH_PLOTMARK.PHP
// Description: Class file. Handles plotmarks
// Created: 2003-03-21
// Ver: $Id: jpgraph_plotmark.inc.php 956 2007-11-17 13:19:20Z ljp $
// 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) Aditus Consulting. All rights reserved.
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
@ -44,7 +44,7 @@ class PlotMark
//--------------
// CONSTRUCTOR
public function PlotMark()
public function __construct()
{
$this->title = new Text();
$this->title->Hide();
@ -62,7 +62,7 @@ class PlotMark
$this->iFileName = $aFileName;
$this->iScale = $aScale;
}
public function SetCallback($aFunc)
{
$this->iFormatCallback = $aFunc;
@ -72,17 +72,17 @@ class PlotMark
{
$this->iFormatCallback2 = $aFunc;
}
public function GetType()
{
return $this->type;
}
public function SetColor($aColor)
{
$this->color=$aColor;
}
public function SetFillColor($aFillColor)
{
$this->fill_color = $aFillColor;
@ -98,7 +98,7 @@ class PlotMark
{
$this->width=$aWidth;
}
public function SetWidth($aWidth)
{
$this->width=$aWidth;
@ -107,25 +107,25 @@ class PlotMark
public function SetDefaultWidth()
{
switch ($this->type) {
case MARK_CIRCLE:
case MARK_FILLEDCIRCLE:
$this->width=4;
break;
default:
$this->width=7;
case MARK_CIRCLE:
case MARK_FILLEDCIRCLE:
$this->width=4;
break;
default:
$this->width=7;
}
}
}
public function GetWidth()
{
return $this->width;
}
public function Hide($aHide=true)
{
$this->show = !$aHide;
}
public function Show($aShow=true)
{
$this->show = $aShow;
@ -136,23 +136,23 @@ class PlotMark
$this->yvalue=$aY;
$this->xvalue=$aX;
}
public function SetCSIMTarget($aTarget, $aWinTarget='')
{
$this->csimtarget=$aTarget;
$this->csimwintarget=$aWinTarget;
}
public function SetCSIMAlt($aAlt)
{
$this->csimalt=$aAlt;
}
public function GetCSIMAreas()
{
return $this->csimareas;
}
public function AddCSIMPoly($aPts)
{
$coords = round($aPts[0]).", ".round($aPts[1]);
@ -175,7 +175,7 @@ class PlotMark
$this->csimareas .= " />\n";
}
}
public function AddCSIMCircle($x, $y, $r)
{
$x = round($x);
@ -196,7 +196,7 @@ class PlotMark
$this->csimareas .= " />\n";
}
}
public function Stroke($img, $x, $y)
{
if (!$this->show) {
@ -241,91 +241,91 @@ class PlotMark
($this->type >= MARK_FLAG1 && $this->type <= MARK_FLAG4) ||
$this->type >= MARK_IMG_PUSHPIN) {
// Note: For the builtin images we use the "filename" parameter
// 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_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:
// 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_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_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_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_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_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();
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;
}
$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);
@ -334,15 +334,15 @@ class PlotMark
$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)."\"";
$dx.','.$dy.','.round($dx+$dw).','.round($dy+$dh).'" '.
"href=\"".htmlentities($this->csimtarget)."\"";
if (!empty($this->csimwintarget)) {
$this->csimareas .= " target=\"".$this->csimwintarget."\" ";
}
@ -353,7 +353,7 @@ class PlotMark
}
$this->csimareas .= " />\n";
}
// Stroke title
$this->title->Align("center", "top");
$this->title->Stroke($img, $x, $y+round($dh/2));
@ -366,65 +366,65 @@ class PlotMark
$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;
}
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);
@ -467,7 +467,7 @@ class PlotMark
$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);
@ -483,13 +483,19 @@ class PlotMark
//========================================================================
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 $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;
protected $anchor_y=0.5 ; // Where is the center of the image
public function __construct()
{
// Empty
}
// Create a GD image from the data and return a GD handle
public function GetImg($aMark, $aIdx)
{
@ -507,6 +513,7 @@ class ImgData
}
return Image::CreateFromString(base64_decode($this->{$n}[$idx][1]));
}
public function GetAnchor()
{
return array($this->anchor_x,$this->anchor_y);
@ -516,10 +523,10 @@ class ImgData
// Keep a global flag cache to reduce memory usage
$_gFlagCache=array(
1 => null,
2 => null,
3 => null,
4 => null,
1 => null,
2 => null,
3 => null,
4 => null,
);
// Only supposed to b called as statics
class FlagCache

View file

@ -1,20 +1,20 @@
<?php
/*=======================================================================
// File: JPGRAPH_POLAR.PHP
// Description: Polar plot extension for JpGraph
// Created: 2003-02-02
// Ver: $Id: jpgraph_polar.php 869 2007-03-24 11:19:38Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
// File: JPGRAPH_POLAR.PHP
// Description: Polar plot extension for JpGraph
// Created: 2003-02-02
// Ver: $Id: jpgraph_polar.php 1796 2009-09-07 09:37:19Z ljp $
//
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
*/
require_once('jpgraph_plotmark.inc.php');
require_once "jpgraph_log.php";
DEFINE('POLAR_360', 1);
DEFINE('POLAR_180', 2);
define('POLAR_360', 1);
define('POLAR_180', 2);
//
// Note. Don't attempt to make sense of this code.
@ -38,9 +38,9 @@ class PolarPlot
public $legendcsimtarget='';
public $legendcsimalt='';
public $legend="";
public $csimtargets=array(); // Array of targets for CSIM
public $csimareas=""; // Resultant CSIM area tags
public $csimalts=null; // ALT:s for corresponding target
public $csimtargets=array(); // Array of targets for CSIM
public $csimareas=""; // Resultant CSIM area tags
public $csimalts=null; // ALT:s for corresponding target
public $scale=null;
private $numpoints=0;
private $iColor='navy';
@ -48,7 +48,7 @@ class PolarPlot
private $iLineWeight=1;
private $coord=null;
public function PolarPlot($aData)
public function __construct($aData)
{
$n = count($aData);
if ($n & 1) {
@ -91,13 +91,13 @@ class PolarPlot
$this->csimtargets=$aTargets;
$this->csimalts=$aAlts;
}
// Get all created areas
public function GetCSIMareas()
{
return $this->csimareas;
}
public function SetLegend($aLegend, $aCSIM="", $aCSIMAlt="")
{
$this->legend = $aLegend;
@ -143,7 +143,7 @@ class PolarPlot
list($x1, $y1) = $scale->PTranslate($this->coord[2*$i], $this->coord[2*$i+1]);
$p[2*$i] = $x1;
$p[2*$i+1] = $y1;
if (isset($this->csimtargets[$i])) {
$this->mark->SetCSIMTarget($this->csimtargets[$i]);
$this->mark->SetCSIMAlt($this->csimalts[$i]);
@ -192,9 +192,9 @@ class PolarAxis extends Axis
private $show_angle_tick=true;
private $radius_tick_color='black';
public function PolarAxis($img, $aScale)
public function __construct($img, $aScale)
{
parent::Axis($img, $aScale);
parent::__construct($img, $aScale);
}
public function ShowAngleDegreeMark($aFlg=true)
@ -260,7 +260,7 @@ class PolarAxis extends Axis
$this->radius_tick_color = $aRadColor;
$this->angle_tick_color = $aAngleColor;
}
// Private methods
public function StrokeGrid($pos)
{
@ -281,7 +281,7 @@ class PolarAxis extends Axis
}
$i++;
}
$limit = max($this->img->plotwidth, $this->img->plotheight)*1.4 ;
while ($r < $limit) {
$off = $r;
@ -360,7 +360,7 @@ class PolarAxis extends Axis
if (!$this->show_angle_label) {
return;
}
$x0 = round($this->img->left_margin+$this->img->plotwidth/2)+1;
$d = max($this->img->plotwidth, $this->img->plotheight)*1.42;
@ -381,17 +381,20 @@ class PolarAxis extends Axis
$margin=5;
$tl = $this->angle_tick_len ; // Outer len
$tl2 = $this->angle_tick_len2 ; // Interior len
$tl2 = $this->angle_tick_len2 ; // Interior len
$this->img->SetColor($this->angle_tick_color);
$this->img->SetColor($this->angle_tick_color);
$rot90 = $this->img->a == 90 ;
if ($type == POLAR_360) {
// Corner angles of the four corners
$ca1 = atan($h/$w)/M_PI*180;
$ca2 = 180-$ca1;
$ca3 = $ca1+180;
$ca4 = 360-$ca1;
$end = 360;
while ($a < $end) {
$ca = cos($a/180*M_PI);
$sa = sin($a/180*M_PI);
@ -454,15 +457,20 @@ class PolarAxis extends Axis
}
if ($a != 0 && $a != 180) {
$t->Align($ha, $va);
if ($this->show_angle_mark) {
$a .= '°';
if ($this->scale->clockwise) {
$t->Set(360-$a);
} else {
$t->Set($a);
}
if ($this->show_angle_mark && $t->font_family > 4) {
$a .= SymChar::Get('degree');
}
$t->Set($a);
$t->Stroke($this->img, $xt, $yt);
if ($this->show_angle_tick) {
$this->img->Line($x1, $y1, $x2, $y2);
}
}
$a = (int) $a;
$a += $this->angle_step;
}
} else {
@ -516,14 +524,15 @@ class PolarAxis extends Axis
$y1=$y2=$yt;
}
$t->Align($ha, $va);
if ($this->show_angle_mark) {
$a .= '°';
if ($this->show_angle_mark && $t->font_family > 4) {
$a .= SymChar::Get('degree');
}
$t->Set($a);
$t->Stroke($this->img, $xt, $yt);
if ($this->show_angle_tick) {
$this->img->Line($x1, $y1, $x2, $y2);
}
$a = (int) $a;
$a += $this->angle_step;
}
}
@ -547,8 +556,7 @@ class PolarAxis extends Axis
$this->title->SetPos($this->img->width-$this->img->right_margin, $y, "right", "top");
} elseif ($this->title_adjust=="middle" || $this->title_adjust=="center") {
$this->title->SetPos(
($this->img->width-$this->img->left_margin-
$this->img->right_margin)/2+$this->img->left_margin,
($this->img->width-$this->img->left_margin-$this->img->right_margin)/2+$this->img->left_margin,
$y,
"center",
"top"
@ -560,7 +568,7 @@ class PolarAxis extends Axis
//('Unknown alignment specified for X-axis title. ('.$this->title_adjust.')');
}
if (!$this->hide_labels) {
$this->StrokeLabels($pos, false);
}
@ -575,7 +583,7 @@ class PolarAxis extends Axis
$i=0;
while ($i < $n) {
$this->scale->ticks->ticks_pos[$i] =
$mid-$this->scale->ticks->ticks_pos[$i] ;
$mid-$this->scale->ticks->ticks_pos[$i] ;
++$i;
}
@ -583,15 +591,15 @@ class PolarAxis extends Axis
$i=0;
while ($i < $n) {
$this->scale->ticks->maj_ticks_pos[$i] =
$mid-$this->scale->ticks->maj_ticks_pos[$i] ;
$mid-$this->scale->ticks->maj_ticks_pos[$i] ;
++$i;
}
$n = count($this->scale->ticks->maj_ticklabels_pos);
$i=1;
while ($i < $n) {
$this->scale->ticks->maj_ticklabels_pos[$i] =
$mid-$this->scale->ticks->maj_ticklabels_pos[$i] ;
$mid-$this->scale->ticks->maj_ticklabels_pos[$i] ;
++$i;
}
@ -633,11 +641,18 @@ class PolarAxis extends Axis
class PolarScale extends LinearScale
{
private $graph;
public $clockwise=false;
public function PolarScale($aMax=0, $graph)
public function __construct($aMax, $graph, $aClockwise)
{
parent::LinearScale(0, $aMax, 'x');
parent::__construct(0, $aMax, 'x');
$this->graph = $graph;
$this->clockwise = $aClockwise;
}
public function SetClockwise($aFlg)
{
$this->clockwise = $aFlg;
}
public function _Translate($v)
@ -651,8 +666,13 @@ class PolarScale extends LinearScale
$w = $this->graph->img->plotwidth/2;
$aRad = $aRad/$m*$w;
$x = cos($aAngle/180 * M_PI) * $aRad;
$y = sin($aAngle/180 * M_PI) * $aRad;
$a = $aAngle/180 * M_PI;
if ($this->clockwise) {
$a = 2*M_PI-$a;
}
$x = cos($a) * $aRad;
$y = sin($a) * $aRad;
$x += $this->_Translate(0);
@ -668,11 +688,19 @@ class PolarScale extends LinearScale
class PolarLogScale extends LogScale
{
private $graph;
public function PolarLogScale($aMax=1, $graph)
public $clockwise=false;
public function __construct($aMax, $graph, $aClockwise=false)
{
parent::LogScale(0, $aMax, 'x');
parent::__construct(0, $aMax, 'x');
$this->graph = $graph;
$this->ticks->SetLabelLogType(LOGLABELS_MAGNITUDE);
$this->clockwise = $aClockwise;
}
public function SetClockwise($aFlg)
{
$this->clockwise = $aFlg;
}
public function PTranslate($aAngle, $aRad)
@ -685,8 +713,13 @@ class PolarLogScale extends LogScale
$w = $this->graph->img->plotwidth/2;
$aRad = $aRad/$m*$w;
$x = cos($aAngle/180 * M_PI) * $aRad;
$y = sin($aAngle/180 * M_PI) * $aRad;
$a = $aAngle/180 * M_PI;
if ($this->clockwise) {
$a = 2*M_PI-$a;
}
$x = cos($a) * $aRad;
$y = sin($a) * $aRad;
$x += $w+$this->graph->img->left_margin;//$this->_Translate(0);
if ($this->graph->iType == POLAR_360) {
@ -703,10 +736,11 @@ class PolarGraph extends Graph
public $scale;
public $axis;
public $iType=POLAR_360;
public function PolarGraph($aWidth=300, $aHeight=200, $aCachedName="", $aTimeOut=0, $aInline=true)
private $iClockwise=false;
public function __construct($aWidth=300, $aHeight=200, $aCachedName="", $aTimeOut=0, $aInline=true)
{
parent::Graph($aWidth, $aHeight, $aCachedName, $aTimeOut, $aInline) ;
parent::__construct($aWidth, $aHeight, $aCachedName, $aTimeOut, $aInline) ;
$this->SetDensity(TICKD_DENSE);
$this->SetBox();
$this->SetMarginColor('white');
@ -717,22 +751,29 @@ class PolarGraph extends Graph
$this->SetTickDensity(TICKD_NORMAL, $aDense);
}
public function SetClockwise($aFlg)
{
$this->scale->SetClockwise($aFlg);
}
public function Set90AndMargin($lm=0, $rm=0, $tm=0, $bm=0)
{
$adj = ($this->img->height - $this->img->width)/2;
$this->SetAngle(90);
$this->img->SetMargin($lm-$adj, $rm-$adj, $tm+$adj, $bm+$adj);
$this->img->SetCenter(floor($this->img->width/2), floor($this->img->height/2));
$lm2 = -$adj + ($lm-$rm+$tm+$bm)/2;
$rm2 = -$adj + (-$lm+$rm+$tm+$bm)/2;
$tm2 = $adj + ($tm-$bm+$lm+$rm)/2;
$bm2 = $adj + (-$tm+$bm+$lm+$rm)/2;
$this->SetMargin($lm2, $rm2, $tm2, $bm2);
$this->axis->SetLabelAlign('right', 'center');
//JpGraphError::Raise('Set90AndMargin() is not supported for polar graphs.');
}
public function SetScale($aScale, $rmax=0, $dummy1=1, $dummy2=1, $dummy3=1)
{
if ($aScale == 'lin') {
$this->scale = new PolarScale($rmax, $this);
$this->scale = new PolarScale($rmax, $this, $this->iClockwise);
} elseif ($aScale == 'log') {
$this->scale = new PolarLogScale($rmax, $this);
$this->scale = new PolarLogScale($rmax, $this, $this->iClockwise);
} else {
JpGraphError::RaiseL(17004);//('Unknown scale type for polar graph. Must be "lin" or "log"');
}
@ -772,9 +813,9 @@ class PolarGraph extends Graph
public function Stroke($aStrokeFileName="")
{
// Start by adjusting the margin so that potential titles will fit.
// Start by adjusting the margin so that potential titles will fit.
$this->AdjustMarginsForTitles();
// If the filename is the predefined value = '_csim_special_'
// we assume that the call to stroke only needs to do enough
// to correctly generate the CSIM maps.
@ -833,7 +874,6 @@ class PolarGraph extends Graph
$pos = $this->img->plotheight/2 + $this->img->top_margin;
}
if (!$_csim) {
$this->StrokePlotArea();
}
@ -868,16 +908,21 @@ class PolarGraph extends Graph
$this->img->plotheight+1
);
} elseif ($this->img->a == 90) {
$adj = round(($this->img->height - $this->img->width)/2);
$adj1 = round(($this->img->height - $this->img->width)/2);
$adj2 = round(($this->img->width - $this->img->height)/2);
$lm = $this->img->left_margin;
$rm = $this->img->right_margin;
$tm = $this->img->top_margin;
$bm = $this->img->bottom_margin;
$this->img->CopyCanvasH(
$oldimage,
$this->img->img,
$this->img->bottom_margin-$adj,
$this->img->left_margin+$adj,
$this->img->bottom_margin-$adj,
$this->img->left_margin+$adj,
$this->img->plotheight,
$this->img->plotwidth
$adj2 + round(($lm-$rm+$tm+$bm)/2),
$adj1 + round(($tm-$bm+$lm+$rm)/2),
$adj2 + round(($lm-$rm+$tm+$bm)/2),
$adj1 + round(($tm-$bm+$lm+$rm)/2),
$this->img->plotheight+1,
$this->img->plotwidth+1
);
}
$this->img->Destroy();
@ -908,12 +953,12 @@ class PolarGraph extends Graph
if (!$_csim) {
$this->StrokeTexts();
$this->img->SetAngle($aa);
// Draw an outline around the image map
if (_JPG_DEBUG) {
$this->DisplayClientSideaImageMapAreas();
}
// If the filename is given as the special "__handle"
// then the image handler is returned and the image is NOT
// streamed back
@ -921,12 +966,7 @@ class PolarGraph extends Graph
return $this->img->img;
} else {
// Finally stream the generated picture
$this->cache->PutAndStream(
$this->img,
$this->cache_name,
$this->inline,
$aStrokeFileName
);
$this->cache->PutAndStream($this->img, $this->cache_name, $this->inline, $aStrokeFileName);
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,13 +1,13 @@
<?php
/*=======================================================================
// File: JPGRAPH_REGSTAT.PHP
// Description: Regression and statistical analysis helper classes
// Created: 2002-12-01
// Ver: $Id: jpgraph_regstat.php 781 2006-10-08 08:07:47Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
// 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
@ -20,10 +20,10 @@ class Spline
private $xdata;
private $ydata; // Data vectors
private $y2; // 2:nd derivate of ydata
private $y2; // 2:nd derivate of ydata
private $n=0;
public function Spline($xdata, $ydata)
public function __construct($xdata, $ydata)
{
$this->y2 = array();
$this->xdata = $xdata;
@ -52,7 +52,7 @@ class Spline
$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]);
($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;
}
@ -106,7 +106,7 @@ class Spline
$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;
(($a*$a*$a-$a)*$this->y2[$min]+($b*$b*$b-$b)*$this->y2[$max])*($h*$h)/6.0;
}
}
@ -121,13 +121,13 @@ class Bezier
* @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/
* http://local.wasp.uwa.edu.au/~pbourke/geometry/bezier/index2.html
*/
private $datax = array();
private $datay = array();
private $n=0;
public function Bezier($datax, $datay, $attraction_factor = 1)
public function __construct($datax, $datay, $attraction_factor = 1)
{
// Adding control point multiple time will raise their attraction power over the curve
$this->n = count($datax);
@ -150,22 +150,35 @@ class Bezier
$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)
*/
public 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[$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)
*/
public function GetPoint($mu)
{
$n = $this->n - 1;

View file

@ -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;
public 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.
public 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
public 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
public 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)
public 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.
public 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

View file

@ -1,13 +1,13 @@
<?php
/*=======================================================================
// File: JPGRAPH_SCATTER.PHP
// Description: Scatter (and impuls) plot extension for JpGraph
// Created: 2001-02-11
// Ver: $Id: jpgraph_scatter.php 957 2007-12-01 14:00:29Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
// 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');
//===================================================
@ -20,9 +20,11 @@ class FieldArrow
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));
public function FieldArrow()
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)
);
public function __construct()
{
// Empty
}
public function SetSize($aSize, $aArrowSize=2)
@ -70,8 +72,8 @@ class FieldPlot extends Plot
public $arrow = '';
private $iAngles = array();
private $iCallback = '';
public function FieldPlot($datay, $datax, $angles)
public function __construct($datay, $datax, $angles)
{
if ((count($datax) != count($datay))) {
JpGraphError::RaiseL(20001);
@ -79,10 +81,10 @@ class FieldPlot extends Plot
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);
parent::__construct($datay, $datax);
$this->value->SetAlign('center', 'center');
$this->value->SetMargin(15);
@ -97,7 +99,7 @@ class FieldPlot extends Plot
public function Stroke($img, $xscale, $yscale)
{
// Remeber base color and size
// Remeber base color and size
$bc = $this->arrow->iColor;
$bs = $this->arrow->iSize;
$bas = $this->arrow->iArrowSize;
@ -132,7 +134,7 @@ class FieldPlot extends Plot
$this->value->Stroke($img, $this->coords[0][$i], $xt, $yt);
}
}
// Framework function
public function Legend($aGraph)
{
@ -156,24 +158,24 @@ class FieldPlot extends Plot
//===================================================
class ScatterPlot extends Plot
{
public $mark = '';
public $mark;
public $link;
private $impuls = false;
private $linkpoints = false;
private $linkpointweight=1;
private $linkpointcolor="black";
//---------------
// CONSTRUCTOR
public function ScatterPlot($datay, $datax=false)
public function __construct($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);
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;
}
//---------------
@ -183,12 +185,18 @@ class ScatterPlot extends Plot
$this->impuls = $f;
}
// Combine the scatter plot points with a line
public function SetLinkPoints($aFlag=true, $aColor="black", $aWeight=1)
public function SetStem($f=true)
{
$this->linkpoints=$aFlag;
$this->linkpointcolor=$aColor;
$this->linkpointweight=$aWeight;
$this->impuls = $f;
}
// Combine the scatter plot points with a line
public 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;
}
public function Stroke($img, $xscale, $yscale)
@ -199,11 +207,11 @@ class ScatterPlot extends Plot
} else {
$yzero=$yscale->scale_abs[0];
}
$this->csimareas = '';
for ($i=0; $i<$this->numpoints; ++$i) {
// Skip null values
// Skip null values
if ($this->coords[0][$i]==='' || $this->coords[0][$i]==='-' || $this->coords[0][$i]==='x') {
continue;
}
@ -216,10 +224,12 @@ class ScatterPlot extends Plot
$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->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) {
@ -227,7 +237,7 @@ class ScatterPlot extends Plot
$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]);
@ -236,7 +246,7 @@ class ScatterPlot extends Plot
}
$this->mark->SetCSIMAlt($this->csimalts[$i]);
}
if (isset($this->coords[1])) {
$this->mark->SetCSIMAltVal($this->coords[0][$i], $this->coords[1][$i]);
} else {
@ -244,7 +254,7 @@ class ScatterPlot extends Plot
}
$this->mark->Stroke($img, $xt, $yt);
$this->csimareas .= $this->mark->GetCSIMAreas();
$this->value->Stroke($img, $this->coords[0][$i], $xt, $yt);
@ -252,7 +262,7 @@ class ScatterPlot extends Plot
$yt_old = $yt;
}
}
// Framework function
public function Legend($aGraph)
{

View file

@ -1,13 +1,13 @@
<?php
/*=======================================================================
// File: JPGRAPH_STOCK.PHP
// Description: Stock plot extension for JpGraph
// Created: 2003-01-27
// Ver: $Id: jpgraph_stock.php 957 2007-12-01 14:00:29Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
// 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
@ -22,18 +22,18 @@ class StockPlot extends Plot
private $iStockColor3='darkred';
//---------------
// CONSTRUCTOR
public function StockPlot($datay, $datax=false)
public 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.');
}
$this->Plot($datay, $datax);
parent::__construct($datay, $datax);
$this->numpoints /= $this->iTupleSize;
}
//---------------
// PUBLIC METHODS
public function SetColor($aColor, $aColor1='white', $aColor2='darkred', $aColor3='darkred')
{
$this->color = $aColor;
@ -67,7 +67,7 @@ class StockPlot extends Plot
$graph->xaxis->scale->ticks->SetXLabelOffset($a);
$graph->SetTextScaleOff($b);
}
// Method description
public function Stroke($img, $xscale, $yscale)
{
@ -78,9 +78,8 @@ class StockPlot extends Plot
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 {
// ("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 {
@ -92,23 +91,26 @@ class StockPlot extends Plot
} 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) {
//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]);
@ -131,7 +133,7 @@ class StockPlot extends Plot
} else {
$img->SetColor($this->color);
}
$img->Rectangle($xl, $yopen, $xr, $yclose);
if ($yopen < $yclose) {
@ -157,8 +159,8 @@ class StockPlot extends Plot
// Setup image maps
if (!empty($this->csimtargets[$i])) {
$this->csimareas.= '<area shape="rect" coords="'.
round($xl).','.round($ytop).','.
round($xr).','.round($ybottom).'" ';
round($xl).','.round($ytop).','.
round($xr).','.round($ybottom).'" ';
$this->csimareas .= ' href="'.$this->csimtargets[$i].'"';
if (!empty($this->csimalts[$i])) {
$sval=$this->csimalts[$i];
@ -183,10 +185,11 @@ class BoxPlot extends StockPlot
{
private $iPColor='black';
private $iNColor='white';
public function BoxPlot($datay, $datax=false)
public function __construct($datay, $datax=false)
{
$this->iTupleSize=5;
parent::StockPlot($datay, $datax);
parent::__construct($datay, $datax);
}
public function SetMedianColor($aPos, $aNeg)
@ -202,7 +205,7 @@ class BoxPlot extends StockPlot
} else {
$img->SetColor($this->iPColor);
}
$y = $yscale->Translate($this->coords[0][$i*5+4]);
$img->Line($xl, $y, $xr, $y);
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,387 @@
<?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;
public $y=0;
public $halign="left";
public $valign="top";
public $color=array(0,0,0);
public $hide=false;
public $dir=0;
public $iScalePosY=null;
public $iScalePosX=null;
public $iWordwrap=0;
public $font_family=FF_DEFAULT;
public $font_style=FS_NORMAL; // old. FF_FONT1
protected $boxed=false; // Should the text be boxed
protected $paragraph_align="left";
protected $icornerradius=0;
protected $ishadowwidth=3;
protected $fcolor='white';
protected $bcolor='black';
protected $shadow=false;
protected $iCSIMarea='';
protected $iCSIMalt='';
protected $iCSIMtarget='';
protected $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
public 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
public function Set($aTxt)
{
$this->t = $aTxt;
}
// Alias for Pos()
public 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;
}
public function SetScalePos($aX, $aY)
{
$this->iScalePosX = $aX;
$this->iScalePosY = $aY;
}
// Specify alignment for the text
public function Align($aHAlign, $aVAlign="top", $aParagraphAlign="")
{
$this->halign = $aHAlign;
$this->valign = $aVAlign;
if ($aParagraphAlign != "") {
$this->paragraph_align = $aParagraphAlign;
}
}
// Alias
public function SetAlign($aHAlign, $aVAlign="top", $aParagraphAlign="")
{
$this->Align($aHAlign, $aVAlign, $aParagraphAlign);
}
// Specifies the alignment for a multi line text
public function ParagraphAlign($aAlign)
{
$this->paragraph_align = $aAlign;
}
// Specifies the alignment for a multi line text
public function SetParagraphAlign($aAlign)
{
$this->paragraph_align = $aAlign;
}
public function SetShadow($aShadowColor='gray', $aShadowWidth=3)
{
$this->ishadowwidth=$aShadowWidth;
$this->shadow=$aShadowColor;
$this->boxed=true;
}
public 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.
public 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;
}
public 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
public 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
public function Show($aShow=true)
{
$this->hide=!$aShow;
}
// Specify font
public 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
public 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
public function SetColor($aColor)
{
$this->color = $aColor;
}
public function SetAngle($aAngle)
{
$this->SetOrientation($aAngle);
}
// Orientation of text. Note only TTF fonts can have an arbitrary angle
public 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
public 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
public function GetFontHeight($aImg)
{
$aImg->SetFont($this->font_family, $this->font_style, $this->raw_font_size);
$h = $aImg->GetFontHeight();
return $h;
}
public function GetTextHeight($aImg)
{
$aImg->SetFont($this->font_family, $this->font_style, $this->raw_font_size);
$h = $aImg->GetTextHeight($this->t, $this->dir);
return $h;
}
public 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.
public function SetMargin($aMarg)
{
$this->margin = $aMarg;
}
public 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))
);
}
}
public function SetCSIMTarget($aURITarget, $aAlt='', $aWinTarget='')
{
$this->iCSIMtarget = $aURITarget;
$this->iCSIMalt = $aAlt;
$this->iCSIMWinTarget = $aWinTarget;
}
public function GetCSIMareas()
{
if ($this->iCSIMtarget !== '') {
return $this->iCSIMarea;
} else {
return '';
}
}
// Display text in image
public 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);
}
public 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);
}
}
public function __set($name, $value)
{
$this->{'_'.$name} = $value;
}
} // Class

View file

@ -0,0 +1,139 @@
<?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;
public function __construct()
{
$this->color_index = 0;
}
/**
*
*/
abstract public function GetColorList();
/**
*
*/
abstract public function ApplyPlot($plot);
/**
*
*/
public function SetupPlot($plot)
{
if (is_array($plot)) {
foreach ($plot as $obj) {
$this->ApplyPlot($obj);
}
} else {
$this->ApplyPlot($plot);
}
}
/**
*
*/
public 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.
}
}
/**
*
*/
public function PreStrokeApply($graph)
{
}
/**
*
*/
public 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;
}
/**
*
*/
public 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

View file

@ -1,69 +1,153 @@
<?php
//=======================================================================
// File: jpgraph_ttf.inc.php
// Description: Handling of TTF fonts
// Created: 2006-11-19
// Ver: $Id: jpgraph_ttf.inc.php 805 2006-11-28 07:45:54Z ljp $
// 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) Aditus Consulting. All rights reserved.
// 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);
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);
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", 31);
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);
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);
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", 50); // This font is also known as Bauer (Used for gauge fascia)
DEFINE("FF_DIGITAL", 51); // Digital readout font
DEFINE("FF_COMPUTER", 52); // The classic computer font
DEFINE("FF_CALCULATOR", 53); // Triad font
// 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", 53);
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);
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);
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
@ -103,7 +187,7 @@ class LanguageConv
$this->g2312 = new GB2312toUTF8();
}
return $this->g2312->gb2utf8($aTxt);
} elseif ($aFF === FF_CHINESE) {
} 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).');
@ -186,125 +270,198 @@ class TTF
private $font_files;
private $style_names;
//---------------
// CONSTRUCTOR
public function TTF()
public 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');
// 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 =>'' ) ,
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_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 =>'' ),
FF_MINCHO => array(FS_NORMAL =>PMINCHO_TTF_FONT,
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
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_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_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 =>'' ),
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' ),
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 =>'' ),
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 =>'' ),
);
}
@ -317,24 +474,166 @@ class TTF
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/");
}
$f = @$fam[$style];
$ff = @$fam[$style];
if ($f==='') {
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 (!$f) {
JpGraphError::RaiseL(25048, $fam);//("Unknown font style specification [$fam].");
// 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);
}
if ($family >= FF_MINCHO && $family <= FF_PGOTHIC) {
$f = MBTTF_DIR.$f;
} else {
$f = TTF_DIR.$f;
$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($f) === false || is_readable($f) === false) {
JpGraphError::RaiseL(25049, $f);//("Font file \"$f\" is not readable or does not exist.");
if (!file_exists($font_file)) {
JpGraphError::RaiseL(25049, $font_file);//("Font file \"$font_file\" is not readable or does not exist.");
}
return $f;
return $font_file;
}
public function SetUserFont($aNormal, $aBold='', $aItalic='', $aBoldIt='')
{
$this->font_files[FF_USERFONT] =
array(FS_NORMAL => $aNormal,
FS_BOLD => $aBold,
FS_ITALIC => $aItalic,
FS_BOLDITALIC => $aBoldIt ) ;
}
public function SetUserFont1($aNormal, $aBold='', $aItalic='', $aBoldIt='')
{
$this->font_files[FF_USERFONT1] =
array(FS_NORMAL => $aNormal,
FS_BOLD => $aBold,
FS_ITALIC => $aItalic,
FS_BOLDITALIC => $aBoldIt ) ;
}
public function SetUserFont2($aNormal, $aBold='', $aItalic='', $aBoldIt='')
{
$this->font_files[FF_USERFONT2] =
array(FS_NORMAL => $aNormal,
FS_BOLD => $aBold,
FS_ITALIC => $aItalic,
FS_BOLDITALIC => $aBoldIt ) ;
}
public 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
{
public 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 '';
}
}
}

View file

@ -1,13 +1,13 @@
<?php
/*=======================================================================
// File: JPGRAPH_UTILS.INC
// Description: Collection of non-essential "nice to have" utilities
// Created: 2005-11-20
// Ver: $Id: jpgraph_utils.inc.php 957 2007-12-01 14:00:29Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
*/
// 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
@ -21,13 +21,13 @@ class FuncGenerator
private $iMin;
private $iMax;
private $iStepSize;
public function FuncGenerator($aFunc, $aXFunc='')
public function __construct($aFunc, $aXFunc='')
{
$this->iFunc = $aFunc;
$this->iXFunc = $aXFunc;
}
public function E($aXMin, $aXMax, $aSteps=50)
{
$this->iMin = $aXMin;
@ -41,370 +41,294 @@ class FuncGenerator
} 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
{
public 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 */
);
$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_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
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 $iMin=0;
public $iMax=0;
public static $iMin=0;
public static $iMax=0;
private $starthour;
private $startmonth;
private $startday;
private $startyear;
private $endmonth;
private $endyear;
private $endday;
private $tickPositions=array();
private $minTickPositions=array();
private $iUseWeeks = true;
private static $starthour;
private static $startmonth;
private static $startday;
private static $startyear;
private static $endmonth;
private static $endyear;
private static $endday;
private static $tickPositions=array();
private static $minTickPositions=array();
private static $iUseWeeks = true;
public function UseWeekFormat($aFlg)
public static function UseWeekFormat($aFlg)
{
$this->iUseWeeks = $aFlg;
self::$iUseWeeks = $aFlg;
}
public function doYearly($aType, $aMinor=false)
public static function doYearly($aType, $aMinor=false)
{
$i=0;
$j=0;
$m = $this->startmonth;
$y = $this->startyear;
$m = self::$startmonth;
$y = self::$startyear;
if ($this->startday == 1) {
$this->tickPositions[$i++] = mktime(0, 0, 0, $m, 1, $y);
if (self::$startday == 1) {
self::$tickPositions[$i++] = mktime(0, 0, 0, $m, 1, $y);
}
++$m;
switch ($aType) {
case DSUTILS_YEAR1:
for ($y=$this->startyear; $y <= $this->endyear; ++$y) {
if ($aMinor) {
while ($m <= 12) {
if (!($y == $this->endyear && $m > $this->endmonth)) {
$this->minTickPositions[$j++] = mktime(0, 0, 0, $m, 1, $y);
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;
}
++$m;
self::$tickPositions[$i++] = mktime(0, 0, 0, 1, 1, $y);
}
$m=1;
}
$this->tickPositions[$i++] = mktime(0, 0, 0, 1, 1, $y);
}
break;
case DSUTILS_YEAR2:
$y=$this->startyear;
while ($y <= $this->endyear) {
$this->tickPositions[$i++] = mktime(0, 0, 0, 1, 1, $y);
for ($k=0; $k < 1; ++$k) {
++$y;
if ($aMinor) {
$this->minTickPositions[$j++] = 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;
}
}
++$y;
}
break;
case DSUTILS_YEAR5:
$y=$this->startyear;
while ($y <= $this->endyear) {
$this->tickPositions[$i++] = mktime(0, 0, 0, 1, 1, $y);
for ($k=0; $k < 4; ++$k) {
++$y;
if ($aMinor) {
$this->minTickPositions[$j++] = mktime(0, 0, 0, 1, 1, $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;
}
}
++$y;
break;
}
break;
}
}
public function doDaily($aType, $aMinor=false)
public static function doDaily($aType, $aMinor=false)
{
$m = $this->startmonth;
$y = $this->startyear;
$d = $this->startday;
$h = $this->starthour;
$m = self::$startmonth;
$y = self::$startyear;
$d = self::$startday;
$h = self::$starthour;
$i=0;
$j=0;
if ($h == 0) {
$this->tickPositions[$i++] = mktime(0, 0, 0, $m, $d, $y);
$t = mktime(0, 0, 0, $m, $d, $y);
} else {
$t = mktime(0, 0, 0, $m, $d, $y);
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 <= $this->iMax) {
$t += 3600*24;
$this->tickPositions[$i++] = $t;
}
break;
case DSUTILS_DAY2:
while ($t <= $this->iMax) {
$t += 3600*24;
if ($aMinor) {
$this->minTickPositions[$j++] = $t;
}
$t += 3600*24;
$this->tickPositions[$i++] = $t;
}
break;
case DSUTILS_DAY4:
while ($t <= $this->iMax) {
for ($k=0; $k < 3; ++$k) {
$t += 3600*24;
if ($aMinor) {
$this->minTickPositions[$j++] = $t;
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);
}
}
}
$t += 3600*24;
$this->tickPositions[$i++] = $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;
}
break;
}
}
public function doWeekly($aType, $aMinor=false)
public static function doWeekly($aType, $aMinor=false)
{
$hpd = 3600*24;
$hpw = 3600*24*7;
// Find out week number of min date
$thursday = $this->iMin + $hpd * (3 - (date('w', $this->iMin) + 6) % 7);
$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', $this->iMin);
$daynumber = date('w', self::$iMin);
if ($daynumber == 0) {
$daynumber = 7;
}
$m = $this->startmonth;
$y = $this->startyear;
$d = $this->startday;
$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) {
$this->tickPositions[$i++] = mktime(0, 0, 0, $m, $d, $y);
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 <= $this->iMax) {
$this->tickPositions[$i++] = $t;
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) {
$this->minTickPositions[$j++] = $t;
self::$minTickPositions[$j++] = $t;
}
}
$t += $hpw;
}
}
public function doMonthly($aType, $aMinor=false)
public static function doMonthly($aType, $aMinor=false)
{
$monthcount=0;
$m = $this->startmonth;
$y = $this->startyear;
$m = self::$startmonth;
$y = self::$startyear;
$i=0;
$j=0;
// Skip the first month label if it is before the startdate
if ($this->startday == 1) {
$this->tickPositions[$i++] = mktime(0, 0, 0, $m, 1, $y);
if (self::$startday == 1) {
self::$tickPositions[$i++] = mktime(0, 0, 0, $m, 1, $y);
$monthcount=1;
}
if ($aType == 1) {
if ($this->startday < 15) {
$this->minTickPositions[$j++] = mktime(0, 0, 0, $m, 15, $y);
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=$this->startyear; $y <= $this->endyear; ++$y) {
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 == $this->endyear ? $this->endmonth : 12;
$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==$this->endyear && $m==$stopmonth && $this->endday < 15)) {
$this->minTickPositions[$j++] = mktime(0, 0, 0, $m, 15, $y);
}
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;
}
}
// Major at month
// Get timestamp of first hour of first day in each month
$this->tickPositions[$i++] = mktime(0, 0, 0, $m, 1, $y);
break;
case DSUTILS_MONTH2:
if ($aMinor) {
// Set minor tick at start of each month
$this->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) {
$this->tickPositions[$i++] = mktime(0, 0, 0, $m, 1, $y);
}
break;
case DSUTILS_MONTH3:
if ($aMinor) {
// Set minor tick at start of each month
$this->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) {
$this->tickPositions[$i++] = mktime(0, 0, 0, $m, 1, $y);
}
break;
case DSUTILS_MONTH6:
if ($aMinor) {
// Set minor tick at start of each month
$this->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) {
$this->tickPositions[$i++] = mktime(0, 0, 0, $m, 1, $y);
}
break;
}
++$m;
++$monthcount;
}
@ -414,20 +338,20 @@ class DateScaleUtils
// 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 ($this->startmonth == $this->endmonth && $this->startyear == $this->endyear && $aType==1) {
$this->tickPositions[$i++] = mktime(0, 0, 0, $this->startmonth + 1, 1, $this->startyear);
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($this->tickPositions,$this->minTickPositions);
return array(self::$tickPositions,self::$minTickPositions);
}
public function GetTicks($aData, $aType=1, $aMinor=false, $aEndPoints=false)
public static function GetTicks($aData, $aType=1, $aMinor=false, $aEndPoints=false)
{
$n = count($aData);
return $this->GetTicksFromMinMax($aData[0], $aData[$n-1], $aType, $aMinor, $aEndPoints);
return self::GetTicksFromMinMax($aData[0], $aData[$n-1], $aType, $aMinor, $aEndPoints);
}
public function GetAutoTicks($aMin, $aMax, $aMaxTicks=10, $aMinor=false)
public static function GetAutoTicks($aMin, $aMax, $aMaxTicks=10, $aMinor=false)
{
$diff = $aMax - $aMin;
$spd = 3600*24;
@ -435,7 +359,7 @@ class DateScaleUtils
$spm = $spd*30;
$spy = $spd*352;
if ($this->iUseWeeks) {
if (self::$iUseWeeks) {
$w = 'W';
} else {
$w = 'd M';
@ -445,14 +369,10 @@ class DateScaleUtils
// 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')));
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);
@ -464,7 +384,7 @@ class DateScaleUtils
if ($nd/$t[3*$j] <= $aMaxTicks || $j==$n-1) {
$type = $t[3*$j+1];
$fs = $t[3*$j+2];
list($tickPositions, $minTickPositions) = $this->GetTicksFromMinMax($aMin, $aMax, $type, $aMinor);
list($tickPositions, $minTickPositions) = self::GetTicksFromMinMax($aMin, $aMax, $type, $aMinor);
return array($fs,$tickPositions,$minTickPositions,$type);
}
}
@ -472,26 +392,26 @@ class DateScaleUtils
}
}
public function GetTicksFromMinMax($aMin, $aMax, $aType, $aMinor=false, $aEndPoints=false)
public static function GetTicksFromMinMax($aMin, $aMax, $aType, $aMinor=false, $aEndPoints=false)
{
$this->starthour = date('G', $aMin);
$this->startmonth = date('n', $aMin);
$this->startday = date('j', $aMin);
$this->startyear = date('Y', $aMin);
$this->endmonth = date('n', $aMax);
$this->endyear = date('Y', $aMax);
$this->endday = date('j', $aMax);
$this->iMin = $aMin;
$this->iMax = $aMax;
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) {
$this->doMonthly($aType, $aMinor);
self::doMonthly($aType, $aMinor);
} elseif ($aType <= DSUTILS_WEEK4) {
$this->doWeekly($aType, $aMinor);
self::doWeekly($aType, $aMinor);
} elseif ($aType <= DSUTILS_DAY4) {
$this->doDaily($aType, $aMinor);
self::doDaily($aType, $aMinor);
} elseif ($aType <= DSUTILS_YEAR5) {
$this->doYearly($aType, $aMinor);
self::doYearly($aType, $aMinor);
} else {
JpGraphError::RaiseL(24003);
}
@ -505,7 +425,7 @@ class DateScaleUtils
$tickPositions[$i] = $aData[$n-1];
}
return array($this->tickPositions,$this->minTickPositions);
return array(self::$tickPositions,self::$minTickPositions);
}
}
@ -514,7 +434,6 @@ class DateScaleUtils
//=============================================================================
class ReadFileData
{
//----------------------------------------------------------------------------
// Desciption:
// Read numeric data from a file.
@ -529,7 +448,7 @@ class ReadFileData
//----------------------------------------------------------------------------
public static function FromCSV($aFile, &$aData, $aSepChar=',', $aMaxLineLength=1024)
{
$rh = fopen($aFile, 'r');
$rh = @fopen($aFile, 'r');
if ($rh === false) {
return false;
}
@ -553,4 +472,255 @@ class ReadFileData
}
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
//----------------------------------------------------------------------------
public 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
public 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
public 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);
}
public 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();
private $iy=array();
private $ib=0;
private $ia=0;
private $icalculated=false;
public $iDet=0;
public $iCorr=0;
public $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

View file

@ -1,10 +1,11 @@
<?php
/*=======================================================================
// File: DE.INC.PHP
// File: DE.INC.PHP
// Description: German language file for error messages
// Created: 2006-03-06
// Author: Timo Leopold (timo@leopold-hh.de)
// Ver: $Id: de.inc.php 993 2008-03-30 21:17:41Z ljp $
// 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)
//========================================================================
@ -17,13 +18,13 @@ $_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),
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),
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),
/*
@ -33,24 +34,25 @@ HTTP header wurden bereits gesendet.<br>Fehler in der Datei <b>%s</b> in der Zei
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),
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),
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),
3001 => array('Es ist nur möglich, entweder SetDateAlign() oder SetTimeAlign() zu benutzen, nicht beides!',0),
/*
** jpgraph_error
@ -62,9 +64,9 @@ HTTP header wurden bereits gesendet.<br>Fehler in der Datei <b>%s</b> in der Zei
** jpgraph_flags
*/
5001 => array('Unbekannte Flaggen-Größe (%d).',1),
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),
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),
@ -72,35 +74,36 @@ HTTP header wurden bereits gesendet.<br>Fehler in der Datei <b>%s</b> in der Zei
** 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),
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),
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),
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),
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),
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),
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
@ -112,107 +115,108 @@ HTTP header wurden bereits gesendet.<br>Fehler in der Datei <b>%s</b> in der Zei
** 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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
@ -222,29 +226,29 @@ HTTP header wurden bereits gesendet.<br>Fehler in der Datei <b>%s</b> in der Zei
*/
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),
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),
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),
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),
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),
/*
@ -254,69 +258,69 @@ HTTP header wurden bereits gesendet.<br>Fehler in der Datei <b>%s</b> in der Zei
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
@ -324,81 +328,94 @@ HTTP header wurden bereits gesendet.<br>Fehler in der Datei <b>%s</b> in der Zei
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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),
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
@ -409,19 +426,19 @@ HTTP header wurden bereits gesendet.<br>Fehler in der Datei <b>%s</b> in der Zei
** 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),
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),
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),
@ -429,25 +446,25 @@ HTTP header wurden bereits gesendet.<br>Fehler in der Datei <b>%s</b> in der Zei
** 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),
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),
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),
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),
/*
@ -455,7 +472,7 @@ HTTP header wurden bereits gesendet.<br>Fehler in der Datei <b>%s</b> in der Zei
*/
13001 => array('Unbekannter Nadeltypstil (%d).',1),
13002 => array('Ein Wert für das Odometer (%f) ist außerhalb des angegebenen Bereichs [%f,%f]',3),
13002 => array('Ein Wert für das Odometer (%f) ist außerhalb des angegebenen Bereichs [%f,%f]',3),
/*
** jpgraph_barcode
@ -463,36 +480,71 @@ HTTP header wurden bereits gesendet.<br>Fehler in der Datei <b>%s</b> in der Zei
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),
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),
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),
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),
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),
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),
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),
);

View file

@ -1,11 +1,11 @@
<?php
/*=======================================================================
// File: EN.INC.PHP
// File: EN.INC.PHP
// Description: English language file for error messages
// Created: 2006-01-25
// Ver: $Id: en.inc.php 993 2008-03-30 21:17:41Z ljp $
// Created: 2006-01-25
// Ver: $Id: en.inc.php 1886 2009-10-01 23:30:16Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
*/
@ -15,7 +15,7 @@ $_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 style="color:darkred; font-size:1.2em;"><b>JpGraph Error:</b>
10 => array('<table border="1"><tr><td style="color:darkred; font-size:1.2em;"><b>JpGraph Error:</b>
HTTP headers have already been sent.<br>Caused by output from file <b>%s</b> at line <b>%d</b>.</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),
/*
@ -44,6 +44,7 @@ HTTP headers have already been sent.<br>Caused by output from file <b>%s</b> at
2012 => array('One of the objects submitted to AccBar is not a BarPlot. Make sure that you create the AccBar plot from an array of BarPlot objects. (Class=%s)',1),
2013 => array('You have specified an empty array for shadow colors in the bar plot.',0),
2014 => array('Number of datapoints for each data set in accbarplot must be the same',0),
2015 => array('Individual bar plots in an AccBarPlot or GroupBarPlot can not have specified X-coordinates',0),
/*
@ -101,6 +102,7 @@ HTTP headers have already been sent.<br>Caused by output from file <b>%s</b> at
6030 => array('Unknown arrow direction for link.',0),
6031 => array('Unknown arrow type for link.',0),
6032 => array('Internal error: Unknown path type (=%d) specified for link.',1),
6033 => array('Array of fonts must contain arrays with 3 elements, i.e. (Family, Style, Size)',0),
/*
** jpgraph_gradient
@ -185,6 +187,7 @@ HTTP headers have already been sent.<br>Caused by output from file <b>%s</b> at
15009 => array('Illegal pie plot. Sum of all data is zero for Pie Plot',0),
15010 => array('Sum of all data is 0 for Pie.',0),
15011 => array('In order to use image transformation you must include the file jpgraph_imgtrans.php in your script.',0),
15012 => array('PiePlot::SetTheme() is no longer supported. Use PieGraph::SetTheme()',0),
/*
** jpgraph_plotband
@ -255,6 +258,7 @@ HTTP headers have already been sent.<br>Caused by output from file <b>%s</b> at
24001 => array('FuncGenerator : No function specified. ',0),
24002 => array('FuncGenerator : Syntax error in function specification ',0),
24003 => array('DateScaleUtils: Unknown tick type specified in call to GetTicks()',0),
24004 => array('ReadCSV2: Column count mismatch in %s line %d',2),
/*
** jpgraph
*/
@ -398,7 +402,17 @@ HTTP headers have already been sent.<br>Caused by output from file <b>%s</b> at
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),
25133 => array('Use Graph::SetTheme() after Graph::SetScale().',0),
/*
** 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),
/*
**---------------------------------------------------------------------------------------------
@ -476,7 +490,7 @@ HTTP headers have already been sent.<br>Caused by output from file <b>%s</b> at
/*
** 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: Number of Columns must be >= 1 and <= 30',0),
26002 => array('PDF417: Error level must be between 0 and 8',0),
26003 => array('PDF417: Invalid format for input data to encode with PDF417',0),
@ -494,5 +508,36 @@ HTTP headers have already been sent.<br>Caused by output from file <b>%s</b> at
26015 => array('PDF417: Internal error. State transition table entry 0 is NULL. Entry 1 = (%s)',1),
26016 => array('PDF417: Internal error: Unrecognized state transition mode in decode.',0),
/*
** jpgraph_contour
*/
28001 => array('Third argument to Contour must be an array of colors.',0),
28002 => array('Number of colors must equal the number of isobar lines specified',0),
28003 => array('ContourPlot Internal Error: isobarHCrossing: Coloumn index too large (%d)',1),
28004 => array('ContourPlot Internal Error: isobarHCrossing: Row index too large (%d)',1),
28005 => array('ContourPlot Internal Error: isobarVCrossing: Row index too large (%d)',1),
28006 => array('ContourPlot Internal Error: isobarVCrossing: Col index too large (%d)',1),
28007 => array('ContourPlot interpolation factor is too large (>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),
);

View file

@ -4,9 +4,9 @@
// Description: Special localization file with the same error messages
// for all errors.
// Created: 2006-02-18
// Ver: $Id: prod.inc.php 993 2008-03-30 21:17:41Z ljp $
// Ver: $Id: prod.inc.php 1886 2009-10-01 23:30:16Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
// Copyright (c) Asial Corporation. All rights reserved.
//========================================================================
*/
@ -19,7 +19,7 @@ $_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>
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),
@ -75,6 +75,7 @@ HTTP headers have already been sent.<br>Caused by output from file <b>%s</b> at
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),
@ -119,6 +120,7 @@ HTTP headers have already been sent.<br>Caused by output from file <b>%s</b> at
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),
@ -147,6 +149,7 @@ HTTP headers have already been sent.<br>Caused by output from file <b>%s</b> at
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),
@ -275,6 +278,11 @@ HTTP headers have already been sent.<br>Caused by output from file <b>%s</b> at
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),
@ -320,6 +328,7 @@ HTTP headers have already been sent.<br>Caused by output from file <b>%s</b> at
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),
@ -352,4 +361,24 @@ HTTP headers have already been sent.<br>Caused by output from file <b>%s</b> at
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),
);

View file

@ -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';
public 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',
*/
);
}
public 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();
}
public 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();
}
public 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
);
}
}
public 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:
{
}
}
}
}

View file

@ -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';
public function GetColorList()
{
return array(
'#66CC00',
'#009900',
'#AAFF77',
'#559922',
'#00CC33',
'#99FF00',
'#009966',
'#00FF99',
'#99BB66',
'#33FF00',
'#DDFFBB',
'#669933',
'#BBDDCC',
'#77CCBB',
'#668833',
'#BBEE66',
);
}
public 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();
}
public 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();
}
public 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
);
}
}
public 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:
{
}
}
}
}

View file

@ -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';
public function GetColorList()
{
return array(
'#0066FF',
'#CCCCFF',
'#0000FF',
'#3366FF',
'#33CCFF',
'#660088',
'#3300FF',
'#0099FF',
'#6633FF',
'#0055EE',
'#2277EE',
'#3300FF',
'#AA00EE',
'#778899',
'#114499',
'#7744EE',
'#002288',
'#6666FF',
);
}
public 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();
}
public 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();
}
public 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
);
}
}
public 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:
{
}
}
}
}

View file

@ -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';
public function GetColorList()
{
return array(
'#FF9900',
'#FFCC00',
'#AA6600',
'#CCCC00',
'#CC6600',
'#FFFF66',
'#CCFF00',
'#CC3300',
'#669933',
'#EE7700',
'#AAEE33',
'#77AA00',
'#CCFF99',
'#FF6633',
'#885500',
'#AADD00',
'#99CC44',
'#887711',
);
}
public 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();
}
public 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();
}
public 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
);
}
}
public 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:
{
}
}
}
}

View file

@ -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';
public function GetColorList()
{
return array(
'#FFAACC',
'#AAEECC',
'#AACCFF',
'#CCAAFF',
'#EEDDFF',
'#FFCCAA',
'#CCBBDD',
'#CCFFAA',
'#C7D7C2',
'#FFEEDD',
'#FFCCEE',
'#BFECFA',
);
}
public 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();
}
public 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();
}
public 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
);
}
}
public 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:
{
}
}
}
}

View file

@ -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';
public function GetColorList()
{
return array(
'#FF0000',
'#FF99FF',
'#AA0099',
'#FF00FF',
'#FF6666',
'#FF0099',
'#FFBB88',
'#AA2211',
'#FF6699',
'#BBAA88',
'#FF2200',
'#883333',
'#EE7777',
'#EE7711',
'#FF0066',
'#DD7711',
'#AA6600',
'#EE5500',
);
}
public 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();
}
public 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();
}
public 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
);
}
}
public 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:
{
}
}
}
}

View file

@ -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';
public 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',
*/
);
}
public 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();
}
public 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();
}
public 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
);
}
}
public 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:
{
}
}
}
}

View file

@ -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';
public function GetColorList()
{
return array(
'#61a9f3',#blue
'#f381b9',#red
'#61E3A9',#green
#'#D56DE2',
'#85eD82',
'#F7b7b7',
'#CFDF49',
'#88d8f2',
'#07AF7B',
'#B9E3F9',
'#FFF3AD',
'#EF606A',
'#EC8833',
'#FFF100',
'#87C9A5',
);
}
public 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();
}
public 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();
}
public 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
);
}
}
public 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:
{
}
}
}
}

View file

@ -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';
public function GetColorList()
{
return array(
'#FFFB11',
'#005EBC',
'#9AEB67',
'#FF4A26',
'#FDFF98',
'#6B7EFF',
'#BCE02E',
'#E0642E',
'#E0D62E',
'#2E97E0',
'#02927F',
'#FF005A',
);
}
public 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();
}
public 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();
}
public 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
);
}
}
public 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:
{
}
}
}
}