Merge branch 'v2-stable' into beta

This commit is contained in:
Andre Lorbach 2009-08-14 11:21:41 +02:00
commit 535b58c6a6
17 changed files with 12042 additions and 11168 deletions

View File

@ -3,17 +3,35 @@
// File: GD_IMAGE.INC.PHP
// Description: PHP Graph Plotting library. Low level image drawing routines
// Created: 2001-01-08, refactored 2008-03-29
// Ver: $Id$
// Ver: $Id: gd_image.inc.php 1759 2009-08-01 05:07:12Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
require_once 'jpgraph_rgb.inc.php';
require_once 'jpgraph_ttf.inc.php';
//===================================================
// Line styles
define('LINESTYLE_SOLID',1);
define('LINESTYLE_DOTTED',2);
define('LINESTYLE_DASHED',3);
define('LINESTYLE_LONGDASH',4);
// The DEFAULT_GFORMAT sets the default graphic encoding format, i.e.
// PNG, JPG or GIF depending on what is installed on the target system
// in that order.
if( !DEFINED("DEFAULT_GFORMAT") ) {
define("DEFAULT_GFORMAT","auto");
}
//========================================================================
// CLASS Image
// Description: Wrapper class with some goodies to form the
// Interface to low level image drawing routines.
//===================================================
// Description: The very coor image drawing class that encapsulates all
// calls to the GD library
// Note: The class used by the library is the decendant
// class RotImage which extends the Image class with transparent
// rotation.
//=========================================================================
class Image {
public $left_margin=30,$right_margin=30,$top_margin=20,$bottom_margin=30;
public $img=null;
@ -23,25 +41,28 @@ class Image {
public $current_color,$current_color_name;
public $line_weight=1, $line_style=LINESTYLE_SOLID;
public $img_format;
public $ttf=null;
protected $expired=true;
protected $lastx=0, $lasty=0;
protected $obs_list=array();
protected $font_size=12,$font_family=FF_FONT1, $font_style=FS_NORMAL;
protected $font_file='';
protected $text_halign="left",$text_valign="bottom";
protected $ttf=null;
protected $use_anti_aliasing=false;
protected $quality=null;
protected $colorstack=array(),$colorstackidx=0;
protected $canvascolor = 'white' ;
protected $langconv = null ;
protected $iInterlace=false;
//---------------
// CONSTRUCTOR
function Image($aWidth,$aHeight,$aFormat=DEFAULT_GFORMAT,$aSetAutoMargin=true) {
function __construct($aWidth=0,$aHeight=0,$aFormat=DEFAULT_GFORMAT,$aSetAutoMargin=true) {
$this->CreateImgCanvas($aWidth,$aHeight);
if( $aSetAutoMargin )
if( $aSetAutoMargin ) {
$this->SetAutoMargin();
}
if( !$this->SetImgFormat($aFormat) ) {
JpGraphError::RaiseL(25081,$aFormat);//("JpGraph: Selected graphic format is either not supported or unknown [$aFormat]");
@ -66,34 +87,32 @@ class Image {
}
}
function GetAntiAliasing() {
return $this->use_anti_aliasing ;
}
function CreateRawCanvas($aWidth=0,$aHeight=0) {
if( $aWidth <= 1 || $aHeight <= 1 ) {
JpGraphError::RaiseL(25082,$aWidth,$aHeight);//("Illegal sizes specified for width or height when creating an image, (width=$aWidth, height=$aHeight)");
}
if( USE_TRUECOLOR ) {
$this->img = @imagecreatetruecolor($aWidth, $aHeight);
if( $this->img < 1 ) {
JpGraphError::RaiseL(25126);
//die("Can't create truecolor image. Check that you really have GD2 library installed.");
}
$this->SetAlphaBlending();
} else {
$this->img = @imagecreate($aWidth, $aHeight);
if( $this->img < 1 ) {
JpGraphError::RaiseL(25126);
//die("<b>JpGraph Error:</b> Can't create image. Check that you really have the GD library installed.");
}
}
if( $this->iInterlace ) {
imageinterlace($this->img,1);
}
if( $this->rgb != null )
if( $this->rgb != null ) {
$this->rgb->img = $this->img ;
else
}
else {
$this->rgb = new RGB($this->img);
}
}
function CloneCanvasH() {
$oldimage = $this->img;
@ -126,7 +145,7 @@ class Image {
// Set canvas color (will also be the background color for a
// a pallett image
$this->SetColor($this->canvascolor);
$this->FilledRectangle(0,0,$aWidth,$aHeight);
$this->FilledRectangle(0,0,$aWidth-1,$aHeight-1);
return $old ;
}
@ -144,8 +163,7 @@ class Image {
}
function Copy($fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth=-1,$fromHeight=-1) {
$this->CopyCanvasH($this->img,$fromImg,$toX,$toY,$fromX,$fromY,
$toWidth,$toHeight,$fromWidth,$fromHeight);
$this->CopyCanvasH($this->img,$fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth,$fromHeight);
}
function CopyMerge($fromImg,$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth=-1,$fromHeight=-1,$aMix=100) {
@ -154,17 +172,14 @@ class Image {
$toX,$toY,$fromX,$fromY,$toWidth,$toHeight,$fromWidth,$fromHeight);
}
else {
if( ($fromWidth != -1 && ($fromWidth != $toWidth)) ||
($fromHeight != -1 && ($fromHeight != $fromHeight)) ) {
if( ($fromWidth != -1 && ($fromWidth != $toWidth)) || ($fromHeight != -1 && ($fromHeight != $fromHeight)) ) {
// Create a new canvas that will hold the re-scaled original from image
if( $toWidth <= 1 || $toHeight <= 1 ) {
JpGraphError::RaiseL(25083);//('Illegal image size when copying image. Size for copied to image is 1 pixel or less.');
}
if( USE_TRUECOLOR ) {
$tmpimg = @imagecreatetruecolor($toWidth, $toHeight);
} else {
$tmpimg = @imagecreate($toWidth, $toHeight);
}
if( $tmpimg < 1 ) {
JpGraphError::RaiseL(25084);//('Failed to create temporary GD canvas. Out of memory ?');
}
@ -177,21 +192,24 @@ class Image {
}
static function GetWidth($aImg=null) {
if( $aImg === null )
if( $aImg === null ) {
$aImg = $this->img;
}
return imagesx($aImg);
}
static function GetHeight($aImg=null) {
if( $aImg === null )
if( $aImg === null ) {
$aImg = $this->img;
}
return imagesy($aImg);
}
static function CreateFromString($aStr) {
$img = imagecreatefromstring($aStr);
if( $img === false ) {
JpGraphError::RaiseL(25085);//('An image can not be created from the supplied string. It is either in a format not supported or the string is representing an corrupt image.');
JpGraphError::RaiseL(25085);
//('An image can not be created from the supplied string. It is either in a format not supported or the string is representing an corrupt image.');
}
return $img;
}
@ -211,16 +229,11 @@ class Image {
function SetAutoMargin() {
GLOBAL $gJpgBrandTiming;
$min_bm=5;
/*
if( $gJpgBrandTiming )
$min_bm=15;
*/
$lm = min(40,$this->width/7);
$rm = min(20,$this->width/10);
$tm = max(5,$this->height/7);
$bm = max($min_bm,$this->height/7);
$bm = max($min_bm,$this->height/6);
$this->SetMargin($lm,$rm,$tm,$bm);
}
@ -248,11 +261,12 @@ class Image {
// Get the specific height for a text string
function GetTextHeight($txt="",$angle=0) {
$tmp = split("\n",$txt);
$tmp = preg_split('/\n/',$txt);
$n = count($tmp);
$m=0;
for($i=0; $i< $n; ++$i)
for($i=0; $i< $n; ++$i) {
$m = max($m,strlen($tmp[$i]));
}
if( $this->font_family <= FF_FONT2+1 ) {
if( $angle==0 ) {
@ -293,7 +307,7 @@ class Image {
// Get actual width of text in absolute pixels
function GetTextWidth($txt,$angle=0) {
$tmp = split("\n",$txt);
$tmp = preg_split('/\n/',$txt);
$n = count($tmp);
if( $this->font_family <= FF_FONT2+1 ) {
@ -341,6 +355,9 @@ class Image {
$shadowcolor=false,$paragraph_align="left",
$xmarg=6,$ymarg=4,$cornerradius=0,$dropwidth=3) {
$oldx = $this->lastx;
$oldy = $this->lasty;
if( !is_numeric($dir) ) {
if( $dir=="h" ) $dir=0;
elseif( $dir=="v" ) $dir=90;
@ -361,6 +378,7 @@ class Image {
if( $this->text_halign=="right" ) $x -= $width;
elseif( $this->text_halign=="center" ) $x -= $width/2;
if( $this->text_valign=="bottom" ) $y -= $height;
elseif( $this->text_valign=="center" ) $y -= $height/2;
@ -406,6 +424,8 @@ class Image {
$this->SetTextAlign($h,$v);
$this->SetAngle($olda);
$this->lastx = $oldx;
$this->lasty = $oldy;
return $bb;
}
@ -426,17 +446,20 @@ class Image {
$fh=$this->GetFontHeight();
$w=$this->GetTextWidth($txt);
if( $this->text_halign=="right")
if( $this->text_halign=="right") {
$x -= $dir==0 ? $w : $h;
}
elseif( $this->text_halign=="center" ) {
// For center we subtract 1 pixel since this makes the middle
// be prefectly in the middle
$x -= $dir==0 ? $w/2-1 : $h/2;
}
if( $this->text_valign=="top" )
if( $this->text_valign=="top" ) {
$y += $dir==0 ? $h : $w;
elseif( $this->text_valign=="center" )
}
elseif( $this->text_valign=="center" ) {
$y += $dir==0 ? $h/2 : $w/2;
}
if( $dir==90 ) {
imagestringup($this->img,$this->font_family,$x,$y,$txt,$this->current_color);
@ -449,20 +472,18 @@ class Image {
}
}
else {
if( ereg("\n",$txt) ) {
$tmp = split("\n",$txt);
if( preg_match('/\n/',$txt) ) {
$tmp = preg_split('/\n/',$txt);
for($i=0; $i < count($tmp); ++$i) {
$w1 = $this->GetTextWidth($tmp[$i]);
if( $paragraph_align=="left" ) {
imagestring($this->img,$this->font_family,$x,$y-$h+1+$i*$fh,$tmp[$i],$this->current_color);
}
elseif( $paragraph_align=="right" ) {
imagestring($this->img,$this->font_family,$x+($w-$w1),
$y-$h+1+$i*$fh,$tmp[$i],$this->current_color);
imagestring($this->img,$this->font_family,$x+($w-$w1),$y-$h+1+$i*$fh,$tmp[$i],$this->current_color);
}
else {
imagestring($this->img,$this->font_family,$x+$w/2-$w1/2,
$y-$h+1+$i*$fh,$tmp[$i],$this->current_color);
imagestring($this->img,$this->font_family,$x+$w/2-$w1/2,$y-$h+1+$i*$fh,$tmp[$i],$this->current_color);
}
}
}
@ -518,8 +539,8 @@ class Image {
}
$bbox = $this->GetTTFBBox($aTxt,$aAngle);
if( $aAngle==0 )
return $bbox;
if( $aAngle==0 ) return $bbox;
if( $aAngle >= 0 ) {
if( $aAngle <= 90 ) { //<=0
$bbox = array($bbox[6],$bbox[1],$bbox[2],$bbox[1],
@ -581,7 +602,7 @@ class Image {
$oy=$y;
}
if( !ereg("\n",$txt) || ($dir>0 && ereg("\n",$txt)) ) {
if( !preg_match('/\n/',$txt) || ($dir>0 && preg_match('/\n/',$txt)) ) {
// Format a single line
$txt = $this->AddTxtCR($txt);
@ -594,12 +615,19 @@ class Image {
// Note to self: "topanchor" is deprecated after we changed the
// bopunding box stuff.
if( $this->text_halign=="right" || $this->text_halign=="topanchor" )
if( $this->text_halign=='right' || $this->text_halign=='topanchor' ) {
$x -= $bbox[2]-$bbox[0];
elseif( $this->text_halign=="center" ) $x -= ($bbox[2]-$bbox[0])/2;
}
elseif( $this->text_halign=='center' ) {
$x -= ($bbox[2]-$bbox[0])/2;
}
if( $this->text_valign=="top" ) $y += abs($bbox[5])+$bbox[1];
elseif( $this->text_valign=="center" ) $y -= ($bbox[5]-$bbox[1])/2;
if( $this->text_valign=='top' ) {
$y += abs($bbox[5])+$bbox[1];
}
elseif( $this->text_valign=='center' ) {
$y -= ($bbox[5]-$bbox[1])/2;
}
ImageTTFText ($this->img, $this->font_size, $dir, $x, $y,
$this->current_color,$this->font_file,$txt);
@ -608,7 +636,6 @@ class Image {
$box=@ImageTTFBBox($this->font_size,$dir,$this->font_file,$txt);
$p1 = array();
for($i=0; $i < 4; ++$i) {
$p1[] = round($box[$i*2]+$x);
$p1[] = round($box[$i*2+1]+$y);
@ -657,20 +684,23 @@ class Image {
$w=$this->GetTextWidth($txt);
$y -= $linemargin/2;
$tmp = split("\n",$txt);
$tmp = preg_split('/\n/',$txt);
$nl = count($tmp);
$h = $nl * $fh;
if( $this->text_halign=="right")
if( $this->text_halign=='right') {
$x -= $dir==0 ? $w : $h;
elseif( $this->text_halign=="center" ) {
}
elseif( $this->text_halign=='center' ) {
$x -= $dir==0 ? $w/2 : $h/2;
}
if( $this->text_valign=="top" )
if( $this->text_valign=='top' ) {
$y += $dir==0 ? $h : $w;
elseif( $this->text_valign=="center" )
}
elseif( $this->text_valign=='center' ) {
$y += $dir==0 ? $h/2 : $w/2;
}
// Here comes a tricky bit.
// Since we have to give the position for the string at the
@ -688,10 +718,10 @@ class Image {
for($i=0; $i < $nl; ++$i) {
$wl = $this->GetTextWidth($tmp[$i]);
$bbox = $this->GetTTFBBox($tmp[$i],$dir);
if( $paragraph_align=="left" ) {
if( $paragraph_align=='left' ) {
$xl = $x;
}
elseif( $paragraph_align=="right" ) {
elseif( $paragraph_align=='right' ) {
$xl = $x + ($w-$wl);
}
else {
@ -749,8 +779,9 @@ class Image {
// Do special language encoding
$txt = $this->langconv->Convert($txt,$this->font_family);
if( !is_numeric($dir) )
if( !is_numeric($dir) ) {
JpGraphError::RaiseL(25094);//(" Direction for text most be given as an angle between 0 and 90.");
}
if( $this->font_family >= FF_FONT0 && $this->font_family <= FF_FONT2+1) {
$this->_StrokeBuiltinFont($x,$y,$txt,$dir,$paragraph_align,$boundingbox,$debug);
@ -758,8 +789,9 @@ class Image {
elseif( $this->font_family >= _FIRST_FONT && $this->font_family <= _LAST_FONT) {
$this->_StrokeTTF($x,$y,$txt,$dir,$paragraph_align,$boundingbox,$debug);
}
else
else {
JpGraphError::RaiseL(25095);//(" Unknown font font family specification. ");
}
return $boundingbox;
}
@ -771,8 +803,10 @@ class Image {
$this->plotwidth=$this->width - $this->left_margin-$this->right_margin ;
$this->plotheight=$this->height - $this->top_margin-$this->bottom_margin ;
if( $this->width > 0 && $this->height > 0 ) {
if( $this->plotwidth < 0 || $this->plotheight < 0 )
JpGraphError::raise("To small plot area. ($lm,$rm,$tm,$bm : $this->plotwidth x $this->plotheight). With the given image size and margins there is to little space left for the plot. Increase the plot size or reduce the margins.");
if( $this->plotwidth < 0 || $this->plotheight < 0 ) {
JpGraphError::RaiseL(25130, $this->plotwidth, $this->plotheight);
//JpGraphError::raise("To small plot area. ($lm,$rm,$tm,$bm : $this->plotwidth x $this->plotheight). With the given image size and margins there is to little space left for the plot. Increase the plot size or reduce the margins.");
}
}
}
@ -804,16 +838,19 @@ class Image {
}
function PopColor() {
if($this->colorstackidx<1)
if( $this->colorstackidx < 1 ) {
JpGraphError::RaiseL(25098);//(" Negative Color stack index. Unmatched call to PopColor()");
}
$this->current_color=$this->colorstack[--$this->colorstackidx];
$this->current_color_name=$this->colorstack[--$this->colorstackidx];
}
function SetLineWeight($weight) {
$old = $this->line_weight;
imagesetthickness($this->img,$weight);
$this->line_weight = $weight;
return $old;
}
function SetStartPoint($x,$y) {
@ -825,19 +862,18 @@ class Image {
// GD Arc doesn't like negative angles
while( $s < 0) $s += 360;
while( $e < 0) $e += 360;
imagearc($this->img,round($cx),round($cy),round($w),round($h),
$s,$e,$this->current_color);
imagearc($this->img,round($cx),round($cy),round($w),round($h),$s,$e,$this->current_color);
}
function FilledArc($xc,$yc,$w,$h,$s,$e,$style='') {
$s = round($s);
$e = round($e);
while( $s < 0 ) $s += 360;
while( $e < 0 ) $e += 360;
if( $style=='' )
$style=IMG_ARC_PIE;
if( abs($s-$e) > 0.001 ) {
imagefilledarc($this->img,round($xc),round($yc),round($w),round($h),
round($s),round($e),$this->current_color,$style);
if( abs($s-$e) > 0 ) {
imagefilledarc($this->img,round($xc),round($yc),round($w),round($h),$s,$e,$this->current_color,$style);
}
}
@ -897,15 +933,18 @@ class Image {
// Set line style dashed, dotted etc
function SetLineStyle($s) {
if( is_numeric($s) ) {
if( $s<1 || $s>4 )
if( $s<1 || $s>4 ) {
JpGraphError::RaiseL(25101,$s);//(" Illegal numeric argument to SetLineStyle(): ($s)");
}
}
elseif( is_string($s) ) {
if( $s == "solid" ) $s=1;
elseif( $s == "dotted" ) $s=2;
elseif( $s == "dashed" ) $s=3;
elseif( $s == "longdashed" ) $s=4;
else JpGraphError::RaiseL(25102,$s);//(" Illegal string argument to SetLineStyle(): $s");
else {
JpGraphError::RaiseL(25102,$s);//(" Illegal string argument to SetLineStyle(): $s");
}
}
else {
JpGraphError::RaiseL(25103,$s);//(" Illegal argument to SetLineStyle $s");
@ -917,8 +956,7 @@ class Image {
// Same as Line but take the line_style into account
function StyleLine($x1,$y1,$x2,$y2,$aStyle='') {
if( $this->line_weight <= 0 )
return;
if( $this->line_weight <= 0 ) return;
if( $aStyle === '' ) {
$aStyle = $this->line_style;
@ -927,10 +965,20 @@ class Image {
// Add error check since dashed line will only work if anti-alias is disabled
// this is a limitation in GD
switch( $aStyle ) {
case 1:// Solid
if( $aStyle == 1 ) {
// Solid style. We can handle anti-aliasing for this
$this->Line($x1,$y1,$x2,$y2);
break;
}
else {
// Since the GD routines doesn't handle AA for styled line
// we have no option than to turn it off to get any lines at
// all if the weight > 1
$oldaa = $this->GetAntiAliasing();
if( $oldaa && $this->line_weight > 1 ) {
$this->SetAntiAliasing(false);
}
switch( $aStyle ) {
case 2: // Dotted
$this->DashedLine($x1,$y1,$x2,$y2,2,6);
break;
@ -944,12 +992,15 @@ class Image {
JpGraphError::RaiseL(25104,$this->line_style);//(" Unknown line style: $this->line_style ");
break;
}
if( $oldaa ) {
$this->SetAntiAliasing(true);
}
}
}
function DashedLine($x1,$y1,$x2,$y2,$dash_length=1,$dash_space=4) {
if( $this->line_weight <= 0 )
return;
if( $this->line_weight <= 0 ) return;
// Add error check to make sure anti-alias is not enabled.
// Dashed line does not work with anti-alias enabled. This
@ -968,13 +1019,13 @@ class Image {
$style = array_pad($style,$dash_space,IMG_COLOR_TRANSPARENT);
imagesetstyle($this->img, $style);
imageline($this->img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED);
$this->lastx=$x2; $this->lasty=$y2;
$this->lastx = $x2;
$this->lasty = $y2;
}
function Line($x1,$y1,$x2,$y2) {
if( $this->line_weight <= 0 )
return;
if( $this->line_weight <= 0 ) return;
$x1 = round($x1);
$x2 = round($x2);
@ -982,13 +1033,13 @@ class Image {
$y2 = round($y2);
imageline($this->img,$x1,$y1,$x2,$y2,$this->current_color);
$this->lastx=$x2; $this->lasty=$y2;
$this->lastx=$x2;
$this->lasty=$y2;
}
function Polygon($p,$closed=FALSE,$fast=FALSE) {
if( $this->line_weight <= 0 )
return;
if( $this->line_weight <= 0 ) return;
$n=count($p);
$oldx = $p[0];
@ -1009,18 +1060,20 @@ class Image {
$oldx = $p[$i];
$oldy = $p[$i+1];
}
if( $closed )
if( $closed ) {
$this->StyleLine($oldx,$oldy,$p[0],$p[1]);
}
}
}
function FilledPolygon($pts) {
$n=count($pts);
if( $n == 0 ) {
JpGraphError::RaiseL(25105);//('NULL data specified for a filled polygon. Check that your data is not NULL.');
}
for($i=0; $i < $n; ++$i)
for($i=0; $i < $n; ++$i) {
$pts[$i] = round($pts[$i]);
}
imagefilledpolygon($this->img,$pts,count($pts)/2,$this->current_color);
}
@ -1069,8 +1122,9 @@ class Image {
$this->FilledRectangle($xl+$shadow_width,$yl-$shadow_width,$xr,$yl);
//$this->FilledRectangle($xl+$shadow_width,$yu+$shadow_width,$xr,$yl);
$this->PopColor();
if( $fcolor==false )
if( $fcolor==false ) {
$this->Rectangle($xl,$yu,$xr-$shadow_width-1,$yl-$shadow_width-1);
}
else {
$this->PushColor($fcolor);
$this->FilledRectangle($xl,$yu,$xr-$shadow_width-1,$yl-$shadow_width-1);
@ -1193,8 +1247,7 @@ class Image {
// 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( $sapi == 'cli' ) return;
// These parameters are set by headers_sent() but they might cause
// an undefined variable error unless they are initilized
@ -1230,19 +1283,22 @@ class Image {
else {
if( $aFile != "" ) {
$res = @$func($this->img,$aFile);
if( !$res )
if( !$res ) {
JpGraphError::RaiseL(25107,$aFile);//("Can't write to file '$aFile'. Check that the process running PHP has enough permission.");
}
}
else {
$res = @$func($this->img);
if( !$res )
if( !$res ) {
JpGraphError::RaiseL(25108);//("Can't stream image. This is most likely due to a faulty PHP/GD setup. Try to recompile PHP and use the built-in GD library that comes with PHP.");
}
}
}
}
// Clear resource tide up by image
// Clear resources used by image (this is normally not used since all resources are/should be
// returned when the script terminates
function Destroy() {
imagedestroy($this->img);
}
@ -1255,44 +1311,36 @@ class Image {
$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";
elseif( $supported & IMG_WBMP )
$this->img_format="wbmp";
elseif( $supported & IMG_XPM )
$this->img_format="xpm";
else
if( $supported & IMG_PNG ) $this->img_format="png";
elseif( $supported & IMG_JPG ) $this->img_format="jpeg";
elseif( $supported & IMG_GIF ) $this->img_format="gif";
elseif( $supported & IMG_WBMP ) $this->img_format="wbmp";
elseif( $supported & IMG_XPM ) $this->img_format="xpm";
else {
JpGraphError::RaiseL(25109);//("Your PHP (and GD-lib) installation does not appear to support any known graphic formats. You need to first make sure GD is compiled as a module to PHP. If you also want to use JPEG images you must get the JPEG library. Please see the PHP docs for details.");
}
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;
elseif( $aFormat=="wbmp" && !($supported & IMG_WBMP) )
$tst=false;
elseif( $aFormat=="xpm" && !($supported & IMG_XPM) )
$tst=false;
if( $aFormat=="jpeg" && !($supported & IMG_JPG) ) $tst=false;
elseif( $aFormat=="png" && !($supported & IMG_PNG) ) $tst=false;
elseif( $aFormat=="gif" && !($supported & IMG_GIF) ) $tst=false;
elseif( $aFormat=="wbmp" && !($supported & IMG_WBMP) ) $tst=false;
elseif( $aFormat=="xpm" && !($supported & IMG_XPM) ) $tst=false;
else {
$this->img_format=$aFormat;
return true;
}
}
else
else {
$tst=false;
if( !$tst )
}
if( !$tst ) {
JpGraphError::RaiseL(25110,$aFormat);//(" Your PHP installation does not support the chosen graphic format: $aFormat");
}
}
}
} // CLASS
//===================================================
@ -1305,8 +1353,8 @@ class RotImage extends Image {
public $dx=0,$dy=0,$transx=0,$transy=0;
private $m=array();
function RotImage($aWidth,$aHeight,$a=0,$aFormat=DEFAULT_GFORMAT,$aSetAutoMargin=true) {
$this->Image($aWidth,$aHeight,$aFormat,$aSetAutoMargin);
function __construct($aWidth,$aHeight,$a=0,$aFormat=DEFAULT_GFORMAT,$aSetAutoMargin=true) {
parent::__construct($aWidth,$aHeight,$aFormat,$aSetAutoMargin);
$this->dx=$this->left_margin+$this->plotwidth/2;
$this->dy=$this->top_margin+$this->plotheight/2;
$this->SetAngle($a);
@ -1437,9 +1485,10 @@ class RotImage extends Image {
if( $fast ) {
parent::Polygon($this->ArrRotate($pnts));
}
else
else {
parent::Polygon($pnts,$closed,$fast);
}
}
function FilledPolygon($pnts) {
parent::FilledPolygon($this->ArrRotate($pnts));
@ -1456,16 +1505,16 @@ class RotImage extends Image {
}
}
//===================================================
//=======================================================================
// CLASS ImgStreamCache
// Description: Handle caching of graphs to files
//===================================================
// Description: Handle caching of graphs to files. All image output goes
// through this class
//=======================================================================
class ImgStreamCache {
private $cache_dir, $img=null, $timeout=0; // Infinite timeout
private $cache_dir, $timeout=0; // Infinite timeout
//---------------
// CONSTRUCTOR
function ImgStreamCache($aImg, $aCacheDir=CACHE_DIR) {
$this->img = $aImg;
function __construct($aCacheDir=CACHE_DIR) {
$this->cache_dir = $aCacheDir;
}
@ -1482,36 +1531,44 @@ class ImgStreamCache {
// Output image to browser and also write it to the cache
function PutAndStream($aImage,$aCacheFileName,$aInline,$aStrokeFileName) {
// Some debugging code to brand the image with numbe of colors
// used
GLOBAL $gJpgBrandTiming;
if( $gJpgBrandTiming ) {
global $tim;
$t=$tim->Pop()/1000.0;
$c=$aImage->SetColor("black");
$t=sprintf(BRAND_TIME_FORMAT,round($t,3));
imagestring($this->img->img,2,5,$this->img->height-20,$t,$c);
}
// Check if we should stroke the image to an arbitrary file
// Check if we should always stroke the image to a file
if( _FORCE_IMGTOFILE ) {
$aStrokeFileName = _FORCE_IMGDIR.GenImgName();
}
if( $aStrokeFileName!="" ) {
if( $aStrokeFileName == "auto" )
if( $aStrokeFileName != '' ) {
if( $aStrokeFileName == 'auto' ) {
$aStrokeFileName = GenImgName();
}
if( file_exists($aStrokeFileName) ) {
// Delete the old file
if( !@unlink($aStrokeFileName) )
JpGraphError::RaiseL(25111,$aStrokeFileName);//(" Can't delete cached image $aStrokeFileName. Permission problem?");
// Wait for lock (to make sure no readers are trying to access the image)
$fd = fopen($aStrokeFileName,'w');
$lock = flock($fd, LOCK_EX);
// Since the image write routines only accepts a filename which must not
// exist we need to delete the old file first
if( !@unlink($aStrokeFileName) ) {
$lock = flock($fd, LOCK_UN);
JpGraphError::RaiseL(25111,$aStrokeFileName);
//(" Can't delete cached image $aStrokeFileName. Permission problem?");
}
$aImage->Stream($aStrokeFileName);
$lock = flock($fd, LOCK_UN);
fclose($fd);
}
else {
$aImage->Stream($aStrokeFileName);
}
return;
}
if( $aCacheFileName != "" && USE_CACHE) {
if( $aCacheFileName != '' && USE_CACHE) {
$aCacheFileName = $this->cache_dir . $aCacheFileName;
if( file_exists($aCacheFileName) ) {
@ -1520,45 +1577,63 @@ class ImgStreamCache {
// and the file exists and is still valid (no timeout)
// then do nothing, just return.
$diff=time()-filemtime($aCacheFileName);
if( $diff < 0 )
JpGraphError::RaiseL(25112,$aCacheFileName);//(" Cached imagefile ($aCacheFileName) has file date in the future!!");
if( $this->timeout>0 && ($diff <= $this->timeout*60) )
return;
if( $diff < 0 ) {
JpGraphError::RaiseL(25112,$aCacheFileName);
//(" Cached imagefile ($aCacheFileName) has file date in the future!!");
}
if( $this->timeout>0 && ($diff <= $this->timeout*60) ) return;
}
// Wait for lock (to make sure no readers are trying to access the image)
$fd = fopen($aCacheFileName,'w');
$lock = flock($fd, LOCK_EX);
if( !@unlink($aCacheFileName) ) {
$lock = flock($fd, LOCK_UN);
JpGraphError::RaiseL(25113,$aStrokeFileName);
//(" Can't delete cached image $aStrokeFileName. Permission problem?");
}
if( !@unlink($aCacheFileName) )
JpGraphError::RaiseL(25113,$aStrokeFileName);//(" Can't delete cached image $aStrokeFileName. Permission problem?");
$aImage->Stream($aCacheFileName);
$lock = flock($fd, LOCK_UN);
fclose($fd);
}
else {
$this->MakeDirs(dirname($aCacheFileName));
if( !is_writeable(dirname($aCacheFileName)) ) {
JpGraphError::RaiseL(25114,$aCacheFileName);//('PHP has not enough permissions to write to the cache file '.$aCacheFileName.'. Please make sure that the user running PHP has write permission for this file if you wan to use the cache system with JpGraph.');
JpGraphError::RaiseL(25114,$aCacheFileName);
//('PHP has not enough permissions to write to the cache file '.$aCacheFileName.'. Please make sure that the user running PHP has write permission for this file if you wan to use the cache system with JpGraph.');
}
$aImage->Stream($aCacheFileName);
}
$res=true;
// Set group to specified
if( CACHE_FILE_GROUP != "" )
if( CACHE_FILE_GROUP != '' ) {
$res = @chgrp($aCacheFileName,CACHE_FILE_GROUP);
if( CACHE_FILE_MOD != "" )
}
if( CACHE_FILE_MOD != '' ) {
$res = @chmod($aCacheFileName,CACHE_FILE_MOD);
if( !$res )
JpGraphError::RaiseL(25115,$aStrokeFileName);//(" Can't set permission for cached image $aStrokeFileName. Permission problem?");
}
if( !$res ) {
JpGraphError::RaiseL(25115,$aStrokeFileName);
//(" Can't set permission for cached image $aStrokeFileName. Permission problem?");
}
$aImage->Destroy();
if( $aInline ) {
if ($fh = @fopen($aCacheFileName, "rb") ) {
$this->img->Headers();
$aImage->Headers();
fpassthru($fh);
return;
}
else
else {
JpGraphError::RaiseL(25116,$aFile);//(" Cant open file from cache [$aFile]");
}
}
}
elseif( $aInline ) {
$this->img->Headers();
$aImage->Headers();
$aImage->Stream();
return;
}
@ -1567,7 +1642,7 @@ class ImgStreamCache {
// Check if a given image is in cache and in that case
// pass it directly on to web browser. Return false if the
// image file doesn't exist or exists but is to old
function GetAndStream($aCacheFileName) {
function GetAndStream($aImage,$aCacheFileName) {
$aCacheFileName = $this->cache_dir.$aCacheFileName;
if ( USE_CACHE && file_exists($aCacheFileName) && $this->timeout >= 0 ) {
$diff=time()-filemtime($aCacheFileName);
@ -1575,15 +1650,19 @@ class ImgStreamCache {
return false;
}
else {
if ($fh = @fopen($aCacheFileName, "rb")) {
$this->img->Headers();
if ($fh = @fopen($aCacheFileName, 'rb')) {
$lock = flock($fh, LOCK_SH);
$aImage->Headers();
fpassthru($fh);
$lock = flock($fh, LOCK_UN);
fclose($fh);
return true;
}
else
else {
JpGraphError::RaiseL(25117,$aCacheFileName);//(" Can't open cached image \"$aCacheFileName\" for reading.");
}
}
}
return false;
}
@ -1592,13 +1671,16 @@ class ImgStreamCache {
// Create all necessary directories in a path
function MakeDirs($aFile) {
$dirs = array();
while ( !(file_exists($aFile)) ) {
$dirs[] = $aFile;
// In order to better work when open_basedir is enabled
// we do not create directories in the root path
while ( $aFile != '/' && !(file_exists($aFile)) ) {
$dirs[] = $aFile.'/';
$aFile = dirname($aFile);
}
for ($i = sizeof($dirs)-1; $i>=0; $i--) {
if(! @mkdir($dirs[$i],0777) )
if(! @mkdir($dirs[$i],0777) ) {
JpGraphError::RaiseL(25118,$aFile);//(" Can't create directory $aFile. Make sure PHP has write permission to this directory.");
}
// We also specify mode here after we have changed group.
// This is necessary if Apache user doesn't belong the
// default group and hence can't specify group permission
@ -1607,13 +1689,13 @@ class ImgStreamCache {
$res=true;
$res =@chgrp($dirs[$i],CACHE_FILE_GROUP);
$res = @chmod($dirs[$i],0777);
if( !$res )
if( !$res ) {
JpGraphError::RaiseL(25119,$aFile);//(" Can't set permissions for $aFile. Permission problems?");
}
}
}
return true;
}
} // CLASS Cache
?>

View File

@ -3,13 +3,12 @@
// 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 $
// Ver: $Id: jpg-config.inc.php 1749 2009-07-31 10:58:41Z ljp $
//
// Copyright (c) Aditus Consulting. 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,11 +35,11 @@
// MBTTF_DIR $SERVER_SYSTEMROOT/fonts/
//
//------------------------------------------------------------------------
// DEFINE("CACHE_DIR","/tmp/jpgraph_cache/");
// DEFINE("TTF_DIR","/usr/X11R6/lib/X11/fonts/truetype/");
// define('CACHE_DIR','/tmp/jpgraph_cache/');
// define('TTF_DIR','/usr/share/fonts/truetype/');
// define('MBTTF_DIR','/usr/share/fonts/truetype/');
DEFINE("TTF_DIR", $gl_root_path . "BitstreamVeraFonts/");
// DEFINE("MBTTF_DIR","/usr/share/fonts/ja/TrueType/");
//-------------------------------------------------------------------------
// Cache directory specification for use with CSIM graphs that are
@ -53,70 +52,8 @@ DEFINE("TTF_DIR", $gl_root_path . "BitstreamVeraFonts/");
// 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
@ -126,12 +63,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.
@ -139,91 +76,57 @@ 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
// 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);
// 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)");
define('ERR_DEPRECATED',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','wwwadmin');
// 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);
// 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('USE_BRESENHAM',false);
?>

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
// 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 $
// Ver: $Id: jpgraph_bar.php 1763 2009-08-01 08:34:17Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
@ -44,8 +44,8 @@ class BarPlot extends Plot {
//---------------
// CONSTRUCTOR
function BarPlot($datay,$datax=false) {
$this->Plot($datay,$datax);
function __construct($datay,$datax=false) {
parent::__construct($datay,$datax);
++$this->numpoints;
}
@ -53,14 +53,14 @@ class BarPlot extends Plot {
// PUBLIC METHODS
// Set a drop shadow for the bar (or rather an "up-right" shadow)
function SetShadow($color="black",$hsize=3,$vsize=3,$show=true) {
$this->bar_shadow=$show;
$this->bar_shadow_color=$color;
$this->bar_shadow_vsize=$vsize;
$this->bar_shadow_hsize=$hsize;
function SetShadow($aColor="black",$aHSize=3,$aVSize=3,$aShow=true) {
$this->bar_shadow=$aShow;
$this->bar_shadow_color=$aColor;
$this->bar_shadow_vsize=$aVSize;
$this->bar_shadow_hsize=$aHSize;
// Adjust the value margin to compensate for shadow
$this->value->margin += $vsize;
$this->value->margin += $aVSize;
}
// DEPRECATED use SetYBase instead
@ -74,6 +74,20 @@ 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
function RotatePattern($aPat,$aRotate=true) {
$rotate = array(1 => 2, 2 => 1, 3 => 3, 4 => 5, 5 => 4, 6 => 6, 7 => 7, 8 => 8);
if( $aRotate ) {
return $rotate[$aPat];
}
else {
return $aPat;
}
}
function Legend($graph) {
if( $this->grad && $this->legend!="" && !$this->fill ) {
$color=array($this->grad_fromcolor,$this->grad_tocolor);
@ -83,15 +97,16 @@ 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($this->legend,$color,"",-101,
@ -143,22 +158,20 @@ 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);
}
}
}
function Min() {
$m = parent::Min();
if( $m[1] >= $this->ybase )
$m[1] = $this->ybase;
if( $m[1] >= $this->ybase ) $m[1] = $this->ybase;
return $m;
}
function Max() {
$m = parent::Max();
if( $m[1] <= $this->ybase )
$m[1] = $this->ybase;
if( $m[1] <= $this->ybase ) $m[1] = $this->ybase;
return $m;
}
@ -168,9 +181,10 @@ class BarPlot extends Plot {
// Interpret this as absolute width
$this->abswidth=$aWidth;
}
else
else {
$this->width=$aWidth;
}
}
// Specify width in absolute pixels. If specified this
// overrides SetWidth()
@ -189,8 +203,14 @@ class BarPlot extends Plot {
}
function SetFillColor($aColor) {
// Do an extra error check if the color is specified as an RG array triple
// In that case convert it to a hex string since it will otherwise be
// interpretated as an array of colors for each individual bar.
$aColor = RGB::tryHexConversion($aColor);
$this->fill = true ;
$this->fill_color=$aColor;
}
function SetFillGradient($aFromColor,$aToColor=null,$aStyle=null) {
@ -212,11 +232,12 @@ 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
else {
$this->iPatternColor = $aColor;
}
for( $i=0; $i < $n; ++$i ) {
$this->_SetPatternHelper($aPattern[$i], $this->iPattern[$i], $this->iPatternDensity[$i]);
if( is_array($aColor) ) {
@ -234,19 +255,19 @@ class BarPlot extends Plot {
switch( $aPattern ) {
case PATTERN_DIAG1:
$aPatternValue= 1;
$aDensity = 90;
$aDensity = 92;
break;
case PATTERN_DIAG2:
$aPatternValue= 1;
$aDensity = 75;
$aDensity = 78;
break;
case PATTERN_DIAG3:
$aPatternValue= 2;
$aDensity = 90;
$aDensity = 92;
break;
case PATTERN_DIAG4:
$aPatternValue= 2;
$aDensity = 75;
$aDensity = 78;
break;
case PATTERN_CROSS1:
$aPatternValue= 8;
@ -266,14 +287,15 @@ class BarPlot extends Plot {
break;
case PATTERN_STRIPE1:
$aPatternValue= 5;
$aDensity = 90;
$aDensity = 94;
break;
case PATTERN_STRIPE2:
$aPatternValue= 5;
$aDensity = 75;
$aDensity = 85;
break;
default:
JpGraphError::Raise('Unknown pattern specified in call to BarPlot::SetPattern()');
JpGraphError::RaiseL(2002);
//('Unknown pattern specified in call to BarPlot::SetPattern()');
}
}
@ -281,13 +303,17 @@ 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");
else
if( count($this->coords[1])!=$numpoints ) {
JpGraphError::RaiseL(2003,count($this->coords[1]),$numpoints);
//"Number of X and Y points are not equal. Number of X-points:".count($this->coords[1])."Number of Y-points:$numpoints");
}
else {
$exist_x = true;
}
else
}
else {
$exist_x = false;
}
$numbars=count($this->coords[0]);
@ -304,8 +330,9 @@ class BarPlot extends Plot {
if( $this->abswidth > -1 ) {
$abswidth=$this->abswidth;
}
else
else {
$abswidth=round($this->width*$xscale->scale_factor,0);
}
// Count pontetial pattern array to avoid doing the count for each iteration
if( is_array($this->iPattern) ) {
@ -319,8 +346,12 @@ class BarPlot extends Plot {
if ($this->coords[0][$i] === null || $this->coords[0][$i] === '' )
continue;
if( $exist_x ) $x=$this->coords[1][$i];
else $x=$i;
if( $exist_x ) {
$x=$this->coords[1][$i];
}
else {
$x=$i;
}
$x=$xscale->Translate($x);
@ -341,8 +372,9 @@ class BarPlot extends Plot {
$x+$abswidth,$yscale->Translate($this->coords[0][$i]),
$x+$abswidth,$zp);
if( $this->grad ) {
if( $grad === null )
if( $grad === null ) {
$grad = new Gradient($img);
}
if( is_array($this->grad_fromcolor) ) {
// The first argument (grad_fromcolor) can be either an array or a single color. If it is an array
// then we have two choices. It can either a) be a single color specified as an RGB triple or it can be
@ -388,7 +420,8 @@ class BarPlot extends Plot {
$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
@ -416,7 +449,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]);
}
@ -433,8 +466,9 @@ class BarPlot extends Plot {
if( is_array($this->iPatternColor) ) {
$pcolor = $this->iPatternColor[$i % $np];
}
else
else {
$pcolor = $this->iPatternColor;
}
$prect = $f->Create($this->iPattern[$i % $np],$pcolor,1);
$prect->SetDensity($this->iPatternDensity[$i % $np]);
@ -470,11 +504,14 @@ class BarPlot extends Plot {
$prect->Stroke($img);
}
}
// Stroke the outline of the bar
if( is_array($this->color) )
if( is_array($this->color) ) {
$img->SetColor($this->color[$i % count($this->color)]);
else
}
else {
$img->SetColor($this->color);
}
$pts[] = $pts[0];
$pts[] = $pts[1];
@ -486,13 +523,28 @@ class BarPlot extends Plot {
// Determine how to best position the values of the individual bars
$x=$pts[2]+($pts[4]-$pts[2])/2;
$this->value->SetMargin(5);
if( $this->valuepos=='top' ) {
$y=$pts[3];
if( $img->a === 90 ) {
if( $val < 0 )
if( $val < 0 ) {
$this->value->SetAlign('right','center');
else
}
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);
@ -505,10 +557,15 @@ class BarPlot extends Plot {
else
$this->value->SetAlign('right','center');
}
else {
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' ) {
@ -529,7 +586,8 @@ class BarPlot extends Plot {
$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);
@ -570,11 +628,11 @@ class GroupBarPlot extends BarPlot {
$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;
@ -588,7 +646,8 @@ 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);
}
@ -655,17 +714,30 @@ class AccBarPlot extends BarPlot {
private $plots=null,$nbrplots=0;
//---------------
// CONSTRUCTOR
function AccBarPlot($plots) {
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();
}
@ -677,7 +749,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);
}
@ -777,10 +850,12 @@ class AccBarPlot extends BarPlot {
$xt=$xscale->Translate($i);
if( $this->abswidth > -1 )
if( $this->abswidth > -1 ) {
$abswidth=$this->abswidth;
else
}
else {
$abswidth=round($this->width*$xscale->scale_factor,0);
}
$pts=array($xt,$accyt,$xt,$yt,$xt+$abswidth,$yt,$xt+$abswidth,$accyt);
@ -814,7 +889,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]);
}
@ -844,8 +919,7 @@ class AccBarPlot extends BarPlot {
if( $this->plots[$j]->grad ) {
$grad = new Gradient($img);
$grad->FilledRectangle(
$pts[2],$pts[3],
$grad->FilledRectangle( $pts[2],$pts[3],
$pts[6],$pts[7],
$this->plots[$j]->grad_fromcolor,
$this->plots[$j]->grad_tocolor,
@ -855,23 +929,28 @@ class AccBarPlot extends BarPlot {
$numcolors = count($this->plots[$j]->fill_color);
$fillcolor = $this->plots[$j]->fill_color[$i % $numcolors];
// If the bar is specified to be non filled then the fill color is false
if( $fillcolor !== false )
if( $fillcolor !== false ) {
$img->SetColor($this->plots[$j]->fill_color[$i % $numcolors]);
}
}
else {
$fillcolor = $this->plots[$j]->fill_color;
if( $fillcolor !== false )
if( $fillcolor !== false ) {
$img->SetColor($this->plots[$j]->fill_color);
}
if( $fillcolor !== false )
$img->FilledPolygon($pts);
$img->SetColor($this->plots[$j]->color);
}
if( $fillcolor !== false ) {
$img->FilledPolygon($pts);
}
}
$img->SetColor($this->plots[$j]->color);
// Stroke the pattern
if( $this->plots[$j]->iPattern > -1 ) {
if( $pattern===NULL )
if( $pattern===NULL ) {
$pattern = new RectPatternFactory();
}
$prect = $pattern->Create($this->plots[$j]->iPattern,$this->plots[$j]->iPatternColor,1);
$prect->SetDensity($this->plots[$j]->iPatternDensity);
@ -918,11 +997,19 @@ 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;

View File

@ -5,18 +5,25 @@
// 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 $
// Ver: $Id: jpgraph_errhandler.inc.php 1619 2009-07-16 19:15:36Z ljp $
//
// Copyright 2006 (c) Aditus Consulting. All rights reserved.
//========================================================================
if( !defined('DEFAULT_ERR_LOCALE') ) {
define('DEFAULT_ERR_LOCALE','en');
}
if( !defined('USE_IMAGE_ERROR_HANDLER') ) {
define('USE_IMAGE_ERROR_HANDLER',true);
}
GLOBAL $__jpg_err_locale ;
$__jpg_err_locale = DEFAULT_ERR_LOCALE;
class ErrMsgText {
private $lt=NULL;
function ErrMsgText() {
function __construct() {
GLOBAL $__jpg_err_locale;
$file = 'lang/'.$__jpg_err_locale.'.inc.php';
@ -92,21 +99,87 @@ class ErrMsgText {
// in all methods.
//
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) {
GLOBAL $__jpg_err_locale ;
$__jpg_err_locale = $aLoc;
}
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;
}
}
// Setup the default handler
global $__jpg_OldHandler;
$__jpg_OldHandler = set_exception_handler(array('JpGraphException','defaultHandler'));
class JpGraphException extends Exception {
// Redefine the exception so message isn't optional
public function __construct($message, $code = 0) {
// make sure everything is assigned properly
parent::__construct($message, $code);
}
// custom string representation of object
public function _toString() {
return __CLASS__ . ": [{$this->code}]: {$this->message} at " . basename($this->getFile()) . ":" . $this->getLine() . "\n" . $this->getTraceAsString() . "\n";
}
// custom representation of error as an image
public function Stroke() {
if( JpGraphError::GetImageFlag() ) {
$errobj = new JpGraphErrObjectImg();
$errobj->SetTitle(JpGraphError::GetTitle());
}
else {
$errobj = new JpGraphErrObject();
$errobj->SetTitle(JpGraphError::GetTitle());
$errobj->SetStrokeDest(JpGraphError::GetLogFile());
}
$errobj->Raise($this->getMessage());
}
static public function defaultHandler(Exception $exception) {
global $__jpg_OldHandler;
if( $exception instanceof JpGraphException ) {
$exception->Stroke();
}
else {
// Restore old handler
if( $__jpg_OldHandler !== NULL ) {
set_exception_handler($__jpg_OldHandler);
}
throw $exception;
}
}
}
class JpGraphExceptionL extends JpGraphException {
// Redefine the exception so message isn't optional
public function __construct($errcode,$a1=null,$a2=null,$a3=null,$a4=null,$a5=null) {
// make sure everything is assigned properly
$errtxt = new ErrMsgText();
parent::__construct($errtxt->Get($errcode,$a1,$a2,$a3,$a4,$a5), 0);
}
}
@ -119,11 +192,11 @@ class JpGraphError {
//=============================================================
class JpGraphErrObject {
protected $iTitle = "JpGraph Error";
protected $iTitle = "JpGraph error: ";
protected $iDest = false;
function JpGraphErrObject() {
function __construct() {
// Empty. Reserved for future use
}
@ -136,20 +209,33 @@ class JpGraphErrObject {
}
// If aHalt is true then execution can't continue. Typical used for fatal errors
function Raise($aMsg,$aHalt=true) {
$aMsg = $this->iTitle.' '.$aMsg;
if ($this->iDest) {
function Raise($aMsg,$aHalt=false) {
if( $this->iDest != '' ) {
if( $this->iDest == 'syslog' ) {
error_log($this->iTitle.$aMsg);
}
else {
$str = '['.date('r').'] '.$this->iTitle.$aMsg."\n";
$f = @fopen($this->iDest,'a');
if( $f ) {
@fwrite($f,$aMsg);
@fwrite($f,$str);
@fclose($f);
}
}
}
else {
$aMsg = $this->iTitle.$aMsg;
// Check SAPI and if we are called from the command line
// send the error to STDERR instead
if( PHP_SAPI == 'cli' ) {
fwrite(STDERR,$aMsg);
}
else {
echo $aMsg;
}
}
if( $aHalt )
die();
exit(1);
}
}
@ -158,6 +244,11 @@ class JpGraphErrObject {
//==============================================================
class JpGraphErrObjectImg extends JpGraphErrObject {
function __construct() {
parent::__construct();
// Empty. Reserved for future use
}
function Raise($aMsg,$aHalt=true) {
$img_iconerror =
'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAaV'.
@ -176,13 +267,16 @@ class JpGraphErrObjectImg extends JpGraphErrObject {
'vd69OLMddVOPCGVnmrFD8bVYd3JXfxXPtLR/+mtv59/ALWiiMx'.
'qL72fwAAAABJRU5ErkJggg==' ;
if( function_exists("imagetypes") )
$supported = imagetypes();
else
$supported = 0;
if( !function_exists('imagecreatefromstring') )
if( function_exists("imagetypes") ) {
$supported = imagetypes();
} else {
$supported = 0;
}
if( !function_exists('imagecreatefromstring') ) {
$supported = 0;
}
if( ob_get_length() || headers_sent() || !($supported & IMG_PNG) ) {
// Special case for headers already sent or that the installation doesn't support
@ -266,13 +360,8 @@ 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

@ -0,0 +1,420 @@
<?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 1739 2009-07-30 21:21:15Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
DEFINE('_DEFAULT_LPM_SIZE',8); // Default Legend Plot Mark size
//===================================================
// CLASS Legend
// Description: Responsible for drawing the box containing
// all the legend text for the graph
//===================================================
class Legend {
public $txtcol=array();
private $color=array(0,0,0); // Default fram color
private $fill_color=array(235,235,235); // Default fill color
private $shadow=true; // Shadow around legend "box"
private $shadow_color='darkgray@0.5';
private $mark_abs_hsize=_DEFAULT_LPM_SIZE,$mark_abs_vsize=_DEFAULT_LPM_SIZE;
private $xmargin=10,$ymargin=6,$shadow_width=2;
private $xlmargin=4, $ylmargin='';
private $xpos=0.05, $ypos=0.15, $xabspos=-1, $yabspos=-1;
private $halign="right", $valign="top";
private $font_family=FF_FONT1,$font_style=FS_NORMAL,$font_size=12;
private $font_color='black';
private $hide=false,$layout_n=1;
private $weight=1,$frameweight=1;
private $csimareas='';
private $reverse = false ;
//---------------
// CONSTRUCTOR
function __construct() {
// Empty
}
//---------------
// PUBLIC METHODS
function Hide($aHide=true) {
$this->hide=$aHide;
}
function SetHColMargin($aXMarg) {
$this->xmargin = $aXMarg;
}
function SetVColMargin($aSpacing) {
$this->ymargin = $aSpacing ;
}
function SetLeftMargin($aXMarg) {
$this->xlmargin = $aXMarg;
}
// Synonym
function SetLineSpacing($aSpacing) {
$this->ymargin = $aSpacing ;
}
function SetShadow($aShow='gray',$aWidth=2) {
if( is_string($aShow) ) {
$this->shadow_color = $aShow;
$this->shadow=true;
}
else
$this->shadow=$aShow;
$this->shadow_width=$aWidth;
}
function SetMarkAbsSize($aSize) {
$this->mark_abs_vsize = $aSize ;
$this->mark_abs_hsize = $aSize ;
}
function SetMarkAbsVSize($aSize) {
$this->mark_abs_vsize = $aSize ;
}
function SetMarkAbsHSize($aSize) {
$this->mark_abs_hsize = $aSize ;
}
function SetLineWeight($aWeight) {
$this->weight = $aWeight;
}
function SetFrameWeight($aWeight) {
$this->frameweight = $aWeight;
}
function SetLayout($aDirection=LEGEND_VERT) {
$this->layout_n = $aDirection==LEGEND_VERT ? 1 : 99 ;
}
function SetColumns($aCols) {
$this->layout_n = $aCols ;
}
function SetReverse($f=true) {
$this->reverse = $f ;
}
// Set color on frame around box
function SetColor($aFontColor,$aColor='black') {
$this->font_color=$aFontColor;
$this->color=$aColor;
}
function SetFont($aFamily,$aStyle=FS_NORMAL,$aSize=10) {
$this->font_family = $aFamily;
$this->font_style = $aStyle;
$this->font_size = $aSize;
}
function SetPos($aX,$aY,$aHAlign='right',$aVAlign='top') {
$this->Pos($aX,$aY,$aHAlign,$aVAlign);
}
function SetAbsPos($aX,$aY,$aHAlign='right',$aVAlign='top') {
$this->xabspos=$aX;
$this->yabspos=$aY;
$this->halign=$aHAlign;
$this->valign=$aVAlign;
}
function Pos($aX,$aY,$aHAlign='right',$aVAlign='top') {
if( !($aX<1 && $aY<1) )
JpGraphError::RaiseL(25120);//(" Position for legend must be given as percentage in range 0-1");
$this->xpos=$aX;
$this->ypos=$aY;
$this->halign=$aHAlign;
$this->valign=$aVAlign;
}
function SetFillColor($aColor) {
$this->fill_color=$aColor;
}
function Clear() {
$this->txtcol = array();
}
function Add($aTxt,$aColor,$aPlotmark='',$aLinestyle=0,$csimtarget='',$csimalt='',$csimwintarget='') {
$this->txtcol[]=array($aTxt,$aColor,$aPlotmark,$aLinestyle,$csimtarget,$csimalt,$csimwintarget);
}
function GetCSIMAreas() {
return $this->csimareas;
}
function 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->ymargin;
// 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->mark_abs_vsize/2));
//echo "Textheight:".$aImg->GetTextHeight($this->txtcol[$i][0]).', ';
//echo "h=$h ({$this->mark_abs_vsize},{$this->ymargin})<br>";
if( $i % $numcolumns == 0 ) {
$rows++;
$rowheight[$rows-1] = 0;
}
$rowheight[$rows-1] = max($rowheight[$rows-1],$h);
}
$abs_height = 0;
for( $i=0; $i < $rows; ++$i ) {
$abs_height += $rowheight[$i] ;
}
// Make sure that the height is at least as high as mark size + ymargin
// We add 1.5 y-margin to add some space at the top+bottom part of the
// legend.
$abs_height = max($abs_height,$this->mark_abs_vsize);
$abs_height += 3*$this->ymargin;
// 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] ;
}
// Find out maximum width we need for legend box
$abs_width = $mtw+$this->xlmargin;
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,
$yp+$abs_height+$this->shadow_width,
$this->fill_color,$this->shadow_width,$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);
}
// x1,y1 is the position for the legend mark
$x1=$xp+round($this->mark_abs_hsize/2)+$this->xlmargin;
$y1=$yp + $this->ymargin;
// Remember 1/2 of the font height since we need that later
// as a minimum value for correctly position the markers
$f2 = round($aImg->GetTextHeight('X')/2);
$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($xp,$y1,$xp+$abs_width,$y1+$rowheight[$row]);
}
$aImg->SetLineWeight($this->weight);
$x1 = round($x1); $y1=round($y1);
if ( !empty($p[2]) && $p[2]->GetType() > -1 ) {
// Make a plot mark legend
$aImg->SetColor($p[1]);
if( is_string($p[3]) || $p[3]>0 ) {
$aImg->SetLineStyle($p[3]);
$aImg->StyleLine($x1-$this->mark_abs_hsize,$y1+$f2,$x1+$this->mark_abs_hsize,$y1+$f2);
}
// 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,$y1+$f2);
}
else {
$p[2]->SetSize(min($this->mark_abs_vsize,$this->mark_abs_hsize));
$p[2]->Stroke($aImg,$x1,$y1+$f2);
}
}
}
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-1,$y1+$f2,$x1+$this->mark_abs_hsize,$y1+$f2);
$aImg->StyleLine($x1-1,$y1+$f2+1,$x1+$this->mark_abs_hsize,$y1+$f2+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 ;
// $y1 is the top border of the "box" we have to draw the marker
// and legend text in. We position the marker in the vertical center
// of this box
$ym = $y1 + round($rowheight[$row]/2)-round($this->mark_abs_vsize/2);
// 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,$ym,
$x1+$boxsize,$ym+$boxsize,
$color[0],$color[1],-$p[3]);
}
else {
$aImg->SetColor($p[1]);
$aImg->FilledRectangle($x1,$ym,$x1+$boxsize,$ym+$boxsize);
}
$aImg->SetColor($this->color);
$aImg->SetLineWeight($fillBoxFrameWeight);
$aImg->Rectangle($x1,$ym,$x1+$boxsize,$ym+$boxsize);
}
}
$aImg->SetColor($this->font_color);
$aImg->SetFont($this->font_family,$this->font_style,$this->font_size);
$aImg->SetTextAlign('left','center');
$aImg->StrokeText(round($x1+$this->mark_abs_hsize+$this->xmargin),
$y1+round($rowheight[$row]/2),$p[0]);
// Add CSIM for Legend if defined
if( !empty($p[4]) ) {
$xe = $x1 + $this->xmargin+$this->mark_abs_hsize+$aImg->GetTextWidth($p[0]);
$ye = $y1 + max($this->mark_abs_vsize,$aImg->GetTextHeight($p[0]));
$coords = "$x1,$y1,$xe,$y1,$xe,$ye,$x1,$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+round($this->mark_abs_hsize/2)+$this->xlmargin;
$y1 += $rowheight[$row++];
$i = 1;
}
else {
$x1 += $colwidth[($i-1) % $numcolumns] ;
++$i;
}
}
}
} // Class
?>

View File

@ -3,7 +3,7 @@
// 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 $
// Ver: $Id: jpgraph_line.php 1741 2009-07-30 22:55:19Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
@ -29,22 +29,23 @@ class LinePlot extends Plot{
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, $fillFromMax = false;
protected $fillgrad=false,$fillgrad_fromcolor='navy',$fillgrad_tocolor='silver',$fillgrad_numcolors=100;
protected $iFastStroke=false;
//---------------
// CONSTRUCTOR
function LinePlot($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
function SetFilled($aFlag=true) {
JpGraphError::RaiseL(10001);//('LinePlot::SetFilled() is deprecated. Use SetFillColor()');
function SetFilled($aFlg=true) {
$this->filled = $aFlg;
}
function SetBarCenter($aFlag=true) {
@ -67,7 +68,12 @@ class LinePlot extends Plot{
$this->fillFromMin = $f ;
}
function SetFillFromYMax($f=true) {
$this->fillFromMax = $f ;
}
function SetFillColor($aColor,$aFilled=true) {
$this->color = $aColor;
$this->fill_color=$aColor;
$this->filled=$aFilled;
}
@ -117,8 +123,7 @@ class LinePlot extends Plot{
// 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; $b=0.5;
@ -140,17 +145,23 @@ class LinePlot extends Plot{
// features but 60% faster. You can't have values or line styles, or null
// values in plots.
$numpoints=count($this->coords[0]);
if( $this->barcenter )
if( $this->barcenter ) {
$textadj = 0.5-$xscale->text_scale_off;
else
}
else {
$textadj = 0;
}
$img->SetColor($this->color);
$img->SetLineWeight($this->weight);
$pnts=$aStartPoint;
while( $pnts < $numpoints ) {
if( $exist_x ) $x=$this->coords[1][$pnts];
else $x=$pnts+$textadj;
if( $exist_x ) {
$x=$this->coords[1][$pnts];
}
else {
$x=$pnts+$textadj;
}
$xt = $xscale->Translate($x);
$y=$this->coords[0][$pnts];
$yt = $yscale->Translate($y);
@ -174,53 +185,68 @@ class LinePlot extends Plot{
$idx=0;
$numpoints=count($this->coords[0]);
if( isset($this->coords[1]) ) {
if( count($this->coords[1])!=$numpoints )
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
}
else {
$exist_x = false;
}
if( $this->barcenter )
if( $this->barcenter ) {
$textadj = 0.5-$xscale->text_scale_off;
else
}
else {
$textadj = 0;
}
// Find the first numeric data point
$startpoint=0;
while( $startpoint < $numpoints && !is_numeric($this->coords[0][$startpoint]) )
while( $startpoint < $numpoints && !is_numeric($this->coords[0][$startpoint]) ) {
++$startpoint;
}
// Bail out if no data points
if( $startpoint == $numpoints )
return;
if( $startpoint == $numpoints ) return;
if( $this->iFastStroke ) {
$this->FastStroke($img,$xscale,$yscale,$startpoint,$exist_x);
return;
}
if( $exist_x )
if( $exist_x ) {
$xs=$this->coords[1][$startpoint];
else
}
else {
$xs= $textadj+$startpoint;
}
$img->SetStartPoint($xscale->Translate($xs),
$yscale->Translate($this->coords[0][$startpoint]));
if( $this->filled ) {
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 )
if( $min > 0 || $this->fillFromMin ) {
$fillmin = $yscale->scale_abs[0];//Translate($min);
else
}
else {
$fillmin = $yscale->Translate(0);
}
$cord[$idx++] = $xscale->Translate($xs);
$cord[$idx++] = $fillmin;
}
}
$xt = $xscale->Translate($xs);
$yt = $yscale->Translate($this->coords[0][$startpoint]);
$cord[$idx++] = $xt;
@ -240,8 +266,12 @@ class LinePlot extends Plot{
while( $pnts < $numpoints ) {
if( $exist_x ) $x=$this->coords[1][$pnts];
else $x=$pnts+$textadj;
if( $exist_x ) {
$x=$this->coords[1][$pnts];
}
else {
$x=$pnts+$textadj;
}
$xt = $xscale->Translate($x);
$yt = $yscale->Translate($this->coords[0][$pnts]);
@ -323,10 +353,17 @@ class LinePlot extends Plot{
if( $this->filled ) {
$cord[$idx++] = $xt;
if( $min > 0 || $this->fillFromMin )
if( $this->fillFromMax ) {
$cord[$idx++] = $yscale->scale_abs[1];
}
else {
if( $min > 0 || $this->fillFromMin ) {
$cord[$idx++] = $yscale->Translate($min);
else
}
else {
$cord[$idx++] = $yscale->Translate(0);
}
}
if( $this->fillgrad ) {
$img->SetLineWeight(1);
$grad = new Gradient($img);
@ -372,12 +409,12 @@ class LinePlot extends Plot{
// 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] )
if( $this->filledAreas[$i][4] ) {
$img->Polygon($areaCoords);
else
}
else {
$img->Polygon($cord);
}
$areaCoords = array();
}
@ -388,8 +425,12 @@ class LinePlot extends Plot{
for( $pnts=0; $pnts<$numpoints; ++$pnts) {
if( $exist_x ) $x=$this->coords[1][$pnts];
else $x=$pnts+$textadj;
if( $exist_x ) {
$x=$this->coords[1][$pnts];
}
else {
$x=$pnts+$textadj;
}
$xt = $xscale->Translate($x);
$yt = $yscale->Translate($this->coords[0][$pnts]);
@ -403,10 +444,12 @@ class LinePlot extends Plot{
}
$this->mark->SetCSIMAlt($this->csimalts[$pnts]);
}
if( $exist_x )
if( $exist_x ) {
$x=$this->coords[1][$pnts];
else
}
else {
$x=$pnts;
}
$this->mark->SetCSIMAltVal($this->coords[0][$pnts],$x);
$this->mark->Stroke($img,$xt,$yt);
$this->csimareas .= $this->mark->GetCSIMAreas();
@ -425,7 +468,7 @@ class AccLinePlot extends Plot {
private $iStartEndZero=true;
//---------------
// CONSTRUCTOR
function AccLinePlot($plots) {
function __construct($plots) {
$this->plots = $plots;
$this->nbrplots = count($plots);
$this->numpoints = $plots[0]->numpoints;
@ -445,9 +488,10 @@ class AccLinePlot extends Plot {
//---------------
// PUBLIC METHODS
function Legend($graph) {
foreach( $this->plots as $p )
foreach( $this->plots as $p ) {
$p->DoLegend($graph);
}
}
function Max() {
list($xmax) = $this->plots[0]->Max();
@ -566,8 +610,9 @@ class AccLinePlot extends Plot {
$pstart=$i-1;
// Now see how long this segment of '-' are
while( $i < $n && $aData[$i] === '-' )
while( $i < $n && $aData[$i] === '-' ) {
++$i;
}
if( $i < $n ) {
$pend=$i;
$size=$pend-$pstart;
@ -582,18 +627,18 @@ class AccLinePlot extends Plot {
// In that case we just set all the remaining values the the same as the
// last valid data point.
for( $j=$pstart+1; $j < $n; ++$j )
if( $this->iStartEndZero )
if( $this->iStartEndZero ) {
$aData[$j] = 0;
else
}
else {
$aData[$j] = $aData[$pstart] ;
}
}
}
}
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
@ -620,8 +665,9 @@ class AccLinePlot extends Plot {
$p->coords[0][$i]=$coords[$j][$i];
}
$p->Stroke($img,$xscale,$yscale);
for( $i=0; $i<$this->numpoints; ++$i)
for( $i=0; $i<$this->numpoints; ++$i) {
$p->coords[0][$i]=$tmp[$i];
}
$p->coords[0][]=$tmp;
}
}

View File

@ -3,7 +3,7 @@
// 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 $
// Ver: $Id: jpgraph_pie.php 1739 2009-07-30 21:21:15Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
@ -11,11 +11,11 @@
// 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
@ -56,7 +56,7 @@ class PiePlot {
//---------------
// CONSTRUCTOR
function PiePlot($data) {
function __construct($data) {
$this->data = array_reverse($data);
$this->title = new Text("");
$this->title->SetFont(FF_FONT1,FS_BOLD);
@ -210,10 +210,6 @@ class PiePlot {
$this->startangle *= M_PI/180;
}
function SetFont($family,$style=FS_NORMAL,$size=10) {
JpGraphError::RaiseL(15005);//('PiePlot::SetFont() is deprecated. Use PiePlot->value->SetFont() instead.');
}
// Size in percentage
function SetSize($aSize) {
if( ($aSize>0 && $aSize<=0.5) || ($aSize>10 && $aSize<1000) )
@ -223,11 +219,6 @@ 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]");
}
function SetFontColor($aColor) {
JpGraphError::RaiseL(15007);
//('PiePlot::SetFontColor() is deprecated. Use PiePlot->value->SetColor() instead.');
}
// Set label arrays
function SetLegends($aLegend) {
$this->legends = $aLegend;
@ -244,11 +235,11 @@ class PiePlot {
}
// Should we display actual value or percentage?
function SetLabelType($t) {
if( $t < 0 || $t > 2 )
JpGraphError::RaiseL(15008,$t);
function SetLabelType($aType) {
if( $aType < 0 || $aType > 2 )
JpGraphError::RaiseL(15008,$aType);
//("PiePlot::SetLabelType() Type for pie plots must be 0 or 1 (not $t).");
$this->labeltype=$t;
$this->labeltype = $aType;
}
// Deprecated.
@ -488,7 +479,7 @@ class PiePlot {
// slice in the pie in case it is the wanted behaviour
if( $_ea-$_sa > 0.1 || $n==1 ) {
$img->CakeSlice($xcm,$ycm,$radius-1,$radius-1,
$angle1*180/M_PI,$angle2*180/M_PI,$slicecolor,$arccolor);
$angle1*180/M_PI,$angle2*180/M_PI,$this->ishadowcolor);
}
}
}
@ -533,13 +524,15 @@ class PiePlot {
if( $angle2 < 0.0001 && $angle1 > 0.0001 ) {
$this->la[$i] = 2*M_PI - (abs(2*M_PI-$angle1)/2.0+$angle1);
}
else
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;
@ -551,6 +544,14 @@ 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 "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 )
@ -1017,8 +1018,8 @@ class PiePlotC extends PiePlot {
public $midtitle='';
private $middlecsimtarget='',$middlecsimwintarget='',$middlecsimalt='';
function PiePlotC($data,$aCenterTitle='') {
parent::PiePlot($data);
function __construct($data,$aCenterTitle='') {
parent::__construct($data);
$this->midtitle = new Text();
$this->midtitle->ParagraphAlign('center');
}
@ -1213,8 +1214,8 @@ class PieGraph extends Graph {
public $pieaa = false ;
//---------------
// CONSTRUCTOR
function PieGraph($width=300,$height=200,$cachedName="",$timeout=0,$inline=1) {
$this->Graph($width,$height,$cachedName,$timeout,$inline);
function __construct($width=300,$height=200,$cachedName="",$timeout=0,$inline=1) {
parent::__construct($width,$height,$cachedName,$timeout,$inline);
$this->posx=$width/2;
$this->posy=$height/2;
$this->SetColor(array(255,255,255));
@ -1296,6 +1297,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
@ -1376,6 +1383,7 @@ class PieGraph extends Graph {
}
else {
$this->StrokeFrame();
$this->StrokeBackgroundGrad();
}
}

View File

@ -3,7 +3,7 @@
// 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 $
// Ver: $Id: jpgraph_pie3d.php 1329 2009-06-20 19:23:30Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
@ -22,7 +22,7 @@ class PiePlot3D extends PiePlot {
//---------------
// CONSTRUCTOR
function PiePlot3d($data) {
function __construct($data) {
$this->radius = 0.5;
$this->data = $data;
$this->title = new Text("");
@ -62,21 +62,17 @@ class PiePlot3D extends PiePlot {
$this->edgeweight = $aWeight;
}
// Dummy function to make Pie3D behave in a similair way to 2D
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
function SetAngle($a) {
if( $a<5 || $a>90 )
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;
}
}
function Add3DSliceToCSIM($i,$xc,$yc,$height,$width,$thick,$sa,$ea) { //Slice number, ellipse centre (x,y), height, width, start angle, end angle
@ -469,12 +465,14 @@ class PiePlot3D extends PiePlot {
for($i=0; $i<count($data); ++$i, ++$idx ) {
$da = $data[$i]/$sum * 360;
if( empty($this->explode_radius[$i]) )
if( empty($this->explode_radius[$i]) ) {
$this->explode_radius[$i]=0;
}
$expscale=1;
if( $aaoption == 1 )
if( $aaoption == 1 ) {
$expscale=2;
}
$la = $a + $da/2;
$explode = array( $xc + $this->explode_radius[$i]*cos($la*M_PI/180)*$expscale,
@ -515,12 +513,9 @@ class PiePlot3D extends PiePlot {
// Slice may, depending on position, cross one or two
// bonudaries
if( $a < 90 )
$split = 90;
elseif( $a <= 270 )
$split = 270;
else
$split = 90;
if( $a < 90 ) $split = 90;
elseif( $a <= 270 ) $split = 270;
else $split = 90;
$angles[$idx] = array($a,$split);
$adjcolors[$idx] = $colors[$i % $numcolors];
@ -540,9 +535,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;
@ -665,10 +658,8 @@ class PiePlot3D extends PiePlot {
if( $la > 180 && $la < 360 ) $y += $z;
}
if( $this->labeltype == 0 ) {
if( $sum > 0 )
$l = 100*$data[$i]/$sum;
else
$l = 0;
if( $sum > 0 ) $l = 100*$data[$i]/$sum;
else $l = 0;
}
elseif( $this->labeltype == 1 ) {
$l = $data[$i];
@ -676,8 +667,9 @@ class PiePlot3D extends PiePlot {
else {
$l = $this->adjusted_data[$i];
}
if( isset($this->labels[$i]) && is_string($this->labels[$i]) )
if( isset($this->labels[$i]) && is_string($this->labels[$i]) ) {
$l=sprintf($this->labels[$i],$l);
}
$this->StrokeLabels($l,$img,$labeldata[$i][0]*M_PI/180,$x,$y,$z);
@ -704,8 +696,9 @@ class PiePlot3D extends PiePlot {
$fulledge = true;
for($i=0; $i < count($data) && $fulledge; ++$i ) {
if( empty($this->explode_radius[$i]) )
if( empty($this->explode_radius[$i]) ) {
$this->explode_radius[$i]=0;
}
if( $this->explode_radius[$i] > 0 ) {
$fulledge = false;
}
@ -756,11 +749,13 @@ class PiePlot3D extends PiePlot {
// but the "real" solution is much more complicated.
if( $fulledge && !( $sa > 0 && $sa < M_PI && $ea < M_PI) ) {
if($sa < M_PI && $ea > M_PI)
if($sa < M_PI && $ea > M_PI) {
$sa = M_PI;
}
if($sa < 2*M_PI && (($ea >= 2*M_PI) || ($ea > 0 && $ea < $sa ) ) )
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),
@ -790,8 +785,9 @@ class PiePlot3D extends PiePlot {
$idx_a=$this->themearr[$this->theme];
$ca = array();
$m = count($idx_a);
for($i=0; $i < $m; ++$i)
for($i=0; $i < $m; ++$i) {
$ca[$i] = $colors[$idx_a[$i]];
}
$ca = array_reverse(array_slice($ca,0,$n));
}
else {
@ -799,15 +795,19 @@ class PiePlot3D extends PiePlot {
}
if( $this->posx <= 1 && $this->posx > 0 )
if( $this->posx <= 1 && $this->posx > 0 ) {
$xc = round($this->posx*$img->width);
else
}
else {
$xc = $this->posx ;
}
if( $this->posy <= 1 && $this->posy > 0 )
if( $this->posy <= 1 && $this->posy > 0 ) {
$yc = round($this->posy*$img->height);
else
}
else {
$yc = $this->posy ;
}
if( $this->radius <= 1 ) {
$width = floor($this->radius*min($img->width,$img->height));
@ -837,9 +837,11 @@ class PiePlot3D extends PiePlot {
$thick = $this->iThickness;
$thick *= ($aaoption === 1 ? 2 : 1 );
}
else
else {
$thick = $width/12;
}
$a = $this->angle;
if( $a <= 30 ) $thick *= 1.6;
elseif( $a <= 40 ) $thick *= 1.4;
elseif( $a <= 50 ) $thick *= 1.2;
@ -850,9 +852,10 @@ class PiePlot3D extends PiePlot {
$thick = floor($thick);
if( $this->explode_all )
if( $this->explode_all ) {
for($i=0; $i < $n; ++$i)
$this->explode_radius[$i]=$this->explode_r;
}
$this->Pie3D($aaoption,$img,$this->data, $ca, $xc, $yc, $width, $this->angle,
$thick, 0.65, $this->startangle, $this->edgecolor, $this->edgeweight);
@ -882,14 +885,21 @@ class PiePlot3D extends PiePlot {
// For numeric values the format of the display value
// must be taken into account
if( is_numeric($label) ) {
if( $label >= 0 )
if( $label >= 0 ) {
$w=$img->GetTextWidth(sprintf($this->value->format,$label));
else
}
else {
$w=$img->GetTextWidth(sprintf($this->value->negformat,$label));
}
else
}
else {
$w=$img->GetTextWidth($label);
while( $a > 2*M_PI ) $a -= 2*M_PI;
}
while( $a > 2*M_PI ) {
$a -= 2*M_PI;
}
if( $a>=7*M_PI/4 || $a <= M_PI/4 ) $dx=0;
if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dx=($a-M_PI/4)*2/M_PI;
if( $a>=3*M_PI/4 && $a <= 5*M_PI/4 ) $dx=1;
@ -904,13 +914,13 @@ class PiePlot3D extends PiePlot {
$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

@ -3,27 +3,27 @@
// 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 $
// Ver: $Id: jpgraph_plotband.php 1106 2009-02-22 20:16:35Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
// Constants for types of static bands in plot area
DEFINE("BAND_RDIAG",1); // Right diagonal lines
DEFINE("BAND_LDIAG",2); // Left diagonal lines
DEFINE("BAND_SOLID",3); // Solid one color
DEFINE("BAND_VLINE",4); // Vertical lines
DEFINE("BAND_HLINE",5); // Horizontal lines
DEFINE("BAND_3DPLANE",6); // "3D" Plane
DEFINE("BAND_HVCROSS",7); // Vertical/Hor crosses
DEFINE("BAND_DIAGCROSS",8); // Diagonal crosses
define("BAND_RDIAG",1); // Right diagonal lines
define("BAND_LDIAG",2); // Left diagonal lines
define("BAND_SOLID",3); // Solid one color
define("BAND_VLINE",4); // Vertical lines
define("BAND_HLINE",5); // Horizontal lines
define("BAND_3DPLANE",6); // "3D" Plane
define("BAND_HVCROSS",7); // Vertical/Hor crosses
define("BAND_DIAGCROSS",8); // Diagonal crosses
// Utility class to hold coordinates for a rectangle
class Rectangle {
public $x,$y,$w,$h;
public $xe, $ye;
function Rectangle($aX,$aY,$aWidth,$aHeight) {
function __construct($aX,$aY,$aWidth,$aHeight) {
$this->x=$aX;
$this->y=$aY;
$this->w=$aWidth;
@ -48,7 +48,7 @@ class RectPattern {
protected $linespacing; // Line spacing in pixels
protected $iBackgroundColor=-1; // Default is no background fill
function RectPattern($aColor,$aWeight=1) {
function __construct($aColor,$aWeight=1) {
$this->color = $aColor;
$this->weight = $aWeight;
}
@ -105,8 +105,8 @@ class RectPattern {
//=====================================================================
class RectPatternSolid extends RectPattern {
function RectPatternSolid($aColor="black",$aWeight=1) {
parent::RectPattern($aColor,$aWeight);
function __construct($aColor="black",$aWeight=1) {
parent::__construct($aColor,$aWeight);
}
function DoPattern($aImg) {
@ -122,8 +122,8 @@ class RectPatternSolid extends RectPattern {
//=====================================================================
class RectPatternHor extends RectPattern {
function RectPatternHor($aColor="black",$aWeight=1,$aLineSpacing=7) {
parent::RectPattern($aColor,$aWeight);
function __construct($aColor="black",$aWeight=1,$aLineSpacing=7) {
parent::__construct($aColor,$aWeight);
$this->linespacing = $aLineSpacing;
}
@ -144,8 +144,8 @@ class RectPatternHor extends RectPattern {
//=====================================================================
class RectPatternVert extends RectPattern {
function RectPatternVert($aColor="black",$aWeight=1,$aLineSpacing=7) {
parent::RectPattern($aColor,$aWeight);
function __construct($aColor="black",$aWeight=1,$aLineSpacing=7) {
parent::__construct($aColor,$aWeight);
$this->linespacing = $aLineSpacing;
}
@ -170,8 +170,8 @@ class RectPatternVert extends RectPattern {
//=====================================================================
class RectPatternRDiag extends RectPattern {
function RectPatternRDiag($aColor="black",$aWeight=1,$aLineSpacing=12) {
parent::RectPattern($aColor,$aWeight);
function __construct($aColor="black",$aWeight=1,$aLineSpacing=12) {
parent::__construct($aColor,$aWeight);
$this->linespacing = $aLineSpacing;
}
@ -239,9 +239,9 @@ class RectPatternRDiag extends RectPattern {
//=====================================================================
class RectPatternLDiag extends RectPattern {
function RectPatternLDiag($aColor="black",$aWeight=1,$aLineSpacing=12) {
function __construct($aColor="black",$aWeight=1,$aLineSpacing=12) {
$this->linespacing = $aLineSpacing;
parent::RectPattern($aColor,$aWeight);
parent::__construct($aColor,$aWeight);
}
function DoPattern($aImg) {
@ -307,8 +307,8 @@ class RectPattern3DPlane extends RectPattern {
// top of the band. Specifies how fast the lines
// converge.
function RectPattern3DPlane($aColor="black",$aWeight=1) {
parent::RectPattern($aColor,$aWeight);
function __construct($aColor="black",$aWeight=1) {
parent::__construct($aColor,$aWeight);
$this->SetDensity(10); // Slightly larger default
}
@ -421,8 +421,8 @@ class RectPattern3DPlane extends RectPattern {
class RectPatternCross extends RectPattern {
private $vert=null;
private $hor=null;
function RectPatternCross($aColor="black",$aWeight=1) {
parent::RectPattern($aColor,$aWeight);
function __construct($aColor="black",$aWeight=1) {
parent::__construct($aColor,$aWeight);
$this->vert = new RectPatternVert($aColor,$aWeight);
$this->hor = new RectPatternHor($aColor,$aWeight);
}
@ -457,8 +457,8 @@ class RectPatternCross extends RectPattern {
class RectPatternDiagCross extends RectPattern {
private $left=null;
private $right=null;
function RectPatternDiagCross($aColor="black",$aWeight=1) {
parent::RectPattern($aColor,$aWeight);
function __construct($aColor="black",$aWeight=1) {
parent::__construct($aColor,$aWeight);
$this->right = new RectPatternRDiag($aColor,$aWeight);
$this->left = new RectPatternLDiag($aColor,$aWeight);
}
@ -491,7 +491,7 @@ class RectPatternDiagCross extends RectPattern {
// Factory class for rectangular pattern
//=====================================================================
class RectPatternFactory {
function RectPatternFactory() {
function __construct() {
// Empty
}
function Create($aPattern,$aColor,$aWeight=1) {
@ -540,7 +540,7 @@ class PlotBand {
private $prect=null;
private $dir, $min, $max;
function PlotBand($aDir,$aPattern,$aMin,$aMax,$aColor="black",$aWeight=1,$aDepth=DEPTH_BACK) {
function __construct($aDir,$aPattern,$aMin,$aMax,$aColor="black",$aWeight=1,$aDepth=DEPTH_BACK) {
$f = new RectPatternFactory();
$this->prect = $f->Create($aPattern,$aColor,$aWeight);
if( is_numeric($aMin) && is_numeric($aMax) && ($aMin > $aMax) )

View File

@ -3,7 +3,7 @@
// 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 $
// Ver: $Id: jpgraph_plotmark.inc.php 1106 2009-02-22 20:16:35Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
@ -32,7 +32,7 @@ class PlotMark {
//--------------
// CONSTRUCTOR
function PlotMark() {
function __construct() {
$this->title = new Text();
$this->title->Hide();
$this->csimareas = '';
@ -450,6 +450,11 @@ class ImgData {
protected $index = array(); // Index for colors
protected $maxidx = 0 ; // Max color index
protected $anchor_x=0.5, $anchor_y=0.5 ; // Where is the center of the image
function __construct() {
// Empty
}
// Create a GD image from the data and return a GD handle
function GetImg($aMark,$aIdx) {
$n = $this->an[$aMark];
@ -467,6 +472,7 @@ class ImgData {
$idx = $aIdx ;
return Image::CreateFromString(base64_decode($this->{$n}[$idx][1]));
}
function GetAnchor() {
return array($this->anchor_x,$this->anchor_y);
}
@ -482,6 +488,7 @@ $_gFlagCache=array(
);
// Only supposed to b called as statics
class FlagCache {
static function GetFlagImgByName($aSize,$aName) {
global $_gFlagCache;
require_once('jpgraph_flags.php');

View File

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

View File

@ -0,0 +1,272 @@
<?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 1404 2009-06-28 15:25:41Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
//===================================================
// CLASS Text
// Description: Arbitrary text object that can be added to the graph
//===================================================
class Text {
public $t,$margin=0;
public $x=0,$y=0,$halign="left",$valign="top",$color=array(0,0,0);
public $hide=false, $dir=0;
public $iScalePosY=null,$iScalePosX=null;
public $iWordwrap=0;
public $font_family=FF_FONT1,$font_style=FS_NORMAL,$font_size=12;
protected $boxed=false; // Should the text be boxed
protected $paragraph_align="left";
protected $icornerradius=0,$ishadowwidth=3;
protected $fcolor='white',$bcolor='black',$shadow=false;
protected $iCSIMarea='',$iCSIMalt='',$iCSIMtarget='',$iCSIMWinTarget='';
//---------------
// CONSTRUCTOR
// Create new text at absolute pixel coordinates
function __construct($aTxt="",$aXAbsPos=0,$aYAbsPos=0) {
if( ! is_string($aTxt) ) {
JpGraphError::RaiseL(25050);//('First argument to Text::Text() must be s atring.');
}
$this->t = $aTxt;
$this->x = round($aXAbsPos);
$this->y = round($aYAbsPos);
$this->margin = 0;
}
//---------------
// PUBLIC METHODS
// Set the string in the text object
function Set($aTxt) {
$this->t = $aTxt;
}
// Alias for Pos()
function SetPos($aXAbsPos=0,$aYAbsPos=0,$aHAlign="left",$aVAlign="top") {
//$this->Pos($aXAbsPos,$aYAbsPos,$aHAlign,$aVAlign);
$this->x = $aXAbsPos;
$this->y = $aYAbsPos;
$this->halign = $aHAlign;
$this->valign = $aVAlign;
}
function SetScalePos($aX,$aY) {
$this->iScalePosX = $aX;
$this->iScalePosY = $aY;
}
// Specify alignment for the text
function Align($aHAlign,$aVAlign="top",$aParagraphAlign="") {
$this->halign = $aHAlign;
$this->valign = $aVAlign;
if( $aParagraphAlign != "" )
$this->paragraph_align = $aParagraphAlign;
}
// Alias
function SetAlign($aHAlign,$aVAlign="top",$aParagraphAlign="") {
$this->Align($aHAlign,$aVAlign,$aParagraphAlign);
}
// Specifies the alignment for a multi line text
function ParagraphAlign($aAlign) {
$this->paragraph_align = $aAlign;
}
// Specifies the alignment for a multi line text
function SetParagraphAlign($aAlign) {
$this->paragraph_align = $aAlign;
}
function SetShadow($aShadowColor='gray',$aShadowWidth=3) {
$this->ishadowwidth=$aShadowWidth;
$this->shadow=$aShadowColor;
$this->boxed=true;
}
function SetWordWrap($aCol) {
$this->iWordwrap = $aCol ;
}
// Specify that the text should be boxed. fcolor=frame color, bcolor=border color,
// $shadow=drop shadow should be added around the text.
function SetBox($aFrameColor=array(255,255,255),$aBorderColor=array(0,0,0),$aShadowColor=false,$aCornerRadius=4,$aShadowWidth=3) {
if( $aFrameColor==false )
$this->boxed=false;
else
$this->boxed=true;
$this->fcolor=$aFrameColor;
$this->bcolor=$aBorderColor;
// For backwards compatibility when shadow was just true or false
if( $aShadowColor === true )
$aShadowColor = 'gray';
$this->shadow=$aShadowColor;
$this->icornerradius=$aCornerRadius;
$this->ishadowwidth=$aShadowWidth;
}
// Hide the text
function Hide($aHide=true) {
$this->hide=$aHide;
}
// This looks ugly since it's not a very orthogonal design
// but I added this "inverse" of Hide() to harmonize
// with some classes which I designed more recently (especially)
// jpgraph_gantt
function Show($aShow=true) {
$this->hide=!$aShow;
}
// Specify font
function SetFont($aFamily,$aStyle=FS_NORMAL,$aSize=10) {
$this->font_family=$aFamily;
$this->font_style=$aStyle;
$this->font_size=$aSize;
}
// Center the text between $left and $right coordinates
function Center($aLeft,$aRight,$aYAbsPos=false) {
$this->x = $aLeft + ($aRight-$aLeft )/2;
$this->halign = "center";
if( is_numeric($aYAbsPos) )
$this->y = $aYAbsPos;
}
// Set text color
function SetColor($aColor) {
$this->color = $aColor;
}
function SetAngle($aAngle) {
$this->SetOrientation($aAngle);
}
// Orientation of text. Note only TTF fonts can have an arbitrary angle
function SetOrientation($aDirection=0) {
if( is_numeric($aDirection) )
$this->dir=$aDirection;
elseif( $aDirection=="h" )
$this->dir = 0;
elseif( $aDirection=="v" )
$this->dir = 90;
else JpGraphError::RaiseL(25051);//(" Invalid direction specified for text.");
}
// Total width of text
function GetWidth($aImg) {
$aImg->SetFont($this->font_family,$this->font_style,$this->font_size);
$w = $aImg->GetTextWidth($this->t,$this->dir);
return $w;
}
// Hight of font
function GetFontHeight($aImg) {
$aImg->SetFont($this->font_family,$this->font_style,$this->font_size);
$h = $aImg->GetFontHeight();
return $h;
}
function GetTextHeight($aImg) {
$aImg->SetFont($this->font_family,$this->font_style,$this->font_size);
$h = $aImg->GetTextHeight($this->t,$this->dir);
return $h;
}
function GetHeight($aImg) {
// Synonym for GetTextHeight()
$aImg->SetFont($this->font_family,$this->font_style,$this->font_size);
$h = $aImg->GetTextHeight($this->t,$this->dir);
return $h;
}
// Set the margin which will be interpretated differently depending
// on the context.
function SetMargin($aMarg) {
$this->margin = $aMarg;
}
function StrokeWithScale($aImg,$axscale,$ayscale) {
if( $this->iScalePosX === null || $this->iScalePosY === null ) {
$this->Stroke($aImg);
}
else {
$this->Stroke($aImg,
round($axscale->Translate($this->iScalePosX)),
round($ayscale->Translate($this->iScalePosY)));
}
}
function SetCSIMTarget($aURITarget,$aAlt='',$aWinTarget='') {
$this->iCSIMtarget = $aURITarget;
$this->iCSIMalt = $aAlt;
$this->iCSIMWinTarget = $aWinTarget;
}
function GetCSIMareas() {
if( $this->iCSIMtarget !== '' )
return $this->iCSIMarea;
else
return '';
}
// Display text in image
function Stroke($aImg,$x=null,$y=null) {
if( !empty($x) ) $this->x = round($x);
if( !empty($y) ) $this->y = round($y);
// Insert newlines
if( $this->iWordwrap > 0 ) {
$this->t = wordwrap($this->t,$this->iWordwrap,"\n");
}
// If position been given as a fraction of the image size
// calculate the absolute position
if( $this->x < 1 && $this->x > 0 ) $this->x *= $aImg->width;
if( $this->y < 1 && $this->y > 0 ) $this->y *= $aImg->height;
$aImg->PushColor($this->color);
$aImg->SetFont($this->font_family,$this->font_style,$this->font_size);
$aImg->SetTextAlign($this->halign,$this->valign);
if( $this->boxed ) {
if( $this->fcolor=="nofill" )
$this->fcolor=false;
$oldweight=$aImg->SetLineWeight(1);
$bbox = $aImg->StrokeBoxedText($this->x,$this->y,$this->t,
$this->dir,$this->fcolor,$this->bcolor,$this->shadow,
$this->paragraph_align,5,5,$this->icornerradius,
$this->ishadowwidth);
$aImg->SetLineWeight($oldweight);
}
else {
$bbox = $aImg->StrokeText($this->x,$this->y,$this->t,$this->dir,$this->paragraph_align);
}
// Create CSIM targets
$coords = $bbox[0].','.$bbox[1].','.$bbox[2].','.$bbox[3].','.$bbox[4].','.$bbox[5].','.$bbox[6].','.$bbox[7];
$this->iCSIMarea = "<area shape=\"poly\" coords=\"$coords\" href=\"".htmlentities($this->iCSIMtarget)."\" ";
if( trim($this->iCSIMalt) != '' ) {
$this->iCSIMarea .= " alt=\"".$this->iCSIMalt."\" ";
$this->iCSIMarea .= " title=\"".$this->iCSIMalt."\" ";
}
if( trim($this->iCSIMWinTarget) != '' ) {
$this->iCSIMarea .= " target=\"".$this->iCSIMWinTarget."\" ";
}
$this->iCSIMarea .= " />\n";
$aImg->PopColor($this->color);
}
} // Class
?>

View File

@ -3,67 +3,146 @@
// 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 $
// Ver: $Id: jpgraph_ttf.inc.php 1545 2009-07-10 22:15:38Z ljp $
//
// Copyright (c) Aditus Consulting. 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);
//=================================================================
// CLASS LanguageConv
@ -104,7 +183,7 @@ class LanguageConv {
}
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).');
@ -184,12 +263,11 @@ class LanguageConv {
class TTF {
private $font_files,$style_names;
//---------------
// CONSTRUCTOR
function TTF() {
function __construct() {
// String names for font styles to be used in error messages
$this->style_names=array(FS_NORMAL =>'normal',
$this->style_names=array(
FS_NORMAL =>'normal',
FS_BOLD =>'bold',
FS_ITALIC =>'italic',
FS_BOLDITALIC =>'bolditalic');
@ -238,70 +316,144 @@ class TTF {
FS_BOLDITALIC =>'' ) ,
/* Chinese fonts */
FF_SIMSUN => array(FS_NORMAL =>'simsun.ttc',
FF_SIMSUN => array(
FS_NORMAL =>'simsun.ttc',
FS_BOLD =>'simhei.ttf',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
FF_CHINESE => array(FS_NORMAL =>CHINESE_TTF_FONT,
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,
FF_MINCHO => array(
FS_NORMAL =>MINCHO_TTF_FONT,
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
FF_PMINCHO => array(FS_NORMAL =>PMINCHO_TTF_FONT,
FF_PMINCHO => array(
FS_NORMAL =>PMINCHO_TTF_FONT,
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
FF_GOTHIC => array(FS_NORMAL =>GOTHIC_TTF_FONT,
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,
FF_PGOTHIC => array(
FS_NORMAL =>PGOTHIC_TTF_FONT,
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
/* Hebrew fonts */
FF_DAVID => array(FS_NORMAL =>'DAVIDNEW.TTF',
FF_DAVID => array(
FS_NORMAL =>'DAVIDNEW.TTF',
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
FF_MIRIAM => array(FS_NORMAL =>'MRIAMY.TTF',
FF_MIRIAM => array(
FS_NORMAL =>'MRIAMY.TTF',
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
FF_AHRON => array(FS_NORMAL =>'ahronbd.ttf',
FF_AHRON => array(
FS_NORMAL =>'ahronbd.ttf',
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
/* Misc fonts */
FF_DIGITAL => array(FS_NORMAL =>'DIGIRU__.TTF',
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',
/* 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',
*/
FF_COMPUTER => array(
FS_NORMAL =>'COMPUTER.TTF',
FS_BOLD =>'',
FS_ITALIC =>'',
FS_BOLDITALIC =>'' ),
FF_CALCULATOR => array(FS_NORMAL =>'Triad_xs.ttf',
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 =>'' ),
);
}
@ -313,7 +465,20 @@ 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( is_array($ff) ) {
// There are several optional file names. They are tried in order
// and the first one found is used
$n = count($ff);
} else {
$n = 1;
$ff = array($ff);
}
$i = 0;
do {
$f = $ff[$i];
// All font families are guaranteed to have the normal 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].'.');
@ -326,14 +491,125 @@ class TTF {
} else {
$f = TTF_DIR.$f;
}
++$i;
} while( $i < $n && (file_exists($f) === false || is_readable($f) === false) );
if( file_exists($f) === false || is_readable($f) === false ) {
if( !file_exists($f) ) {
JpGraphError::RaiseL(25049,$f);//("Font file \"$f\" is not readable or does not exist.");
}
return $f;
}
function SetUserFont($aNormal,$aBold='',$aItalic='',$aBoldIt='') {
$this->font_files[FF_USERFONT] =
array(FS_NORMAL => $aNormal,
FS_BOLD => $aBold,
FS_ITALIC => $aItalic,
FS_BOLDITALIC => $aBoldIt ) ;
}
function SetUserFont1($aNormal,$aBold='',$aItalic='',$aBoldIt='') {
$this->font_files[FF_USERFONT1] =
array(FS_NORMAL => $aNormal,
FS_BOLD => $aBold,
FS_ITALIC => $aItalic,
FS_BOLDITALIC => $aBoldIt ) ;
}
function SetUserFont2($aNormal,$aBold='',$aItalic='',$aBoldIt='') {
$this->font_files[FF_USERFONT2] =
array(FS_NORMAL => $aNormal,
FS_BOLD => $aBold,
FS_ITALIC => $aItalic,
FS_BOLDITALIC => $aBoldIt ) ;
}
function SetUserFont3($aNormal,$aBold='',$aItalic='',$aBoldIt='') {
$this->font_files[FF_USERFONT3] =
array(FS_NORMAL => $aNormal,
FS_BOLD => $aBold,
FS_ITALIC => $aItalic,
FS_BOLDITALIC => $aBoldIt ) ;
}
} // Class
//=============================================================================
// CLASS SymChar
// Description: Code values for some commonly used characters that
// normally isn't available directly on the keyboard, for example
// mathematical and greek symbols.
//=============================================================================
class SymChar {
static function Get($aSymb,$aCapital=FALSE) {
$iSymbols = array(
/* Greek */
array('alpha','03B1','0391'),
array('beta','03B2','0392'),
array('gamma','03B3','0393'),
array('delta','03B4','0394'),
array('epsilon','03B5','0395'),
array('zeta','03B6','0396'),
array('ny','03B7','0397'),
array('eta','03B8','0398'),
array('theta','03B8','0398'),
array('iota','03B9','0399'),
array('kappa','03BA','039A'),
array('lambda','03BB','039B'),
array('mu','03BC','039C'),
array('nu','03BD','039D'),
array('xi','03BE','039E'),
array('omicron','03BF','039F'),
array('pi','03C0','03A0'),
array('rho','03C1','03A1'),
array('sigma','03C3','03A3'),
array('tau','03C4','03A4'),
array('upsilon','03C5','03A5'),
array('phi','03C6','03A6'),
array('chi','03C7','03A7'),
array('psi','03C8','03A8'),
array('omega','03C9','03A9'),
/* Money */
array('euro','20AC'),
array('yen','00A5'),
array('pound','20A4'),
/* Math */
array('approx','2248'),
array('neq','2260'),
array('not','2310'),
array('def','2261'),
array('inf','221E'),
array('sqrt','221A'),
array('int','222B'),
/* Misc */
array('copy','00A9'),
array('para','00A7'),
array('tm','2122'), /* Trademark symbol */
array('rtm','00AE'), /* Registered trademark */
array('degree','00b0')
);
$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

@ -4,7 +4,8 @@
// 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 $
// Johan Persson (ljp@localhost.nil)
// Ver: $Id: de.inc.php 1709 2009-07-30 08:00:08Z 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,35 @@ 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),
/*
** jpgraph_gradient
@ -112,107 +114,107 @@ 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),
/*
** 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 +224,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),
/*
@ -259,64 +261,64 @@ HTTP header wurden bereits gesendet.<br>Fehler in der Datei <b>%s</b> in der Zei
** 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 +326,91 @@ 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),
/*
** 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 +421,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 +441,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 +467,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,38 +475,63 @@ 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'),
29202 => array('The distance between min and max value is too small for numerical precision'),
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'),
29207 => array('Empty input data specified for MatrixPlot'),
);
?>

View File

@ -3,7 +3,7 @@
// 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 $
// Ver: $Id: en.inc.php 1709 2009-07-30 08:00:08Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
@ -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),
/*
@ -398,7 +399,13 @@ 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),
/*
** 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 +483,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,6 +501,29 @@ 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'),
29202 => array('The distance between min and max value is too small for numerical precision'),
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'),
29207 => array('Empty input data specified for MatrixPlot'),
);

View File

@ -4,7 +4,7 @@
// 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 1709 2009-07-30 08:00:08Z ljp $
//
// Copyright (c) Aditus Consulting. All rights reserved.
//========================================================================
@ -275,6 +275,8 @@ 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),
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 +322,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,6 +355,23 @@ 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.'28007',0),
29202 => array(DEFAULT_ERROR_MESSAGE.'28007',0),
29203 => array(DEFAULT_ERROR_MESSAGE.'28007',0),
29204 => array(DEFAULT_ERROR_MESSAGE.'28007',0),
29205 => array(DEFAULT_ERROR_MESSAGE.'28007',0),
29206 => array(DEFAULT_ERROR_MESSAGE.'28007',0),
29207 => array(DEFAULT_ERROR_MESSAGE.'28007',0),
);
?>