[Netoffice-cvs-2x] netoffice-2.x/includes/jpgraph jpgraph_date.php,NONE,1.1 imgdata_balls.inc,1.4,1.
PXell - Online project management.
Brought to you by:
trilexcom
Update of /cvsroot/netoffice/netoffice-2.x/includes/jpgraph In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25457/includes/jpgraph Modified Files: imgdata_balls.inc imgdata_bevels.inc imgdata_diamonds.inc imgdata_pushpins.inc imgdata_squares.inc imgdata_stars.inc jpg-config.inc jpgraph.php jpgraph_antispam-digits.php jpgraph_antispam.php jpgraph_bar.php jpgraph_canvas.php jpgraph_canvtools.php jpgraph_error.php jpgraph_flags.php jpgraph_gantt.php jpgraph_gb2312.php jpgraph_gradient.php jpgraph_iconplot.php jpgraph_imgtrans.php jpgraph_line.php jpgraph_log.php jpgraph_pie.php jpgraph_pie3d.php jpgraph_plotband.php jpgraph_plotmark.inc jpgraph_polar.php jpgraph_radar.php jpgraph_regstat.php jpgraph_scatter.php jpgraph_stock.php Added Files: jpgraph_date.php Removed Files: jpg-config.bak.inc Log Message: Update JpGraph to latest stable version 1.18 to be part of 2.6.0 beta 2 Index: jpgraph_polar.php =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/jpgraph_polar.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jpgraph_polar.php 23 Jan 2005 22:33:09 -0000 1.4 --- jpgraph_polar.php 10 Jun 2005 01:07:35 -0000 1.5 *************** *** 7,12 **** // Ver: $Id$ // ! // License: This code is released under QPL ! // Copyright (C) 2003 Johan Persson //======================================================================== */ --- 7,11 ---- // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== */ Index: jpgraph_antispam-digits.php =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/jpgraph_antispam-digits.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** jpgraph_antispam-digits.php 23 Jan 2005 22:33:09 -0000 1.3 --- jpgraph_antispam-digits.php 10 Jun 2005 01:07:35 -0000 1.4 *************** *** 7,12 **** // Ver: $Id$ // ! // License: This code is released under QPL 1.0 ! // Copyright (C) 2004 Johan Persson //======================================================================== --- 7,11 ---- // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== Index: jpgraph_radar.php =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/jpgraph_radar.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jpgraph_radar.php 23 Jan 2005 22:33:09 -0000 1.4 --- jpgraph_radar.php 10 Jun 2005 01:07:35 -0000 1.5 *************** *** 7,12 **** // Ver: $Id$ // ! // License: This code is released under QPL ! // Copyright (C) 2001,2002 Johan Persson //======================================================================== */ --- 7,11 ---- // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== */ *************** *** 195,203 **** // majpos contsins (x,y) coordinates for labels ! for($i=0; $i<count($majpos)/2; ++$i) { ! if( $this->ticks_label != null ) ! $this->img->StrokeText($majpos[$i*2],$majpos[$i*2+1],$this->ticks_label[$i]); ! else ! $this->img->StrokeText($majpos[$i*2],$majpos[$i*2+1],$majlabel[$i]); } } --- 194,204 ---- // majpos contsins (x,y) coordinates for labels ! if( ! $this->hide_labels ) { ! for($i=0; $i<count($majpos)/2; ++$i) { ! if( $this->ticks_label != null ) ! $this->img->StrokeText($majpos[$i*2],$majpos[$i*2+1],$this->ticks_label[$i]); ! else ! $this->img->StrokeText($majpos[$i*2],$majpos[$i*2+1],$majlabel[$i]); ! } } } Index: imgdata_diamonds.inc =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/imgdata_diamonds.inc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** imgdata_diamonds.inc 23 Jan 2005 22:33:08 -0000 1.4 --- imgdata_diamonds.inc 10 Jun 2005 01:07:34 -0000 1.5 *************** *** 7,12 **** // Ver: $Id$ // ! // License: This code is released under QPL 1.0 ! // Copyright (C) 2003 Johan Persson //======================================================================== --- 7,11 ---- // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== Index: jpgraph_pie.php =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/jpgraph_pie.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jpgraph_pie.php 23 Jan 2005 22:33:09 -0000 1.4 --- jpgraph_pie.php 10 Jun 2005 01:07:35 -0000 1.5 *************** *** 7,12 **** // Ver: $Id$ // ! // License: This code is released under QPL ! // Copyright (C) 2001,2002,2003 Johan Persson //======================================================================== */ --- 7,11 ---- // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== */ *************** *** 52,56 **** var $legendcsimalts = array(); var $adjusted_data = array(); ! //--------------- // CONSTRUCTOR --- 51,57 ---- var $legendcsimalts = array(); var $adjusted_data = array(); ! var $guideline = null,$guidelinemargin=10; ! var $iShowGuideLineForSingle = false; ! var $iGuideLineCurve = false,$iGuideVFactor=1.4,$iGuideLineRFactor=0.8; //--------------- // CONSTRUCTOR *************** *** 62,65 **** --- 63,67 ---- $this->value->Show(); $this->value->SetFormat('%.1f%%'); + $this->guideline = new LineProperty(); } *************** *** 71,74 **** --- 73,89 ---- } + // Enable guideline and set drwaing policy + function SetGuideLines($aFlg=true,$aCurved=true,$aAlways=false) { + $this->guideline->Show($aFlg); + $this->iShowGuideLineForSingle = $aAlways; + $this->iGuideLineCurve = $aCurved; + } + + // Adjuste the distance between labels and labels and pie + function SetGuideLinesAdjust($aVFactor,$aRFactor=0.8) { + $this->iGuideVFactor=$aVFactor; + $this->iGuideLineRFactor=$aRFactor; + } + function SetColor($aColor) { $this->color = $aColor; *************** *** 95,98 **** --- 110,114 ---- function AddSliceToCSIM($i,$xc,$yc,$radius,$sa,$ea) { + //Slice number, ellipse centre (x,y), height, width, start angle, end angle while( $sa > 2*M_PI ) $sa = $sa - 2*M_PI; *************** *** 109,116 **** $yp = floor($yc-$radius*sin($ea)); $coords.= ", $xp, $yp"; - //add coordinates every 0.2 radians $a=$ea+0.2; ! while ($a<$sa) { $xp = floor($radius*cos($a)+$xc); $yp = floor($yc-$radius*sin($a)); --- 125,144 ---- $yp = floor($yc-$radius*sin($ea)); $coords.= ", $xp, $yp"; //add coordinates every 0.2 radians $a=$ea+0.2; ! ! // If we cross the 260-limit with a slice we need to handle ! // the fact that end angle is smaller than start ! if( $sa < $ea ) { ! while ($a <= 2*M_PI) { ! $xp = floor($radius*cos($a)+$xc); ! $yp = floor($yc-$radius*sin($a)); ! $coords.= ", $xp, $yp"; ! $a += 0.2; ! } ! $a -= 2*M_PI; ! } ! ! while ($a < $sa) { $xp = floor($radius*cos($a)+$xc); $yp = floor($yc-$radius*sin($a)); *************** *** 208,211 **** --- 236,240 ---- } + // Deprecated. function SetValueType($aType) { $this->SetLabelType($aType); *************** *** 218,222 **** } ! // Setup the legends function Legend(&$graph) { $colors = array_keys($graph->img->rgb->rgb_table); --- 247,251 ---- } ! // Setup the legends (Framework method) function Legend(&$graph) { $colors = array_keys($graph->img->rgb->rgb_table); *************** *** 357,373 **** } else { ! // We need to create an array of colors as long as the data ! // since we need to reverse it to get the colors in the right order $numcolors=count($this->setslicecolors); ! if( $n > $numcolors ) { ! $i = 2*$numcolors; ! while( $n > $i ) { ! $this->setslicecolors = array_merge($this->setslicecolors,$this->setslicecolors); ! $i += $n; ! } ! $tt = array_slice($this->setslicecolors,0,$n % $numcolors); ! $this->setslicecolors = array_merge($this->setslicecolors,$tt); ! $this->setslicecolors = array_reverse($this->setslicecolors); ! } } --- 386,395 ---- } else { ! $this->setslicecolors = array_reverse(array_slice($this->setslicecolors,0,$n)); $numcolors=count($this->setslicecolors); ! $tt = array_slice($this->setslicecolors,$n % $numcolors); ! $tt2 = array_slice($this->setslicecolors,0,$n % $numcolors); ! $tt2 = array_merge($tt, $tt2); ! $this->setslicecolors = $tt + $tt2; } *************** *** 507,525 **** // PRIVATE METHODS ! function StrokeAllLabels($img,$xc,$yc,$radius) { $n = count($this->labels); for($i=0; $i < $n; ++$i) { ! $this->StrokeLabel($this->labels[$i],$img,$xc,$yc, ! $this->la[$i], ! $radius + $this->explode_radius[$n-$i-1]); } } // Position the labels of each slice ! function StrokeLabel($label,$img,$xc,$yc,$a,$r) { // Default value if( $this->ilabelposadj === 'auto' ) $this->ilabelposadj = 0.65; // We position the values diferently depending on if they are inside --- 529,843 ---- // PRIVATE METHODS ! function NormAngle($a) { ! while( $a < 0 ) $a += 2*M_PI; ! while( $a > 2*M_PI ) $a -= 2*M_PI; ! return $a; ! } ! ! function Quadrant($a) { ! $a=$this->NormAngle($a); ! if( $a > 0 && $a <= M_PI/2 ) ! return 0; ! if( $a > M_PI/2 && $a <= M_PI ) ! return 1; ! if( $a > M_PI && $a <= 1.5*M_PI ) ! return 2; ! if( $a > 1.5*M_PI ) ! return 3; ! } ! ! function StrokeGuideLabels($img,$xc,$yc,$radius) { $n = count($this->labels); + + //----------------------------------------------------------------------- + // Step 1 of the algorithm is to construct a number of clusters + // a cluster is defined as all slices within the same quadrant (almost) + // that has an angualr distance less than the treshold + //----------------------------------------------------------------------- + $tresh_hold=25 * M_PI/180; // 25 degrees difference to be in a cluster + $incluster=false; // flag if we are currently in a cluster or not + $clusters = array(); // array of clusters + $cidx=-1; // running cluster index + + // Go through all the labels and construct a number of clusters + for($i=0; $i < $n-1; ++$i) { + // Calc the angle distance between two consecutive slices + $a1=$this->la[$i]; + $a2=$this->la[$i+1]; + $q1 = $this->Quadrant($a1); + $q2 = $this->Quadrant($a2); + $diff = abs($a1-$a2); + if( $diff < $tresh_hold ) { + if( $incluster ) { + $clusters[$cidx][1]++; + // Each cluster can only cover one quadrant + // Do we cross a quadrant ( and must break the cluster) + if( $q1 != $q2 ) { + // If we cross a quadrant boundary we normally start a + // new cluster. However we need to take the 12'a clock + // and 6'a clock positions into a special consideration. + // Case 1: WE go from q=1 to q=2 if the last slice on + // the cluster for q=1 is close to 12'a clock and the + // first slice in q=0 is small we extend the previous + // cluster + if( $q1 == 1 && $q2 == 0 && $a2 > (90-15)*M_PI/180 ) { + if( $i < $n-2 ) { + $a3 = $this->la[$i+2]; + // If there isn't a cluster coming up with the next-next slice + // we extend the previous cluster to cover this slice as well + if( abs($a3-$a2) >= $tresh_hold ) { + $clusters[$cidx][1]++; + $i++; + } + } + } + elseif( $q1 == 3 && $q2 == 2 && $a2 > (270-15)*M_PI/180 ) { + if( $i < $n-2 ) { + $a3 = $this->la[$i+2]; + // If there isn't a cluster coming up with the next-next slice + // we extend the previous cluster to cover this slice as well + if( abs($a3-$a2) >= $tresh_hold ) { + $clusters[$cidx][1]++; + $i++; + } + } + } + + if( $q1==2 && $q2==1 && $a2 > (180-15)*M_PI/180 ) { + $clusters[$cidx][1]++; + $i++; + } + + $incluster = false; + } + } + elseif( $q1 == $q2) { + $incluster = true; + // Now we have a special case for quadrant 0. If we previously + // have a cluster of one in quadrant 0 we just extend that + // cluster. If we don't do this then we risk that the label + // for the cluster of one will cross the guide-line + if( $q1 == 0 && $cidx > -1 && + $clusters[$cidx][1] == 1 && + $this->Quadrant($this->la[$clusters[$cidx][0]]) == 0 ) { + $clusters[$cidx][1]++; + } + else { + $cidx++; + $clusters[$cidx][0] = $i; + $clusters[$cidx][1] = 1; + } + } + else { + // Create a "cluster" of one since we are just crossing + // a quadrant + $cidx++; + $clusters[$cidx][0] = $i; + $clusters[$cidx][1] = 1; + } + } + else { + if( $incluster ) { + // Add the last slice + $clusters[$cidx][1]++; + $incluster = false; + } + else { // Create a "cluster" of one + $cidx++; + $clusters[$cidx][0] = $i; + $clusters[$cidx][1] = 1; + } + } + } + // Handle the very last slice + if( $incluster ) { + $clusters[$cidx][1]++; + } + else { // Create a "cluster" of one + $cidx++; + $clusters[$cidx][0] = $i; + $clusters[$cidx][1] = 1; + } + + /* + if( true ) { + // Debug printout in labels + for( $i=0; $i <= $cidx; ++$i ) { + for( $j=0; $j < $clusters[$i][1]; ++$j ) { + $a = $this->la[$clusters[$i][0]+$j]; + $aa = round($a*180/M_PI); + $q = $this->Quadrant($a); + $this->labels[$clusters[$i][0]+$j]="[$q:$aa] $i:$j"; + } + } + } + */ + + //----------------------------------------------------------------------- + // Step 2 of the algorithm is use the clusters and draw the labels + // and guidelines + //----------------------------------------------------------------------- + + // We use the font height as the base factor for how far we need to + // spread the labels in the Y-direction. + $img->SetFont($this->value->ff,$this->value->fs,$this->value->fsize); + $fh = $img->GetFontHeight(); + $origvstep=$fh*$this->iGuideVFactor; + $this->value->SetMargin(0); + + // Number of clusters found + $nc = count($clusters); + + // Walk through all the clusters + for($i=0; $i < $nc; ++$i) { + + // Start angle and number of slices in this cluster + $csize = $clusters[$i][1]; + $a = $this->la[$clusters[$i][0]]; + $q = $this->Quadrant($a); + + // Now set up the start and end conditions to make sure that + // in each cluster we walk through the all the slices starting with the slice + // closest to the equator. Since all slices are numbered clockwise from "3'a clock" + // we have different conditions depending on in which quadrant the slice lies within. + if( $q == 0 ) { + $start = $csize-1; $idx = $start; $step = -1; $vstep = -$origvstep; + } + elseif( $q == 1 ) { + $start = 0; $idx = $start; $step = 1; $vstep = -$origvstep; + } + elseif( $q == 2 ) { + $start = $csize-1; $idx = $start; $step = -1; $vstep = $origvstep; + } + elseif( $q == 3 ) { + $start = 0; $idx = $start; $step = 1; $vstep = $origvstep; + } + + // Walk through all slices within this cluster + for($j=0; $j < $csize; ++$j) { + // Now adjust the position of the labels in each cluster starting + // with the slice that is closest to the equator of the pie + $a = $this->la[$clusters[$i][0]+$idx]; + + // Guide line start in the center of the arc of the slice + $r = $radius+$this->explode_radius[$n-1-($clusters[$i][0]+$idx)]; + $x = round($r*cos($a)+$xc); + $y = round($yc-$r*sin($a)); + + // The distance from the arc depends on chosen font and the "R-Factor" + $r += $fh*$this->iGuideLineRFactor; + + // Should the labels be placed curved along the pie or in straight columns + // outside the pie? + if( $this->iGuideLineCurve ) + $xt=round($r*cos($a)+$xc); + + // If this is the first slice in the cluster we need some first time + // proessing + if( $idx == $start ) { + if( ! $this->iGuideLineCurve ) + $xt=round($r*cos($a)+$xc); + $yt=round($yc-$r*sin($a)); + + // Some special consideration in case this cluster starts + // in quadrant 1 or 3 very close to the "equator" (< 20 degrees) + // and the previous clusters last slice is within the tolerance. + // In that case we add a font height to this labels Y-position + // so it doesn't collide with + // the slice in the previous cluster + $prevcluster = ($i + ($nc-1) ) % $nc; + $previdx=$clusters[$prevcluster][0]+$clusters[$prevcluster][1]-1; + if( $q == 1 && $a > 160*M_PI/180 ) { + // Get the angle for the previous clusters last slice + $diff = abs($a-$this->la[$previdx]); + if( $diff < $tresh_hold ) { + $yt -= $fh; + } + } + elseif( $q == 3 && $a > 340*M_PI/180 ) { + // We need to subtract 360 to compare angle distance between + // q=0 and q=3 + $diff = abs($a-$this->la[$previdx]-360*M_PI/180); + if( $diff < $tresh_hold ) { + $yt += $fh; + } + } + + } + else { + // The step is at minimum $vstep but if the slices are relatively large + // we make sure that we add at least a step that corresponds to the vertical + // distance between the centers at the arc on the slice + $prev_a = $this->la[$clusters[$i][0]+($idx-$step)]; + $dy = abs($radius*(sin($a)-sin($prev_a))*1.2); + if( $vstep > 0 ) + $yt += max($vstep,$dy); + else + $yt += min($vstep,-$dy); + } + + $label = $this->labels[$clusters[$i][0]+$idx]; + + if( $csize == 1 ) { + // A "meta" cluster with only one slice + $r = $radius+$this->explode_radius[$n-1-($clusters[$i][0]+$idx)]; + $rr = $r+$img->GetFontHeight()/2; + $xt=round($rr*cos($a)+$xc); + $yt=round($yc-$rr*sin($a)); + $this->StrokeLabel($label,$img,$xc,$yc,$a,$r); + if( $this->iShowGuideLineForSingle ) + $this->guideline->Stroke($img,$x,$y,$xt,$yt); + } + else { + $this->guideline->Stroke($img,$x,$y,$xt,$yt); + if( $q==1 || $q==2 ) { + // Left side of Pie + $this->guideline->Stroke($img,$xt,$yt,$xt-$this->guidelinemargin,$yt); + $lbladj = -$this->guidelinemargin-5; + $this->value->halign = "right"; + $this->value->valign = "center"; + } + else { + // Right side of pie + $this->guideline->Stroke($img,$xt,$yt,$xt+$this->guidelinemargin,$yt); + $lbladj = $this->guidelinemargin+5; + $this->value->halign = "left"; + $this->value->valign = "center"; + } + $this->value->Stroke($img,$label,$xt+$lbladj,$yt); + } + + // Udate idx to point to next slice in the cluster to process + $idx += $step; + } + } + } + + function StrokeAllLabels($img,$xc,$yc,$radius) { + // First normalize all angles for labels + $n = count($this->la); for($i=0; $i < $n; ++$i) { ! $this->la[$i] = $this->NormAngle($this->la[$i]); ! } ! if( $this->guideline->iShow ) { ! $this->StrokeGuideLabels($img,$xc,$yc,$radius); ! } ! else { ! $n = count($this->labels); ! for($i=0; $i < $n; ++$i) { ! $this->StrokeLabel($this->labels[$i],$img,$xc,$yc, ! $this->la[$i], ! $radius + $this->explode_radius[$n-1-$i]); ! } } } // Position the labels of each slice ! function StrokeLabel($label,$img,$xc,$yc,$a,$radius) { // Default value if( $this->ilabelposadj === 'auto' ) $this->ilabelposadj = 0.65; + $r = $radius; // We position the values diferently depending on if they are inside *************** *** 539,543 **** $this->value->halign = "left"; $this->value->valign = "top"; ! // Position the axis title. // dx, dy is the offset from the top left corner of the bounding box that sorrounds the text --- 857,862 ---- $this->value->halign = "left"; $this->value->valign = "top"; ! $this->value->margin = 0; ! // Position the axis title. // dx, dy is the offset from the top left corner of the bounding box that sorrounds the text *************** *** 557,572 **** else $w=$img->GetTextWidth($label); - if( $this->ilabelposadj > 1.0 && $this->ilabelposadj < 5.0) { $r *= $this->ilabelposadj; } - $r += $img->GetFontHeight()/1.5 + $this->value->margin ; $xt=round($r*cos($a)+$xc); $yt=round($yc-$r*sin($a)); while( $a < 0 ) $a += 2*M_PI; while( $a > 2*M_PI ) $a -= 2*M_PI; ! if( $a>=7*M_PI/4 || $a <= M_PI/4 ) $dx=0; if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dx=($a-M_PI/4)*2/M_PI; --- 876,892 ---- else $w=$img->GetTextWidth($label); if( $this->ilabelposadj > 1.0 && $this->ilabelposadj < 5.0) { $r *= $this->ilabelposadj; } + + $r += $img->GetFontHeight()/1.5; $xt=round($r*cos($a)+$xc); $yt=round($yc-$r*sin($a)); + // Normalize angle while( $a < 0 ) $a += 2*M_PI; while( $a > 2*M_PI ) $a -= 2*M_PI; ! if( $a>=7*M_PI/4 || $a <= M_PI/4 ) $dx=0; if( $a>=M_PI/4 && $a <= 3*M_PI/4 ) $dx=($a-M_PI/4)*2/M_PI; *************** *** 580,587 **** if( $a>=5*M_PI/4 && $a <= 7*M_PI/4 ) $dy=0; - $oldmargin = $this->value->margin ; - $this->value->margin = 0; $this->value->Stroke($img,$label,$xt-$dx*$w,$yt-$dy*$h); - $this->value->margin = $oldmargin ; } } --- 900,904 ---- *************** *** 644,647 **** --- 961,977 ---- //add coordinates every 0.25 radians $a=$ea+0.25; + + // If we cross the 260-limit with a slice we need to handle + // the fact that end angle is smaller than start + if( $sa < $ea ) { + while ($a <= 2*M_PI) { + $xp = floor($radius*cos($a)+$xc); + $yp = floor($yc-$radius*sin($a)); + $coords.= ", $xp, $yp"; + $a += 0.25; + } + $a -= 2*M_PI; + } + while ($a < $sa) { $xp = floor(($this->imidsize*$radius*cos($a)+$xc)); *************** *** 780,786 **** if( is_array($aObj) && count($aObj) > 0 ) ! $cl = strtolower(get_class($aObj[0])); else ! $cl = strtolower(get_class($aObj)); if( $cl == 'text' ) --- 1110,1116 ---- if( is_array($aObj) && count($aObj) > 0 ) ! $cl = get_class($aObj[0]); else ! $cl = get_class($aObj); if( $cl == 'text' ) *************** *** 792,796 **** $n = count($aObj); for($i=0; $i < $n; ++$i ) { ! $this->plots[] = &$aObj[$i]; } } --- 1122,1126 ---- $n = count($aObj); for($i=0; $i < $n; ++$i ) { ! $this->plots[] = $aObj[$i]; } } *************** *** 855,858 **** --- 1185,1190 ---- $this->iHasStroked = true; + + $n = count($this->plots); *************** *** 868,871 **** --- 1200,1204 ---- } + $w = $this->img->width; $h = $this->img->height; *************** *** 936,950 **** $this->legend->Stroke($this->img); $this->footer->Stroke($this->img); - $this->StrokeTitles(); - - // Stroke texts - if( $this->texts != null ) { - $n = count($this->texts); - for($i=0; $i < $n; ++$i ) { - $this->texts[$i]->Stroke($this->img); - } - } if( !$_csim ) { if( _JPG_DEBUG ) { --- 1269,1283 ---- $this->legend->Stroke($this->img); $this->footer->Stroke($this->img); if( !$_csim ) { + $this->StrokeTitles(); + + // Stroke texts + if( $this->texts != null ) { + $n = count($this->texts); + for($i=0; $i < $n; ++$i ) { + $this->texts[$i]->Stroke($this->img); + } + } if( _JPG_DEBUG ) { --- jpg-config.bak.inc DELETED --- Index: jpgraph_scatter.php =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/jpgraph_scatter.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jpgraph_scatter.php 23 Jan 2005 22:33:09 -0000 1.4 --- jpgraph_scatter.php 10 Jun 2005 01:07:35 -0000 1.5 *************** *** 7,12 **** // Ver: $Id$ // ! // License: This code is released under QPL ! // Copyright (C) 2001,2002 Johan Persson //======================================================================== */ --- 7,11 ---- // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== */ *************** *** 36,41 **** function Stroke($aImg,$x,$y,$a) { $old_origin = $aImg->SetCenter($x,$y); ! $old_a = $aImg->SetAngle(-$a); $dx = round($this->iSize/2); --- 35,44 ---- function Stroke($aImg,$x,$y,$a) { + // First rotate the center coordinates + list($x,$y) = $aImg->Rotate($x,$y); + $old_origin = $aImg->SetCenter($x,$y); ! $old_a = $aImg->a; ! $aImg->SetAngle(-$a+$old_a); $dx = round($this->iSize/2); Index: jpg-config.inc =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/jpg-config.inc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** jpg-config.inc 23 Jan 2005 22:33:08 -0000 1.2 --- jpg-config.inc 10 Jun 2005 01:07:34 -0000 1.3 *************** *** 7,12 **** // Ver: $Id$ // ! // License: This code is released under QPL 1.0 ! // Copyright (C) 2004 Johan Persson //======================================================================== --- 7,11 ---- // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== *************** *** 133,136 **** --- 132,142 ---- DEFINE("INSTALL_PHP_ERR_HANDLER",false); + // Should the library examin the global php_errmsg string and convert + // any error in it to a graphical representation. This is handy for the + // occasions when, for example, header files cannot be found and this results + // in the graph not being created and just a "red-cross" image would be seen. + // This should be turned off for a production site. + DEFINE("CATCH_PHPERRMSG",true); + // If the color palette is full should JpGraph try to allocate // the closest match? If you plan on using background images or Index: jpgraph_line.php =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/jpgraph_line.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jpgraph_line.php 23 Jan 2005 22:33:09 -0000 1.4 --- jpgraph_line.php 10 Jun 2005 01:07:35 -0000 1.5 *************** *** 7,12 **** // Ver: $Id$ // ! // License: This code is released under QPL ! // Copyright (C) 2001,2002 Johan Persson //======================================================================== */ --- 7,11 ---- // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== */ Index: imgdata_bevels.inc =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/imgdata_bevels.inc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** imgdata_bevels.inc 23 Jan 2005 22:33:08 -0000 1.4 --- imgdata_bevels.inc 10 Jun 2005 01:07:34 -0000 1.5 *************** *** 7,12 **** // Ver: $Id$ // ! // License: This code is released under QPL 1.0 ! // Copyright (C) 2003 Johan Persson //======================================================================== --- 7,11 ---- // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== Index: imgdata_stars.inc =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/imgdata_stars.inc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** imgdata_stars.inc 23 Jan 2005 22:33:08 -0000 1.4 --- imgdata_stars.inc 10 Jun 2005 01:07:34 -0000 1.5 *************** *** 7,12 **** // Ver: $Id$ // ! // License: This code is released under QPL 1.0 ! // Copyright (C) 2003 Johan Persson //======================================================================== --- 7,11 ---- // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== Index: jpgraph_canvas.php =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/jpgraph_canvas.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jpgraph_canvas.php 23 Jan 2005 22:33:09 -0000 1.4 --- jpgraph_canvas.php 10 Jun 2005 01:07:35 -0000 1.5 *************** *** 7,12 **** // Ver: $Id$ // ! // License: This code is released under QPL ! // Copyright (C) 2001,2002 Johan Persson //======================================================================== */ --- 7,11 ---- // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== */ --- NEW FILE: jpgraph_date.php --- <?php /*======================================================================= // File: JPGRAPH_DATE.PHP // Description: Classes to handle Date scaling // Created: 2005-05-02 // Author: Johan Persson (jo...@ad...) // Ver: $Id: jpgraph_date.php,v 1.1 2005/06/10 01:07:35 madbear Exp $ // // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== */ DEFINE('HOURADJ_1',0+30); DEFINE('HOURADJ_2',1+30); DEFINE('HOURADJ_3',2+30); DEFINE('HOURADJ_4',3+30); DEFINE('HOURADJ_6',4+30); DEFINE('HOURADJ_12',5+30); DEFINE('MINADJ_1',0+20); DEFINE('MINADJ_5',1+20); DEFINE('MINADJ_10',2+20); DEFINE('MINADJ_15',3+20); DEFINE('MINADJ_30',4+20); DEFINE('SECADJ_1',0); DEFINE('SECADJ_5',1); DEFINE('SECADJ_10',2); DEFINE('SECADJ_15',3); DEFINE('SECADJ_30',4); DEFINE('YEARADJ_1',0+30); DEFINE('YEARADJ_2',1+30); DEFINE('YEARADJ_5',2+30); DEFINE('MONTHADJ_1',0+20); DEFINE('MONTHADJ_6',1+20); DEFINE('DAYADJ_1',0); DEFINE('DAYADJ_WEEK',1); DEFINE('DAYADJ_7',1); DEFINE('SECPERYEAR',31536000); DEFINE('SECPERDAY',86400); DEFINE('SECPERHOUR',3600); DEFINE('SECPERMIN',60); class DateScale extends LinearScale { var $date_format = ''; var $iStartAlign = false, $iEndAlign = false; var $iStartTimeAlign = false, $iEndTimeAlign = false; //--------------- // CONSTRUCTOR function DateScale($aMin=0,$aMax=0,$aType='x') { assert($aType=="x"); assert($aMin<=$aMax); $this->type=$aType; $this->scale=array($aMin,$aMax); $this->world_size=$aMax-$aMin; $this->ticks = new LinearTicks(); $this->intscale=true; } //------------------------------------------------------------------------------------------ // Utility Function AdjDate() // Description: Will round a given time stamp to an even year, month or day // argument. //------------------------------------------------------------------------------------------ function AdjDate($aTime,$aRound=0,$aYearType=false,$aMonthType=false,$aDayType=false) { $y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime); $h=0;$i=0;$s=0; if( $aYearType !== false ) { $yearAdj = array(0=>1, 1=>2, 2=>5); if( $aRound == 0 ) { $y = floor($y/$yearAdj[$aYearType])*$yearAdj[$aYearType]; } else { ++$y; $y = ceil($y/$yearAdj[$aYearType])*$yearAdj[$aYearType]; } $m=1;$d=1; } elseif( $aMonthType !== false ) { $monthAdj = array(0=>1, 1=>6); if( $aRound == 0 ) { $m = floor($m/$monthAdj[$aMonthType])*$monthAdj[$aMonthType]; $d=1; } else { ++$m; $m = ceil($m/$monthAdj[$aMonthType])*$monthAdj[$aMonthType]; $d=1; } } elseif( $aDayType !== false ) { if( $aDayType == 0 ) { if( $aRound == 1 ) { //++$d; $h=23;$i=59;$s=59; } } else { // Adjust to an even week boundary. $w = (int)date('w',$aTime); // Day of week 0=Sun, 6=Sat if( true ) { // Adjust to start on Mon if( $w==0 ) $w=6; else --$w; } if( $aRound == 0 ) { $d -= $w; } else { $d += (7-$w); $h=23;$i=59;$s=59; } } } return mktime($h,$i,$s,$m,$d,$y); } //------------------------------------------------------------------------------------------ // Wrapper for AdjDate that will round a timestamp to an even date rounding // it downwards. //------------------------------------------------------------------------------------------ function AdjStartDate($aTime,$aYearType=false,$aMonthType=false,$aDayType=false) { return $this->AdjDate($aTime,0,$aYearType,$aMonthType,$aDayType); } //------------------------------------------------------------------------------------------ // Wrapper for AdjDate that will round a timestamp to an even date rounding // it upwards //------------------------------------------------------------------------------------------ function AdjEndDate($aTime,$aYearType=false,$aMonthType=false,$aDayType=false) { return $this->AdjDate($aTime,1,$aYearType,$aMonthType,$aDayType); } //------------------------------------------------------------------------------------------ // Utility Function AdjTime() // Description: Will round a given time stamp to an even time according to // argument. //------------------------------------------------------------------------------------------ function AdjTime($aTime,$aRound=0,$aHourType=false,$aMinType=false,$aSecType=false) { $y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime); $h = (int)date('H',$aTime); $i = (int)date('i',$aTime); $s = (int)date('s',$aTime); if( $aHourType !== false ) { $aHourType %= 6; $hourAdj = array(0=>1, 1=>2, 2=>3, 3=>4, 4=>6, 5=>12); if( $aRound == 0 ) $h = floor($h/$hourAdj[$aHourType])*$hourAdj[$aHourType]; else { if( ($h % $hourAdj[$aHourType]==0) && ($i > 0 || $s > 0) ) { $h++; } $h = ceil($h/$hourAdj[$aHourType])*$hourAdj[$aHourType]; if( $h >= 24 ) { $aTime += 86400; $y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime); $h -= 24; } } $i=0;$s=0; } elseif( $aMinType !== false ) { $aMinType %= 5; $minAdj = array(0=>1, 1=>5, 2=>10, 3=>15, 4=>30); if( $aRound == 0 ) { $i = floor($i/$minAdj[$aMinType])*$minAdj[$aMinType]; } else { if( ($i % $minAdj[$aMinType]==0) && $s > 0 ) { $i++; } $i = ceil($i/$minAdj[$aMinType])*$minAdj[$aMinType]; if( $i >= 60) { $aTime += 3600; $y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime); $h = (int)date('H',$aTime); $i = 0; } } $s=0; } elseif( $aSecType !== false ) { $aSecType %= 5; $secAdj = array(0=>1, 1=>5, 2=>10, 3=>15, 4=>30); if( $aRound == 0 ) { $s = floor($s/$secAdj[$aSecType])*$secAdj[$aSecType]; } else { $s = ceil($s/$secAdj[$aSecType]*1.0)*$secAdj[$aSecType]; if( $s >= 60) { $s=0; $aTime += 60; $y = (int)date('Y',$aTime); $m = (int)date('m',$aTime); $d = (int)date('d',$aTime); $h = (int)date('H',$aTime); $i = (int)date('i',$aTime); } } } return mktime($h,$i,$s,$m,$d,$y); } //------------------------------------------------------------------------------------------ // Wrapper for AdjTime that will round a timestamp to an even time rounding // it downwards. // Example: AdjStartTime(mktime(18,27,13,2,22,2005),false,2) => 18:20 //------------------------------------------------------------------------------------------ function AdjStartTime($aTime,$aHourType=false,$aMinType=false,$aSecType=false) { return $this->AdjTime($aTime,0,$aHourType,$aMinType,$aSecType); } //------------------------------------------------------------------------------------------ // Wrapper for AdjTime that will round a timestamp to an even time rounding // it upwards // Example: AdjEndTime(mktime(18,27,13,2,22,2005),false,2) => 18:30 //------------------------------------------------------------------------------------------ function AdjEndTime($aTime,$aHourType=false,$aMinType=false,$aSecType=false) { return $this->AdjTime($aTime,1,$aHourType,$aMinType,$aSecType); } //------------------------------------------------------------------------------------------ // DateAutoScale // Autoscale a date axis given start and end time // Returns an array ($start,$end,$major,$minor,$format) //------------------------------------------------------------------------------------------ function DoDateAutoScale($aStartTime,$aEndTime,$aDensity=0,$aAdjust=true) { $scalePoints = array( /* Intervall larger than 10 years */ SECPERYEAR*10,array(array(SECPERYEAR*5,SECPERYEAR*2),array(SECPERYEAR), array(0,YEARADJ_1, 0,YEARADJ_1) ), /* Intervall larger than 2 years */ SECPERYEAR*2,array(array(SECPERYEAR),array(SECPERYEAR), array(0,YEARADJ_1) ), /* Intervall larger than 90 days (approx 3 month) */ SECPERDAY*90,array(array(SECPERDAY*30,SECPERDAY*14,SECPERDAY*7,SECPERDAY),array(SECPERDAY*5,SECPERDAY*7,SECPERDAY,SECPERDAY), array(0,MONTHADJ_1, 0,DAYADJ_WEEK, 0,DAYADJ_1, 0,DAYADJ_1)), /* Intervall larger than 30 days (approx 1 month) */ SECPERDAY*30,array(array(SECPERDAY*14,SECPERDAY*7,SECPERDAY*2, SECPERDAY),array(SECPERDAY,SECPERDAY.SECPERDAY,SECPERDAY), array(0,DAYADJ_WEEK, 0,DAYADJ_1, 0,DAYADJ_1, 0,DAYADJ_1)), /* Intervall larger than 7 days */ SECPERDAY*7,array(array(SECPERDAY,SECPERHOUR*12,SECPERHOUR*6,SECPERHOUR*2),array(SECPERHOUR*6,SECPERHOUR*3,SECPERHOUR,SECPERHOUR), array(0,DAYADJ_1, 1,HOURADJ_12, 1,HOURADJ_6, 1,HOURADJ_1)), /* Intervall larger than 1 day */ SECPERDAY,array(array(SECPERDAY,SECPERHOUR*12,SECPERHOUR*6,SECPERHOUR*2,SECPERHOUR),array(SECPERHOUR*6,SECPERHOUR*2,SECPERHOUR,SECPERHOUR,SECPERHOUR), array(1,HOURADJ_12, 1,HOURADJ_6, 1,HOURADJ_1, 1,HOURADJ_1)), /* Intervall larger than 12 hours */ SECPERHOUR*12,array(array(SECPERHOUR*2,SECPERHOUR,SECPERMIN*30,900,600),array(1800,1800,900,300,300), array(1,HOURADJ_1, 1,MINADJ_30, 1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5) ), /* Intervall larger than 2 hours */ SECPERHOUR*2,array(array(SECPERHOUR,SECPERMIN*30,900,600,300),array(1800,900,300,120,60), array(1,HOURADJ_1, 1,MINADJ_30, 1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5) ), /* Intervall larger than 1 hours */ SECPERHOUR,array(array(SECPERMIN*30,900,600,300),array(900,300,120,60), array(1,MINADJ_30, 1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5) ), /* Intervall larger than 30 min */ SECPERMIN*30,array(array(SECPERMIN*15,SECPERMIN*10,SECPERMIN*5,SECPERMIN),array(300,300,60,10), array(1,MINADJ_15, 1,MINADJ_10, 1,MINADJ_5, 1,MINADJ_1)), /* Intervall larger than 1 min */ SECPERMIN,array(array(SECPERMIN,15,10,5),array(15,5,2,1), array(1,MINADJ_1, 1,SECADJ_15, 1,SECADJ_10, 1,SECADJ_5)), /* Intervall larger than 10 sec */ 10,array(array(5,2),array(1,1),array(1,SECADJ_5, 1,SECADJ_1)), /* Intervall larger than 1 sec */ 1,array(array(1),array(1),array(1,SECADJ_1)), ); $ns = count($scalePoints); // Establish major and minor scale units for the date scale $diff = $aEndTime - $aStartTime; if( $diff < 1 ) return false; $done=false; $i=0; while( ! $done ) { if( $diff > $scalePoints[2*$i] ) { // Get major and minor scale for this intervall $scaleSteps = $scalePoints[2*$i+1]; $major = $scaleSteps[0][min($aDensity,count($scaleSteps[0])-1)]; // Try to find out which minor step looks best $minor = $scaleSteps[1][min($aDensity,count($scaleSteps[1])-1)]; if( $aAdjust ) { // Find out how we should align the start and end timestamps $idx = 2*min($aDensity,floor(count($scaleSteps[2])/2)-1); if( $scaleSteps[2][$idx] === 0 ) { // Use date adjustment $adj = $scaleSteps[2][$idx+1]; if( $adj >= 30 ) { $start = $this->AdjStartDate($aStartTime,$adj-30); $end = $this->AdjEndDate($aEndTime,$adj-30); } elseif( $adj >= 20 ) { $start = $this->AdjStartDate($aStartTime,false,$adj-20); $end = $this->AdjEndDate($aEndTime,false,$adj-20); } else { $start = $this->AdjStartDate($aStartTime,false,false,$adj); $end = $this->AdjEndDate($aEndTime,false,false,$adj); // We add 1 second for date adjustment to make sure we end on 00:00 the following day // This makes the final major tick be srawn when we step day-by-day instead of ending // on xx:59:59 which would not draw the final major tick $end++; } } else { // Use time adjustment $adj = $scaleSteps[2][$idx+1]; if( $adj >= 30 ) { $start = $this->AdjStartTime($aStartTime,$adj-30); $end = $this->AdjEndTime($aEndTime,$adj-30); } elseif( $adj >= 20 ) { $start = $this->AdjStartTime($aStartTime,false,$adj-20); $end = $this->AdjEndTime($aEndTime,false,$adj-20); } else { $start = $this->AdjStartTime($aStartTime,false,false,$adj); $end = $this->AdjEndTime($aEndTime,false,false,$adj); } } } // If the overall date span is larger than 1 day ten we show date $format = ''; if( ($end-$start) > SECPERDAY ) { $format = 'Y-m-d '; } // If the major step is less than 1 day we need to whow hours + min if( $major < SECPERDAY ) { $format .= 'H:i'; } // If the major step is less than 1 min we need to show sec if( $major < 60 ) { $format .= ':s'; } $done=true; } ++$i; } return array($start,$end,$major,$minor,$format); } // Overrides the automatic determined date format. Must be a valid date() format string function SetDateFormat($aFormat) { $this->date_format = $aFormat; } function SetDateAlign($aStartAlign,$aEndAlign=false) { if( $aEndAlign === false ) { $aEndAlign=$aStartAlign; } $this->iStartAlign = $aStartAlign; $this->iEndAlign = $aEndAlign; } function SetTimeAlign($aStartAlign,$aEndAlign=false) { if( $aEndAlign === false ) { $aEndAlign=$aStartAlign; } $this->iStartTimeAlign = $aStartAlign; $this->iEndTimeAlign = $aEndAlign; } function AutoScale(&$img,$aStartTime,$aEndTime,$aNumSteps) { assert($aStartTime < $aEndTime); $done=false; $i=0; while( ! $done && $i < 5) { list($adjstart,$adjend,$maj,$min,$format) = $this->DoDateAutoScale($aStartTime,$aEndTime,$i); $n = floor(($adjend-$adjstart)/$maj); if( $n * 1.7 > $aNumSteps ) { $done=true; } $i++; } /* if( 0 ) { // DEBUG echo " Start =".date("Y-m-d H:i:s",$aStartTime)."<br>"; echo " End =".date("Y-m-d H:i:s",$aEndTime)."<br>"; echo "Adj Start =".date("Y-m-d H:i:s",$adjstart)."<br>"; echo "Adj End =".date("Y-m-d H:i:s",$adjend)."<p>"; echo "Major = $maj s, ".floor($maj/60)."min, ".floor($maj/3600)."h, ".floor($maj/86400)."day<br>"; echo "Min = $min s, ".floor($min/60)."min, ".floor($min/3600)."h, ".floor($min/86400)."day<br>"; echo "Format=$format<p>"; } */ if( $this->iStartTimeAlign !== false && $this->iStartAlign !== false ) { JpGraphError::Raise('It is only possible to use either SetDateAlign() or SetTimeAlign() but not both'); } if( $this->iStartTimeAlign !== false ) { if( $this->iStartTimeAlign >= 30 ) { $adjstart = $this->AdjStartTime($aStartTime,$this->iStartTimeAlign-30); } elseif( $this->iStartTimeAlign >= 20 ) { $adjstart = $this->AdjStartTime($aStartTime,false,$this->iStartTimeAlign-20); } else { $adjstart = $this->AdjStartTime($aStartTime,false,false,$this->iStartTimeAlign); } } if( $this->iEndTimeAlign !== false ) { if( $this->iEndTimeAlign >= 30 ) { $adjend = $this->AdjEndTime($aEndTime,$this->iEndTimeAlign-30); } elseif( $this->iEndTimeAlign >= 20 ) { $adjend = $this->AdjEndTime($aEndTime,false,$this->iEndTimeAlign-20); } else { $adjend = $this->AdjEndTime($aEndTime,false,false,$this->iEndTimeAlign); } } if( $this->iStartAlign !== false ) { if( $this->iStartAlign >= 30 ) { $adjstart = $this->AdjStartDate($aStartTime,$this->iStartAlign-30); } elseif( $this->iStartAlign >= 20 ) { $adjstart = $this->AdjStartDate($aStartTime,false,$this->iStartAlign-20); } else { $adjstart = $this->AdjStartDate($aStartTime,false,false,$this->iStartAlign); } } if( $this->iEndAlign !== false ) { if( $this->iEndAlign >= 30 ) { $adjend = $this->AdjEndDate($aEndTime,$this->iEndAlign-30); } elseif( $this->iEndAlign >= 20 ) { $adjend = $this->AdjEndDate($aEndTime,false,$this->iEndAlign-20); } else { $adjend = $this->AdjEndDate($aEndTime,false,false,$this->iEndAlign); } } $this->Update($img,$adjstart,$adjend); if( ! $this->ticks->IsSpecified() ) $this->ticks->Set($maj,$min); if( $this->date_format == '' ) $this->ticks->SetLabelDateFormat($format); else $this->ticks->SetLabelDateFormat($this->date_format); } } ?> Index: jpgraph_flags.php =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/jpgraph_flags.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jpgraph_flags.php 23 Jan 2005 22:33:09 -0000 1.4 --- jpgraph_flags.php 10 Jun 2005 01:07:35 -0000 1.5 *************** *** 7,12 **** // Ver: $Id$ // ! // License: This code is released under QPL 1.0 ! // Copyright (C) 2003 Johan Persson //======================================================================== --- 7,11 ---- // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== *************** *** 64,67 **** --- 63,67 ---- 'Republic of Chad' => 'chad', 'Republic of Chile' => 'chil', + 'Peoples Republic of China' => 'chin', 'Territory of Christmas Island' => 'chms', 'Commonwealth of Independent States' => 'cins', *************** *** 223,226 **** --- 223,227 ---- 'Kingdom of Swaziland' => 'szld', 'Republic of China' => 'taiw', + 'Taiwan' => 'taiw', 'Republic of Tajikistan' => 'tajk', 'United Republic of Tanzania' => 'tanz', *************** *** 337,348 **** $nlen = strlen($aName); reset($this->iCountryNameMap); ! // Match partial full country name or exact idx name while( list($key,$val) = each($this->iCountryNameMap) ) { ! if( strpos(strtolower($key), $aName) !== false || ! ($nlen == strlen($val) && $val == $aName) ) { $found=true; break; } } if( $found ) { $outFullName = $key; --- 338,358 ---- $nlen = strlen($aName); reset($this->iCountryNameMap); ! // Start by trying to match exact index name while( list($key,$val) = each($this->iCountryNameMap) ) { ! if( $nlen == strlen($val) && $val == $aName ) { $found=true; break; } } + if( !$found ) { + reset($this->iCountryNameMap); + // If the exact index doesn't work try a (partial) full name + while( list($key,$val) = each($this->iCountryNameMap) ) { + if( strpos(strtolower($key), $aName) !== false ) { + $found=true; + break; + } + } + } if( $found ) { $outFullName = $key; Index: imgdata_pushpins.inc =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/imgdata_pushpins.inc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** imgdata_pushpins.inc 23 Jan 2005 22:33:08 -0000 1.4 --- imgdata_pushpins.inc 10 Jun 2005 01:07:34 -0000 1.5 *************** *** 7,12 **** // Ver: $Id$ // ! // License: This code is released under QPL 1.0 ! // Copyright (C) 2003 Johan Persson //======================================================================== --- 7,11 ---- // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== Index: jpgraph_gb2312.php =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/jpgraph_gb2312.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jpgraph_gb2312.php 23 Jan 2005 22:33:09 -0000 1.4 --- jpgraph_gb2312.php 10 Jun 2005 01:07:35 -0000 1.5 *************** *** 7,12 **** // Ver: $Id$ // ! // License: This code is released under QPL 1.0 ! // Copyright (C) 2001,2002,2003 Johan Persson //======================================================================== --- 7,11 ---- // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== Index: jpgraph_pie3d.php =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/jpgraph_pie3d.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jpgraph_pie3d.php 23 Jan 2005 22:33:09 -0000 1.4 --- jpgraph_pie3d.php 10 Jun 2005 01:07:35 -0000 1.5 *************** *** 7,12 **** // Ver: $Id$ // ! // License: This code is released under QPL ! // Copyright (C) 2001,2002 Johan Persson //======================================================================== */ --- 7,11 ---- // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== */ Index: imgdata_balls.inc =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/imgdata_balls.inc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** imgdata_balls.inc 23 Jan 2005 22:33:08 -0000 1.4 --- imgdata_balls.inc 10 Jun 2005 01:07:34 -0000 1.5 *************** *** 7,12 **** // Ver: $Id$ // ! // License: This code is released under QPL 1.0 ! // Copyright (C) 2003 Johan Persson //======================================================================== --- 7,11 ---- // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== Index: jpgraph_bar.php =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/jpgraph_bar.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jpgraph_bar.php 23 Jan 2005 22:33:09 -0000 1.4 --- jpgraph_bar.php 10 Jun 2005 01:07:35 -0000 1.5 *************** *** 7,12 **** // Ver: $Id$ // ! // License: This code is released under QPL ! // Copyright (C) 2001,2002,2003 Johan Persson //======================================================================== */ --- 7,11 ---- // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== */ *************** *** 83,86 **** --- 82,101 ---- $this->legendcsimtarget,$this->legendcsimalt); } + elseif( $this->legend!="" && ($this->iPattern > -1 || is_array($this->iPattern)) ) { + if( is_array($this->iPattern) ) { + $p1 = $this->iPattern[0]; + $p2 = $this->iPatternColor[0]; + $p3 = $this->iPatternDensity[0]; + } + else { + $p1 = $this->iPattern; + $p2 = $this->iPatternColor; + $p3 = $this->iPatternDensity; + } + $color = array($p1,$p2,$p3,$this->fill_color); + // A kludge: Too mark that we add a pattern we use a type value of < 100 + $graph->legend->Add($this->legend,$color,"",-101, + $this->legendcsimtarget,$this->legendcsimalt); + } elseif( $this->fill_color && $this->legend!="" ) { if( is_array($this->fill_color) ) { *************** *** 243,251 **** case PATTERN_STRIPE1: $aPatternValue= 5; ! $aDensity = 90; break; case PATTERN_STRIPE2: $aPatternValue= 5; ! $aDensity = 75; break; default: --- 258,266 ---- case PATTERN_STRIPE1: $aPatternValue= 5; ! $aDensity = 95; break; case PATTERN_STRIPE2: $aPatternValue= 5; ! $aDensity = 85; break; default: Index: jpgraph_regstat.php =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/jpgraph_regstat.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jpgraph_regstat.php 23 Jan 2005 22:33:09 -0000 1.4 --- jpgraph_regstat.php 10 Jun 2005 01:07:35 -0000 1.5 *************** *** 7,12 **** // Ver: $Id$ // ! // License: This code is released under QPL ! // Copyright (C) 2002 Johan Persson //======================================================================== */ --- 7,11 ---- // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== */ Index: jpgraph.php =================================================================== RCS file: /cvsroot/netoffice/netoffice-2.x/includes/jpgraph/jpgraph.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** jpgraph.php 23 Jan 2005 22:33:08 -0000 1.5 --- jpgraph.php 10 Jun 2005 01:07:34 -0000 1.6 *************** *** 2,12 **** //======================================================================= // File: JPGRAPH.PHP ! // Description: PHP4 Graph Plotting library. Base module. // Created: 2001-01-08 // Author: Johan Persson (jo...@ad...) // Ver: $Id$ // ! // License: This code is released under QPL 1.0 ! // Copyright (C) 2001,2002,2003,2004 Johan Persson Aditus Consulting //======================================================================== --- 2,11 ---- //======================================================================= // File: JPGRAPH.PHP ! // Description: PHP Graph Plotting library. Base module. // Created: 2001-01-08 // Author: Johan Persson (jo...@ad...) // Ver: $Id$ // ! // Copyright (c) Aditus Consulting. All rights reserved. //======================================================================== *************** *** 14,18 **** // Version info ! DEFINE('JPG_VERSION','1.17beta2'); // For internal use only --- 13,17 ---- // Version info ! DEFINE('JPG_VERSION','1.18'); // For internal use only *************** *** 226,229 **** --- 225,229 ---- // in all methods. // + GLOBAL $__jpg_err; class JpGraphError { function Install($aErrObject) { *************** *** 463,467 **** //user // ! if( isset($GLOBALS['php_errormsg']) ) { JpGraphError::Raise("General PHP error : ".$GLOBALS['php_errormsg']); } --- 463,467 ---- //user // ! if( isset($GLOBALS['php_errormsg']) && CATCH_PHPERRMSG ) { JpGraphError::Raise("General PHP error : ".$GLOBALS['php_errormsg']); } *************** *** 529,532 **** --- 529,533 ---- // Translate iso encoding to unicode function iso2uni ($isoline){ + $uniline=''; for ($i=0; $i < strlen($isoline); $i++){ $thischar=substr($isoline,$i,1); *************** *** 746,766 **** var $plots=array(); // Array of all plot object in the graph (for Y 1 axis) var $y2plots=array();// Array of all plot object in the graph (for Y 2 axis) var $xscale=null; // X Scale object (could be instance of LinearScale or LogScale ! var $yscale=null,$y2scale=null; var $iIcons = array(); // Array of Icons to add to var $cache_name; // File name to be used for the current graph in the cache directory var $xgrid=null; // X Grid object (linear or logarithmic) ! var $ygrid=null,$y2grid=null; //dito for Y var $doframe=true,$frame_color=array(0,0,0), $frame_weight=1; // Frame around graph var $boxed=false, $box_color=array(0,0,0), $box_weight=1; // Box around plot area var $doshadow=false,$shadow_width=4,$shadow_color=array(102,102,102); // Shadow for graph var $xaxis=null; // X-axis (instane of Axis class) ! var $yaxis=null, $y2axis=null; // Y axis (instance of Axis class) var $margin_color=array(200,200,200); // Margin color of graph var $plotarea_color=array(255,255,255); // Plot area color var $title,$subtitle,$subsubtitle; // Title and subtitle(s) text object ! var $axtype="linlin"; // Type of axis ! var $xtick_factor; // Factot to determine the maximum number of ticks depending on the plot with ! var $texts=null, $y2texts=null; // Text object to ge shown in the graph var $lines=null, $y2lines=null; var $bands=null, $y2bands=null; --- 747,768 ---- var $plots=array(); // Array of all plot object in the graph (for Y 1 axis) var $y2plots=array();// Array of all plot object in the graph (for Y 2 axis) + var $ynplots=array(); var $xscale=null; // X Scale object (could be instance of LinearScale or LogScale ! var $yscale=null,$y2scale=null, $ynscale=array(); var $iIcons = array(); // Array of Icons to add to var $cache_name; // File name to be used for the current graph in the cache directory var $xgrid=null; // X Grid object (linear or logarithmic) ! var $ygrid=null,$y2grid=null, $yngrid=array(); //dito for Y var $doframe=true,$frame_color=array(0,0,0), $frame_weight=1; // Frame around graph var $boxed=false, $box_color=array(0,0,0), $box_weight=1; // Box around plot area var $doshadow=false,$shadow_width=4,$shadow_color=array(102,102,102); // Shadow for graph var $xaxis=null; // X-axis (instane of Axis class) ! var $yaxis=null, $y2axis=null, $ynaxis=array(); // Y axis (instance of Axis class) var $margin_color=array(200,200,200); // Margin color of graph var $plotarea_color=array(255,255,255); // Plot area color var $title,$subtitle,$subsubtitle; // Title and subtitle(s) text object ! var $axtype="linlin"; // Type of axis ! var $xtick_factor; // Factot to determine the maximum number of ticks depending on the plot with ! var $texts=null, $y2texts=null; // Text object to ge shown in the graph var $lines=null, $y2lines=null; var $bands=null, $y2bands=null; *************** *** 802,805 **** --- 804,809 ---- $iImgTransFillColor='white',$iImgTransHighQ=false, $iImgTransBorder=false,$iImgTransHorizonPos=0.5; + var $iYAxisDeltaPos=50; + var $iIconDepth=DEPTH_BACK; //--------------- *************** *** 857,860 **** --- 861,867 ---- $this->footer = new Footer(); + // Window doesn't like '?' in the file name so replace it with an '_' + $aCachedName = str_replace("?","_",$aCachedName); + // If the cached version exist just read it directly from the // cache, stream it back to browser and exit *************** *** 871,875 **** //--------------- // PUBLIC METHODS - // Enable final image perspective transformation function Set3DPerspective($aDir=1,$aHorizon=100,$aSkewDist=120,$aQuality=false,$aFillColor='#FFFFFF',$aBorder=false,$aMinSize=true,$aHorizonPos=0.5) { --- 878,881 ---- *************** *** 891,894 **** --- 897,904 ---- $this->grid_depth=$aDepth; } + + function SetIconDepth($aDepth) { + $this->iIconDepth=$aDepth; + } // Specify graph angle 0-360 degrees. *************** *** 983,987 **** $this->y2plots[] = &$aPlot; } ! // Add text object to the graph function AddText(&$aTxt,$aToY2=false) { --- 993,1014 ---- $this->y2plots... [truncated message content] |