@@ -108,8 +108,7 @@ discard block |
||
108 | 108 | foreach($this->Data as $Key => $Settings) |
109 | 109 | { |
110 | 110 | if ( isset($Settings["Connections"]) ) |
111 | - { $this->Data[$Key]["FreeZone"] = count($Settings["Connections"])*10 + 20; } |
|
112 | - else |
|
111 | + { $this->Data[$Key]["FreeZone"] = count($Settings["Connections"])*10 + 20; } else |
|
113 | 112 | { $this->Data[$Key]["FreeZone"] = 20; } |
114 | 113 | } |
115 | 114 | |
@@ -200,11 +199,12 @@ discard block |
||
200 | 199 | { |
201 | 200 | if ( is_array($Connections ) ) |
202 | 201 | { |
203 | - foreach($Connections as $Key => $Value) |
|
204 | - $this->Data[$NodeID]["Connections"][] = $Value; |
|
205 | - } |
|
206 | - else |
|
207 | - $this->Data[$NodeID]["Connections"][] = $Connections; |
|
202 | + foreach($Connections as $Key => $Value) { |
|
203 | + $this->Data[$NodeID]["Connections"][] = $Value; |
|
204 | + } |
|
205 | + } else { |
|
206 | + $this->Data[$NodeID]["Connections"][] = $Connections; |
|
207 | + } |
|
208 | 208 | } |
209 | 209 | } |
210 | 210 | |
@@ -228,8 +228,7 @@ discard block |
||
228 | 228 | if ( isset($Settings["Surrounding"]) ) { $this->Data[$NodeID]["BorderR"] = $this->Data[$NodeID]["R"] + $Settings["Surrounding"]; $this->Data[$NodeID]["BorderG"] = $this->Data[$NodeID]["G"] + $Settings["Surrounding"]; $this->Data[$NodeID]["BorderB"] = $this->Data[$NodeID]["B"] + $Settings["Surrounding"]; } |
229 | 229 | } |
230 | 230 | } |
231 | - } |
|
232 | - else |
|
231 | + } else |
|
233 | 232 | { |
234 | 233 | if ( isset($Settings["R"]) ) { $this->Data[$Nodes]["R"] = $Settings["R"]; } |
235 | 234 | if ( isset($Settings["G"]) ) { $this->Data[$Nodes]["G"] = $Settings["G"]; } |
@@ -301,8 +300,9 @@ discard block |
||
301 | 300 | { |
302 | 301 | if ( isset($Settings["Connections"]) ) |
303 | 302 | { |
304 | - foreach($Settings["Connections"] as $ID => $ConnectionID) |
|
305 | - $this->checkConnection($ConnectionID,$Key); |
|
303 | + foreach($Settings["Connections"] as $ID => $ConnectionID) { |
|
304 | + $this->checkConnection($ConnectionID,$Key); |
|
305 | + } |
|
306 | 306 | } |
307 | 307 | } |
308 | 308 | |
@@ -321,8 +321,7 @@ discard block |
||
321 | 321 | if ( $Settings["Type"] == NODE_TYPE_FREE ) |
322 | 322 | { |
323 | 323 | if ( isset($Settings["Connections"]) ) |
324 | - { $Connections = count($Settings["Connections"]); } |
|
325 | - else |
|
324 | + { $Connections = count($Settings["Connections"]); } else |
|
326 | 325 | { $Connections = 0; } |
327 | 326 | |
328 | 327 | $Ring = $MaxConnections - $Connections; |
@@ -332,16 +331,16 @@ discard block |
||
332 | 331 | $this->Data[$Key]["Y"] = sin(deg2rad($Angle)) * ($Ring*$this->RingSize) + $CenterY; |
333 | 332 | } |
334 | 333 | } |
335 | - } |
|
336 | - elseif ( $Algorithm == ALGORITHM_CENTRAL ) |
|
334 | + } elseif ( $Algorithm == ALGORITHM_CENTRAL ) |
|
337 | 335 | { |
338 | 336 | /* Put a weight on each nodes */ |
339 | 337 | foreach($this->Data as $Key => $Settings) |
340 | 338 | { |
341 | - if ( isset($Settings["Connections"]) ) |
|
342 | - $this->Data[$Key]["Weight"] = count($Settings["Connections"]); |
|
343 | - else |
|
344 | - $this->Data[$Key]["Weight"] = 0; |
|
339 | + if ( isset($Settings["Connections"]) ) { |
|
340 | + $this->Data[$Key]["Weight"] = count($Settings["Connections"]); |
|
341 | + } else { |
|
342 | + $this->Data[$Key]["Weight"] = 0; |
|
343 | + } |
|
345 | 344 | } |
346 | 345 | |
347 | 346 | $MaxConnections = $MaxConnections + 1; |
@@ -353,8 +352,7 @@ discard block |
||
353 | 352 | if ( $Settings["Type"] == NODE_TYPE_FREE ) |
354 | 353 | { |
355 | 354 | if ( isset($Settings["Connections"]) ) |
356 | - { $Connections = count($Settings["Connections"]); } |
|
357 | - else |
|
355 | + { $Connections = count($Settings["Connections"]); } else |
|
358 | 356 | { $Connections = 0; } |
359 | 357 | |
360 | 358 | if ( $Connections == $i ) |
@@ -389,8 +387,7 @@ discard block |
||
389 | 387 | } |
390 | 388 | } |
391 | 389 | } |
392 | - } |
|
393 | - elseif ( $Algorithm == ALGORITHM_CIRCULAR ) |
|
390 | + } elseif ( $Algorithm == ALGORITHM_CIRCULAR ) |
|
394 | 391 | { |
395 | 392 | $MaxConnections = $MaxConnections + 1; |
396 | 393 | for($i=$MaxConnections;$i>=0;$i--) |
@@ -401,8 +398,7 @@ discard block |
||
401 | 398 | if ( $Settings["Type"] == NODE_TYPE_FREE ) |
402 | 399 | { |
403 | 400 | if ( isset($Settings["Connections"]) ) |
404 | - { $Connections = count($Settings["Connections"]); } |
|
405 | - else |
|
401 | + { $Connections = count($Settings["Connections"]); } else |
|
406 | 402 | { $Connections = 0; } |
407 | 403 | |
408 | 404 | if ( $Connections == $i ) |
@@ -421,8 +417,7 @@ discard block |
||
421 | 417 | } |
422 | 418 | } |
423 | 419 | } |
424 | - } |
|
425 | - elseif ( $Algorithm == ALGORITHM_RANDOM ) |
|
420 | + } elseif ( $Algorithm == ALGORITHM_RANDOM ) |
|
426 | 421 | { |
427 | 422 | foreach($this->Data as $Key => $Settings) |
428 | 423 | { |
@@ -485,13 +480,14 @@ discard block |
||
485 | 480 | $Distance = $this->getDistance($X1,$Y1,$X2,$Y2); |
486 | 481 | $Angle = $this->getAngle($X1,$Y1,$X2,$Y2); |
487 | 482 | |
488 | - if ( $Distance > $FreeZone ) |
|
489 | - $Force = log(($Distance-$FreeZone)+1); |
|
490 | - else |
|
483 | + if ( $Distance > $FreeZone ) { |
|
484 | + $Force = log(($Distance-$FreeZone)+1); |
|
485 | + } else |
|
491 | 486 | { $Force = log(($FreeZone-$Distance)+1); ($Angle = $Angle + 180); } |
492 | 487 | |
493 | - if ( $Force > 1 ) |
|
494 | - $this->Data[$Key]["Vectors"][] = array("Type"=>"A","Angle"=>$Angle % 360,"Force"=>$Force); |
|
488 | + if ( $Force > 1 ) { |
|
489 | + $this->Data[$Key]["Vectors"][] = array("Type"=>"A","Angle"=>$Angle % 360,"Force"=>$Force); |
|
490 | + } |
|
495 | 491 | } |
496 | 492 | } |
497 | 493 | } |
@@ -719,10 +715,11 @@ discard block |
||
719 | 715 | $TxtX = ($X2 - $X)/2 + $X; |
720 | 716 | $TxtY = ($Y2 - $Y)/2 + $Y; |
721 | 717 | |
722 | - if ( $X <= $X2 ) |
|
723 | - $Angle = (360-$this->getAngle($X,$Y,$X2,$Y2)) % 360; |
|
724 | - else |
|
725 | - $Angle = (360-$this->getAngle($X2,$Y2,$X,$Y)) % 360; |
|
718 | + if ( $X <= $X2 ) { |
|
719 | + $Angle = (360-$this->getAngle($X,$Y,$X2,$Y2)) % 360; |
|
720 | + } else { |
|
721 | + $Angle = (360-$this->getAngle($X2,$Y2,$X,$Y)) % 360; |
|
722 | + } |
|
726 | 723 | |
727 | 724 | $Settings = $Color; |
728 | 725 | $Settings["Angle"] = $Angle; |
@@ -764,16 +761,14 @@ discard block |
||
764 | 761 | if ( $Shape == NODE_SHAPE_CIRCLE ) |
765 | 762 | { |
766 | 763 | $this->pChartObject->drawFilledCircle($X,$Y,$Size,$Color); |
767 | - } |
|
768 | - elseif ( $Shape == NODE_SHAPE_TRIANGLE ) |
|
764 | + } elseif ( $Shape == NODE_SHAPE_TRIANGLE ) |
|
769 | 765 | { |
770 | 766 | $Points = ""; |
771 | 767 | $Points[] = cos(deg2rad(270)) * $Size + $X; $Points[] = sin(deg2rad(270)) * $Size + $Y; |
772 | 768 | $Points[] = cos(deg2rad(45)) * $Size + $X; $Points[] = sin(deg2rad(45)) * $Size + $Y; |
773 | 769 | $Points[] = cos(deg2rad(135)) * $Size + $X; $Points[] = sin(deg2rad(135)) * $Size + $Y; |
774 | 770 | $this->pChartObject->drawPolygon($Points,$Color); |
775 | - } |
|
776 | - elseif ( $Shape == NODE_SHAPE_SQUARE ) |
|
771 | + } elseif ( $Shape == NODE_SHAPE_SQUARE ) |
|
777 | 772 | { |
778 | 773 | $Offset = $Size/2; $Size = $Size / 2; |
779 | 774 | $this->pChartObject->drawFilledRectangle($X-$Offset,$Y-$Offset,$X+$Offset,$Y+$Offset,$Color); |
@@ -787,8 +782,7 @@ discard block |
||
787 | 782 | { |
788 | 783 | $LabelOptions["Align"] = TEXT_ALIGN_BOTTOMLEFT; |
789 | 784 | $this->pChartObject->drawText($X,$Y,$Name,$LabelOptions); |
790 | - } |
|
791 | - elseif ( $this->Labels["Type"] == LABEL_CLASSIC ) |
|
785 | + } elseif ( $this->Labels["Type"] == LABEL_CLASSIC ) |
|
792 | 786 | { |
793 | 787 | $LabelOptions["Align"] = TEXT_ALIGN_TOPMIDDLE; |
794 | 788 | $LabelOptions["DrawBox"] = TRUE; |
@@ -169,22 +169,24 @@ discard block |
||
169 | 169 | { |
170 | 170 | $Points = $Backup; |
171 | 171 | |
172 | - if ( $NoFill ) |
|
173 | - $BorderSettings = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha); |
|
174 | - else |
|
175 | - $BorderSettings = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha); |
|
172 | + if ( $NoFill ) { |
|
173 | + $BorderSettings = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha); |
|
174 | + } else { |
|
175 | + $BorderSettings = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha); |
|
176 | + } |
|
176 | 177 | |
177 | 178 | for($i=0;$i<=count($Points)-1;$i=$i+2) |
178 | 179 | { |
179 | 180 | if ( isset($Points[$i+2]) ) |
180 | 181 | { |
181 | - if ( !($Points[$i] == $Points[$i+2] && $Points[$i] == $SkipX ) && !($Points[$i+1] == $Points[$i+3] && $Points[$i+1] == $SkipY ) ) |
|
182 | - $this->drawLine($Points[$i],$Points[$i+1],$Points[$i+2],$Points[$i+3],$BorderSettings); |
|
183 | - } |
|
184 | - else |
|
182 | + if ( !($Points[$i] == $Points[$i+2] && $Points[$i] == $SkipX ) && !($Points[$i+1] == $Points[$i+3] && $Points[$i+1] == $SkipY ) ) { |
|
183 | + $this->drawLine($Points[$i],$Points[$i+1],$Points[$i+2],$Points[$i+3],$BorderSettings); |
|
184 | + } |
|
185 | + } else |
|
185 | 186 | { |
186 | - if ( !($Points[$i] == $Points[0] && $Points[$i] == $SkipX ) && !($Points[$i+1] == $Points[1] && $Points[$i+1] == $SkipY ) ) |
|
187 | - $this->drawLine($Points[$i],$Points[$i+1],$Points[0],$Points[1],$BorderSettings); |
|
187 | + if ( !($Points[$i] == $Points[0] && $Points[$i] == $SkipX ) && !($Points[$i+1] == $Points[1] && $Points[$i+1] == $SkipY ) ) { |
|
188 | + $this->drawLine($Points[$i],$Points[$i+1],$Points[0],$Points[1],$BorderSettings); |
|
189 | + } |
|
188 | 190 | } |
189 | 191 | } |
190 | 192 | } |
@@ -236,8 +238,7 @@ discard block |
||
236 | 238 | $this->drawLine($X2,$Y1+$Radius,$X2,$Y2-$Radius,$Color); |
237 | 239 | $this->drawLine($X2-$Radius,$Y2,$X1+$Radius,$Y2,$Color); |
238 | 240 | $this->drawLine($X1,$Y1+$Radius,$X1,$Y2-$Radius,$Color); |
239 | - } |
|
240 | - else |
|
241 | + } else |
|
241 | 242 | { |
242 | 243 | $Color = $this->allocateColor($this->Picture,$R,$G,$B,$Alpha); |
243 | 244 | imageline($this->Picture,$X1+$Radius,$Y1,$X2-$Radius,$Y1,$Color); |
@@ -318,8 +319,7 @@ discard block |
||
318 | 319 | $Xp1++; |
319 | 320 | |
320 | 321 | if ( !isset($Positions[$Yp]) ) |
321 | - { $Positions[$Yp]["X1"] = $Xp1; $Positions[$Yp]["X2"] = $Xp2; } |
|
322 | - else |
|
322 | + { $Positions[$Yp]["X1"] = $Xp1; $Positions[$Yp]["X2"] = $Xp2; } else |
|
323 | 323 | { $Positions[$Yp]["X1"] = ($Positions[$Yp]["X1"]+$Xp1)/2; $Positions[$Yp]["X2"] = ($Positions[$Yp]["X2"]+$Xp2)/2; } |
324 | 324 | |
325 | 325 | $Xp1 = cos(($i+90)*PI/180) * $Radius + $X1 + $Radius; |
@@ -332,8 +332,7 @@ discard block |
||
332 | 332 | $Xp1++; |
333 | 333 | |
334 | 334 | if ( !isset($Positions[$Yp]) ) |
335 | - { $Positions[$Yp]["X1"] = $Xp1; $Positions[$Yp]["X2"] = $Xp2; } |
|
336 | - else |
|
335 | + { $Positions[$Yp]["X1"] = $Xp1; $Positions[$Yp]["X2"] = $Xp2; } else |
|
337 | 336 | { $Positions[$Yp]["X1"] = ($Positions[$Yp]["X1"]+$Xp1)/2; $Positions[$Yp]["X2"] = ($Positions[$Yp]["X2"]+$Xp2)/2; } |
338 | 337 | } |
339 | 338 | |
@@ -407,8 +406,9 @@ discard block |
||
407 | 406 | if ( $this->getFirstDecimal($Xp2) > 5 ) { $XOffset2 = 1; } else { $XOffset2 = 0; } |
408 | 407 | if ( $this->getFirstDecimal($Yp) > 5 ) { $YOffset = 1; } else { $YOffset = 0; } |
409 | 408 | |
410 | - if ( !isset($Drawn[$Yp+$YOffset]) || $Alpha == 100 ) |
|
411 | - imageline($this->Picture,$Xp1+$XOffset1,$Yp+$YOffset,$Xp2+$XOffset2,$Yp+$YOffset,$Color); |
|
409 | + if ( !isset($Drawn[$Yp+$YOffset]) || $Alpha == 100 ) { |
|
410 | + imageline($this->Picture,$Xp1+$XOffset1,$Yp+$YOffset,$Xp2+$XOffset2,$Yp+$YOffset,$Color); |
|
411 | + } |
|
412 | 412 | |
413 | 413 | $Drawn[$Yp+$YOffset] = $Xp2; |
414 | 414 | |
@@ -420,8 +420,9 @@ discard block |
||
420 | 420 | if ( $this->getFirstDecimal($Xp2) > 7 ) { $XOffset2 = 1; } else { $XOffset2 = 0; } |
421 | 421 | if ( $this->getFirstDecimal($Yp) > 5 ) { $YOffset = 1; } else { $YOffset = 0; } |
422 | 422 | |
423 | - if ( !isset($Drawn[$Yp+$YOffset]) || $Alpha == 100 ) |
|
424 | - imageline($this->Picture,$Xp1+$XOffset1,$Yp+$YOffset,$Xp2+$XOffset2,$Yp+$YOffset,$Color); |
|
423 | + if ( !isset($Drawn[$Yp+$YOffset]) || $Alpha == 100 ) { |
|
424 | + imageline($this->Picture,$Xp1+$XOffset1,$Yp+$YOffset,$Xp2+$XOffset2,$Yp+$YOffset,$Color); |
|
425 | + } |
|
425 | 426 | |
426 | 427 | $Drawn[$Yp+$YOffset] = $Xp2; |
427 | 428 | } |
@@ -452,16 +453,14 @@ discard block |
||
452 | 453 | $this->drawLine($X2,$Y1+1,$X2,$Y2-1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks)); |
453 | 454 | $this->drawLine($X2-1,$Y2,$X1+1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks)); |
454 | 455 | $this->drawLine($X1,$Y1+1,$X1,$Y2-1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks)); |
455 | - } |
|
456 | - else |
|
456 | + } else |
|
457 | 457 | { |
458 | 458 | $this->drawLine($X1+1,$Y1,$X2-1,$Y1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks)); |
459 | 459 | $this->drawLine($X2,$Y1,$X2,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks)); |
460 | 460 | $this->drawLine($X2-1,$Y2,$X1+1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks)); |
461 | 461 | $this->drawLine($X1,$Y1,$X1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks)); |
462 | 462 | } |
463 | - } |
|
464 | - else |
|
463 | + } else |
|
465 | 464 | { |
466 | 465 | $Color = $this->allocateColor($this->Picture,$R,$G,$B,$Alpha); |
467 | 466 | imagerectangle($this->Picture,$X1,$Y1,$X2,$Y2,$Color); |
@@ -507,9 +506,9 @@ discard block |
||
507 | 506 | imagefilledrectangle($this->Picture,ceil($X1)+1,ceil($Y1),floor($X2)-1,floor($Y2),$Color); |
508 | 507 | imageline($this->Picture,ceil($X1),ceil($Y1)+1,ceil($X1),floor($Y2)-1,$Color); |
509 | 508 | imageline($this->Picture,floor($X2),ceil($Y1)+1,floor($X2),floor($Y2)-1,$Color); |
510 | - } |
|
511 | - else |
|
512 | - imagefilledrectangle($this->Picture,ceil($X1),ceil($Y1),floor($X2),floor($Y2),$Color); |
|
509 | + } else { |
|
510 | + imagefilledrectangle($this->Picture,ceil($X1),ceil($Y1),floor($X2),floor($Y2),$Color); |
|
511 | + } |
|
513 | 512 | |
514 | 513 | if ( $Dash ) |
515 | 514 | { |
@@ -557,8 +556,9 @@ discard block |
||
557 | 556 | } |
558 | 557 | } |
559 | 558 | |
560 | - if ( $BorderR != -1 ) |
|
561 | - $this->drawRectangle($X1,$Y1,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$Ticks,"NoAngle"=>$NoAngle)); |
|
559 | + if ( $BorderR != -1 ) { |
|
560 | + $this->drawRectangle($X1,$Y1,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$Ticks,"NoAngle"=>$NoAngle)); |
|
561 | + } |
|
562 | 562 | |
563 | 563 | $this->Shadow = $RestoreShadow; |
564 | 564 | } |
@@ -596,8 +596,7 @@ discard block |
||
596 | 596 | |
597 | 597 | /* First segment */ |
598 | 598 | if ( $i == 1 ) |
599 | - { $Xv1 = $X1; $Yv1 = $Y1; } |
|
600 | - else |
|
599 | + { $Xv1 = $X1; $Yv1 = $Y1; } else |
|
601 | 600 | { |
602 | 601 | $Angle1 = $this->getAngle($XLast,$YLast,$X1,$Y1); |
603 | 602 | $Angle2 = $this->getAngle($X1,$Y1,$X2,$Y2); |
@@ -610,8 +609,7 @@ discard block |
||
610 | 609 | |
611 | 610 | /* Last segment */ |
612 | 611 | if ( $i == count($Coordinates)-1 ) |
613 | - { $Xv2 = $X2; $Yv2 = $Y2; } |
|
614 | - else |
|
612 | + { $Xv2 = $X2; $Yv2 = $Y2; } else |
|
615 | 613 | { |
616 | 614 | $Angle1 = $this->getAngle($X2,$Y2,$Coordinates[$i+1][0],$Coordinates[$i+1][1]); |
617 | 615 | $Angle2 = $this->getAngle($X1,$Y1,$X2,$Y2); |
@@ -653,9 +651,9 @@ discard block |
||
653 | 651 | { |
654 | 652 | $Length = $this->getLength($X1,$Y1,$X2,$Y2); |
655 | 653 | $Precision = ($Length*125)/1000; |
656 | - } |
|
657 | - else |
|
658 | - $Precision = $Segments; |
|
654 | + } else { |
|
655 | + $Precision = $Segments; |
|
656 | + } |
|
659 | 657 | |
660 | 658 | $P[0]["X"] = $X1; $P[0]["Y"] = $Y1; |
661 | 659 | $P[1]["X"] = $Xv1; $P[1]["Y"] = $Yv1; |
@@ -714,8 +712,9 @@ discard block |
||
714 | 712 | if ( $ArrowS == NULL && $LastX != NULL && $LastY != NULL ) |
715 | 713 | { $ArrowS["X2"] = $LastX; $ArrowS["Y2"] = $LastY; $ArrowS["X1"] = $X; $ArrowS["Y1"] = $Y; } |
716 | 714 | |
717 | - if ( $LastX != NULL && $LastY != NULL && !$PathOnly) |
|
718 | - list($Cpt,$Mode) = $this->drawLine($LastX,$LastY,$X,$Y,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Cpt"=>$Cpt,"Mode"=>$Mode,"Weight"=>$Weight)); |
|
715 | + if ( $LastX != NULL && $LastY != NULL && !$PathOnly) { |
|
716 | + list($Cpt,$Mode) = $this->drawLine($LastX,$LastY,$X,$Y,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Cpt"=>$Cpt,"Mode"=>$Mode,"Weight"=>$Weight)); |
|
717 | + } |
|
719 | 718 | |
720 | 719 | /* Get the last segment */ |
721 | 720 | $ArrowE["X1"] = $LastX; $ArrowE["Y1"] = $LastY; $ArrowE["X2"] = $X; $ArrowE["Y2"] = $Y; |
@@ -726,8 +725,9 @@ discard block |
||
726 | 725 | if ( $DrawArrow && !$PathOnly ) |
727 | 726 | { |
728 | 727 | $ArrowSettings = array("FillR"=>$R,"FillG"=>$G,"FillB"=>$B,"Alpha"=>$Alpha,"Size"=>$ArrowSize,"Ratio"=>$ArrowRatio); |
729 | - if ( $ArrowTwoHeads ) |
|
730 | - $this->drawArrow($ArrowS["X1"],$ArrowS["Y1"],$ArrowS["X2"],$ArrowS["Y2"],$ArrowSettings); |
|
728 | + if ( $ArrowTwoHeads ) { |
|
729 | + $this->drawArrow($ArrowS["X1"],$ArrowS["Y1"],$ArrowS["X2"],$ArrowS["Y2"],$ArrowSettings); |
|
730 | + } |
|
731 | 731 | |
732 | 732 | $this->drawArrow($ArrowE["X1"],$ArrowE["Y1"],$ArrowE["X2"],$ArrowE["Y2"],$ArrowSettings); |
733 | 733 | } |
@@ -779,8 +779,7 @@ discard block |
||
779 | 779 | $Points[] = cos(deg2rad($Angle-90)) * $Weight + $X2; $Points[] = sin(deg2rad($Angle-90)) * $Weight + $Y2; |
780 | 780 | |
781 | 781 | $this->drawPolygon($Points,$PolySettings); |
782 | - } |
|
783 | - else |
|
782 | + } else |
|
784 | 783 | { |
785 | 784 | for($i=0;$i<=$Distance;$i=$i+$Ticks*2) |
786 | 785 | { |
@@ -830,13 +829,14 @@ discard block |
||
830 | 829 | if ( $Cpt % $Ticks == 0 ) |
831 | 830 | { $Cpt = 0; if ( $Mode == 1 ) { $Mode = 0; } else { $Mode = 1; } } |
832 | 831 | |
833 | - if ( $Mode == 1 ) |
|
834 | - $this->drawAntialiasPixel($X,$Y,$Color); |
|
832 | + if ( $Mode == 1 ) { |
|
833 | + $this->drawAntialiasPixel($X,$Y,$Color); |
|
834 | + } |
|
835 | 835 | |
836 | 836 | $Cpt++; |
837 | - } |
|
838 | - else |
|
839 | - $this->drawAntialiasPixel($X,$Y,$Color); |
|
837 | + } else { |
|
838 | + $this->drawAntialiasPixel($X,$Y,$Color); |
|
839 | + } |
|
840 | 840 | } |
841 | 841 | |
842 | 842 | return(array($Cpt,$Mode)); |
@@ -882,13 +882,14 @@ discard block |
||
882 | 882 | if ( $Cpt % $Ticks == 0 ) |
883 | 883 | { $Cpt = 0; if ( $Mode == 1 ) { $Mode = 0; } else { $Mode = 1; } } |
884 | 884 | |
885 | - if ( $Mode == 1 ) |
|
886 | - $this->drawAntialiasPixel($X,$Y,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha)); |
|
885 | + if ( $Mode == 1 ) { |
|
886 | + $this->drawAntialiasPixel($X,$Y,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha)); |
|
887 | + } |
|
887 | 888 | |
888 | 889 | $Cpt++; |
889 | - } |
|
890 | - else |
|
891 | - $this->drawAntialiasPixel($X,$Y,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha)); |
|
890 | + } else { |
|
891 | + $this->drawAntialiasPixel($X,$Y,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha)); |
|
892 | + } |
|
892 | 893 | |
893 | 894 | } |
894 | 895 | $this->Shadow = $RestoreShadow; |
@@ -934,13 +935,15 @@ discard block |
||
934 | 935 | $this->Mask[$X+$XPos][$YPos] = TRUE; |
935 | 936 | imageline($this->Picture,$X-$XPos,$YPos,$X+$XPos,$YPos,$Color); |
936 | 937 | } |
937 | - if ( $this->Antialias ) |
|
938 | - $this->drawCircle($X,$Y,$Radius,$Radius,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks)); |
|
938 | + if ( $this->Antialias ) { |
|
939 | + $this->drawCircle($X,$Y,$Radius,$Radius,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks)); |
|
940 | + } |
|
939 | 941 | |
940 | 942 | $this->Mask = ""; |
941 | 943 | |
942 | - if ( $BorderR != -1 ) |
|
943 | - $this->drawCircle($X,$Y,$Radius,$Radius,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$Ticks)); |
|
944 | + if ( $BorderR != -1 ) { |
|
945 | + $this->drawCircle($X,$Y,$Radius,$Radius,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$Ticks)); |
|
946 | + } |
|
944 | 947 | |
945 | 948 | $this->Shadow = $RestoreShadow; |
946 | 949 | } |
@@ -1005,8 +1008,7 @@ discard block |
||
1005 | 1008 | $Settings = array("R"=>$BoxR,"G"=>$BoxG,"B"=>$BoxB,"Alpha"=>$BoxAlpha,"BorderR"=>$BoxBorderR,"BorderG"=>$BoxBorderG,"BorderB"=>$BoxBorderB,"BorderAlpha"=>$BoxBorderAlpha); |
1006 | 1009 | |
1007 | 1010 | if ( $BoxRounded ) |
1008 | - { $this->drawRoundedFilledRectangle($X1,$Y1,$X2,$Y2,$RoundedRadius,$Settings); } |
|
1009 | - else |
|
1011 | + { $this->drawRoundedFilledRectangle($X1,$Y1,$X2,$Y2,$RoundedRadius,$Settings); } else |
|
1010 | 1012 | { $this->drawFilledRectangle($X1,$Y1,$X2,$Y2,$Settings); } |
1011 | 1013 | } |
1012 | 1014 | |
@@ -1116,8 +1118,9 @@ discard block |
||
1116 | 1118 | $B = isset($Format["B"]) ? $Format["B"] : 0; |
1117 | 1119 | $Alpha = isset($Format["Alpha"]) ? $Format["Alpha"] : 100; |
1118 | 1120 | |
1119 | - if ( $X < 0 || $Y < 0 || $X >= $this->XSize || $Y >= $this->YSize ) |
|
1120 | - return(-1); |
|
1121 | + if ( $X < 0 || $Y < 0 || $X >= $this->XSize || $Y >= $this->YSize ) { |
|
1122 | + return(-1); |
|
1123 | + } |
|
1121 | 1124 | |
1122 | 1125 | if ( $R < 0 ) { $R = 0; } if ( $R > 255 ) { $R = 255; } |
1123 | 1126 | if ( $G < 0 ) { $G = 0; } if ( $G > 255 ) { $G = 255; } |
@@ -1143,12 +1146,12 @@ discard block |
||
1143 | 1146 | |
1144 | 1147 | if ( $Xi == $X && $Yi == $Y) |
1145 | 1148 | { |
1146 | - if ( $Alpha == 100 ) |
|
1147 | - $this->drawAlphaPixel($X,$Y,100,$R,$G,$B); |
|
1148 | - else |
|
1149 | - $this->drawAlphaPixel($X,$Y,$Alpha,$R,$G,$B); |
|
1150 | - } |
|
1151 | - else |
|
1149 | + if ( $Alpha == 100 ) { |
|
1150 | + $this->drawAlphaPixel($X,$Y,100,$R,$G,$B); |
|
1151 | + } else { |
|
1152 | + $this->drawAlphaPixel($X,$Y,$Alpha,$R,$G,$B); |
|
1153 | + } |
|
1154 | + } else |
|
1152 | 1155 | { |
1153 | 1156 | $Alpha1 = (((1 - ($X - floor($X))) * (1 - ($Y - floor($Y))) * 100) / 100) * $Alpha; |
1154 | 1157 | if ( $Alpha1 > $this->AntialiasQuality ) { $this->drawAlphaPixel($Xi,$Yi,$Alpha1,$R,$G,$B); } |
@@ -1169,8 +1172,9 @@ discard block |
||
1169 | 1172 | { |
1170 | 1173 | if ( isset($this->Mask[$X])) { if ( isset($this->Mask[$X][$Y]) ) { return(0); } } |
1171 | 1174 | |
1172 | - if ( $X < 0 || $Y < 0 || $X >= $this->XSize || $Y >= $this->YSize ) |
|
1173 | - return(-1); |
|
1175 | + if ( $X < 0 || $Y < 0 || $X >= $this->XSize || $Y >= $this->YSize ) { |
|
1176 | + return(-1); |
|
1177 | + } |
|
1174 | 1178 | |
1175 | 1179 | if ( $R < 0 ) { $R = 0; } if ( $R > 255 ) { $R = 255; } |
1176 | 1180 | if ( $G < 0 ) { $G = 0; } if ( $G > 255 ) { $G = 255; } |
@@ -1238,12 +1242,9 @@ discard block |
||
1238 | 1242 | list($Width,$Height) = $this->getPicInfo($FileName); |
1239 | 1243 | |
1240 | 1244 | if ( $PicType == 1 ) |
1241 | - { $Raster = imagecreatefrompng($FileName); } |
|
1242 | - elseif ( $PicType == 2 ) |
|
1243 | - { $Raster = imagecreatefromgif($FileName); } |
|
1244 | - elseif ( $PicType == 3 ) |
|
1245 | - { $Raster = imagecreatefromjpeg($FileName); } |
|
1246 | - else |
|
1245 | + { $Raster = imagecreatefrompng($FileName); } elseif ( $PicType == 2 ) |
|
1246 | + { $Raster = imagecreatefromgif($FileName); } elseif ( $PicType == 3 ) |
|
1247 | + { $Raster = imagecreatefromjpeg($FileName); } else |
|
1247 | 1248 | { return(0); } |
1248 | 1249 | |
1249 | 1250 | |
@@ -1251,9 +1252,9 @@ discard block |
||
1251 | 1252 | if ( $this->Shadow && $this->ShadowX != 0 && $this->ShadowY != 0 ) |
1252 | 1253 | { |
1253 | 1254 | $this->Shadow = FALSE; |
1254 | - if ( $PicType == 3 ) |
|
1255 | - $this->drawFilledRectangle($X+$this->ShadowX,$Y+$this->ShadowY,$X+$Width+$this->ShadowX,$Y+$Height+$this->ShadowY,array("R"=>$this->ShadowR,"G"=>$this->ShadowG,"B"=>$this->ShadowB,"Alpha"=>$this->Shadowa)); |
|
1256 | - else |
|
1255 | + if ( $PicType == 3 ) { |
|
1256 | + $this->drawFilledRectangle($X+$this->ShadowX,$Y+$this->ShadowY,$X+$Width+$this->ShadowX,$Y+$Height+$this->ShadowY,array("R"=>$this->ShadowR,"G"=>$this->ShadowG,"B"=>$this->ShadowB,"Alpha"=>$this->Shadowa)); |
|
1257 | + } else |
|
1257 | 1258 | { |
1258 | 1259 | $TranparentID = imagecolortransparent($Raster); |
1259 | 1260 | for ($Xc=0;$Xc<=$Width-1;$Xc++) |
@@ -1351,9 +1352,9 @@ discard block |
||
1351 | 1352 | $this->drawLine($Points[0],$Points[1],$Points[4],$Points[5],array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$Alpha)); |
1352 | 1353 | |
1353 | 1354 | $this->drawLine($TailX,$TailY,$TailX2,$TailY2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$Alpha,"Ticks"=>$Ticks)); |
1354 | - } |
|
1355 | - else |
|
1356 | - $this->drawLine($X1,$Y1,$TailX,$TailY,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$Alpha,"Ticks"=>$Ticks)); |
|
1355 | + } else { |
|
1356 | + $this->drawLine($X1,$Y1,$TailX,$TailY,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$Alpha,"Ticks"=>$Ticks)); |
|
1357 | + } |
|
1357 | 1358 | |
1358 | 1359 | /* Re-enable shadows */ |
1359 | 1360 | $this->Shadow = $RestoreShadow; |
@@ -1395,18 +1396,19 @@ discard block |
||
1395 | 1396 | if ( $Angle > 0 && $Angle < 180 ) |
1396 | 1397 | { |
1397 | 1398 | $this->drawLine($X2,$Y2,$X2-$TxtWidth,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$Alpha,"Ticks"=>$Ticks)); |
1398 | - if ( $Position == POSITION_TOP ) |
|
1399 | - $this->drawText($X2,$Y2-2,$Text,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$Alpha,"Align"=>TEXT_ALIGN_BOTTOMRIGHT)); |
|
1400 | - else |
|
1401 | - $this->drawText($X2,$Y2+4,$Text,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$Alpha,"Align"=>TEXT_ALIGN_TOPRIGHT)); |
|
1402 | - } |
|
1403 | - else |
|
1399 | + if ( $Position == POSITION_TOP ) { |
|
1400 | + $this->drawText($X2,$Y2-2,$Text,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$Alpha,"Align"=>TEXT_ALIGN_BOTTOMRIGHT)); |
|
1401 | + } else { |
|
1402 | + $this->drawText($X2,$Y2+4,$Text,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$Alpha,"Align"=>TEXT_ALIGN_TOPRIGHT)); |
|
1403 | + } |
|
1404 | + } else |
|
1404 | 1405 | { |
1405 | 1406 | $this->drawLine($X2,$Y2,$X2+$TxtWidth,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$Alpha,"Ticks"=>$Ticks)); |
1406 | - if ( $Position == POSITION_TOP ) |
|
1407 | - $this->drawText($X2,$Y2-2,$Text,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$Alpha)); |
|
1408 | - else |
|
1409 | - $this->drawText($X2,$Y2+4,$Text,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$Alpha,"Align"=>TEXT_ALIGN_TOPLEFT)); |
|
1407 | + if ( $Position == POSITION_TOP ) { |
|
1408 | + $this->drawText($X2,$Y2-2,$Text,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$Alpha)); |
|
1409 | + } else { |
|
1410 | + $this->drawText($X2,$Y2+4,$Text,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$Alpha,"Align"=>TEXT_ALIGN_TOPLEFT)); |
|
1411 | + } |
|
1410 | 1412 | } |
1411 | 1413 | } |
1412 | 1414 | |
@@ -1463,11 +1465,12 @@ discard block |
||
1463 | 1465 | $GradientOptions = array("StartR"=>$RFade,"StartG"=>$GFade,"StartB"=>$BFade,"EndR"=>$R,"EndG"=>$G,"EndB"=>$B); |
1464 | 1466 | $this->drawGradientArea($X+1,$Y-1,$X+$Width-1,$Y-$InnerHeight,DIRECTION_VERTICAL,$GradientOptions); |
1465 | 1467 | |
1466 | - if ( $Surrounding ) |
|
1467 | - $this->drawRectangle($X+1,$Y-1,$X+$Width-1,$Y-$InnerHeight,array("R"=>255,"G"=>255,"B"=>255,"Alpha"=>$Surrounding)); |
|
1468 | - } |
|
1469 | - else |
|
1470 | - $this->drawFilledRectangle($X+1,$Y-1,$X+$Width-1,$Y-$InnerHeight,array("R"=>$R,"G"=>$G,"B"=>$B,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB)); |
|
1468 | + if ( $Surrounding ) { |
|
1469 | + $this->drawRectangle($X+1,$Y-1,$X+$Width-1,$Y-$InnerHeight,array("R"=>255,"G"=>255,"B"=>255,"Alpha"=>$Surrounding)); |
|
1470 | + } |
|
1471 | + } else { |
|
1472 | + $this->drawFilledRectangle($X+1,$Y-1,$X+$Width-1,$Y-$InnerHeight,array("R"=>$R,"G"=>$G,"B"=>$B,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB)); |
|
1473 | + } |
|
1471 | 1474 | |
1472 | 1475 | $this->Shadow = $RestoreShadow; |
1473 | 1476 | |
@@ -1475,13 +1478,13 @@ discard block |
||
1475 | 1478 | if ( $ShowLabel && $LabelPos == LABEL_POS_TOP ) { $this->drawText($X+($Width/2),$Y-$Height-$Margin,$Percent."%",array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); } |
1476 | 1479 | if ( $ShowLabel && $LabelPos == LABEL_POS_INSIDE ) { $this->drawText($X+($Width/2),$Y-$InnerHeight-$Margin,$Percent."%",array("Align"=>TEXT_ALIGN_MIDDLELEFT,"Angle"=>90)); } |
1477 | 1480 | if ( $ShowLabel && $LabelPos == LABEL_POS_CENTER ) { $this->drawText($X+($Width/2),$Y-($Height/2),$Percent."%",array("Align"=>TEXT_ALIGN_MIDDLEMIDDLE,"Angle"=>90)); } |
1478 | - } |
|
1479 | - else |
|
1481 | + } else |
|
1480 | 1482 | { |
1481 | - if ( $Percent == 100 ) |
|
1482 | - $InnerWidth = $Width-1; |
|
1483 | - else |
|
1484 | - $InnerWidth = (($Width-2)/100)*$Percent; |
|
1483 | + if ( $Percent == 100 ) { |
|
1484 | + $InnerWidth = $Width-1; |
|
1485 | + } else { |
|
1486 | + $InnerWidth = (($Width-2)/100)*$Percent; |
|
1487 | + } |
|
1485 | 1488 | |
1486 | 1489 | $this->drawFilledRectangle($X,$Y,$X+$Width,$Y+$Height,array("R"=>$BoxBackR,"G"=>$BoxBackG,"B"=>$BoxBackB,"BorderR"=>$BoxBorderR,"BorderG"=>$BoxBorderG,"BorderB"=>$BoxBorderB,"NoAngle"=>$NoAngle)); |
1487 | 1490 | |
@@ -1491,11 +1494,12 @@ discard block |
||
1491 | 1494 | $GradientOptions = array("StartR"=>$R,"StartG"=>$G,"StartB"=>$B,"EndR"=>$RFade,"EndG"=>$GFade,"EndB"=>$BFade); |
1492 | 1495 | $this->drawGradientArea($X+1,$Y+1,$X+$InnerWidth,$Y+$Height-1,DIRECTION_HORIZONTAL,$GradientOptions); |
1493 | 1496 | |
1494 | - if ( $Surrounding ) |
|
1495 | - $this->drawRectangle($X+1,$Y+1,$X+$InnerWidth,$Y+$Height-1,array("R"=>255,"G"=>255,"B"=>255,"Alpha"=>$Surrounding)); |
|
1496 | - } |
|
1497 | - else |
|
1498 | - $this->drawFilledRectangle($X+1,$Y+1,$X+$InnerWidth,$Y+$Height-1,array("R"=>$R,"G"=>$G,"B"=>$B,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB)); |
|
1497 | + if ( $Surrounding ) { |
|
1498 | + $this->drawRectangle($X+1,$Y+1,$X+$InnerWidth,$Y+$Height-1,array("R"=>255,"G"=>255,"B"=>255,"Alpha"=>$Surrounding)); |
|
1499 | + } |
|
1500 | + } else { |
|
1501 | + $this->drawFilledRectangle($X+1,$Y+1,$X+$InnerWidth,$Y+$Height-1,array("R"=>$R,"G"=>$G,"B"=>$B,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB)); |
|
1502 | + } |
|
1499 | 1503 | |
1500 | 1504 | $this->Shadow = $RestoreShadow; |
1501 | 1505 | |
@@ -1554,8 +1558,7 @@ discard block |
||
1554 | 1558 | |
1555 | 1559 | $Lines = preg_split("/\n/",$Serie["Description"]); |
1556 | 1560 | $vY = $vY + max($this->FontSize*count($Lines),$IconAreaHeight) + 5; |
1557 | - } |
|
1558 | - elseif ( $Mode == LEGEND_HORIZONTAL ) |
|
1561 | + } elseif ( $Mode == LEGEND_HORIZONTAL ) |
|
1559 | 1562 | { |
1560 | 1563 | $Lines = preg_split("/\n/",$Serie["Description"]); |
1561 | 1564 | $Width = ""; |
@@ -1644,8 +1647,7 @@ discard block |
||
1644 | 1647 | |
1645 | 1648 | $Lines = preg_split("/\n/",$Serie["Description"]); |
1646 | 1649 | $vY = $vY + max($this->FontSize*count($Lines),$IconAreaHeight) + 5; |
1647 | - } |
|
1648 | - elseif ( $Mode == LEGEND_HORIZONTAL ) |
|
1650 | + } elseif ( $Mode == LEGEND_HORIZONTAL ) |
|
1649 | 1651 | { |
1650 | 1652 | $Lines = preg_split("/\n/",$Serie["Description"]); |
1651 | 1653 | $Width = ""; |
@@ -1669,10 +1671,11 @@ discard block |
||
1669 | 1671 | $TopOffset = $Y - $Boundaries["T"]; |
1670 | 1672 | if ( $Boundaries["B"]-($vY+$IconAreaHeight) < $TopOffset ) { $Boundaries["B"] = $vY+$IconAreaHeight+$TopOffset; } |
1671 | 1673 | |
1672 | - if ( $Style == LEGEND_ROUND ) |
|
1673 | - $this->drawRoundedFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB)); |
|
1674 | - elseif ( $Style == LEGEND_BOX ) |
|
1675 | - $this->drawFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB)); |
|
1674 | + if ( $Style == LEGEND_ROUND ) { |
|
1675 | + $this->drawRoundedFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB)); |
|
1676 | + } elseif ( $Style == LEGEND_BOX ) { |
|
1677 | + $this->drawFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB)); |
|
1678 | + } |
|
1676 | 1679 | |
1677 | 1680 | $RestoreShadow = $this->Shadow; $this->Shadow = FALSE; |
1678 | 1681 | foreach($Data["Series"] as $SerieName => $Serie) |
@@ -1689,8 +1692,7 @@ discard block |
||
1689 | 1692 | $PicX = $X+$IconAreaWidth/2; $PicY = $Y+$IconAreaHeight/2; |
1690 | 1693 | |
1691 | 1694 | $this->drawFromPNG($PicX-$PicWidth/2,$PicY-$PicHeight/2,$Picture); |
1692 | - } |
|
1693 | - else |
|
1695 | + } else |
|
1694 | 1696 | { |
1695 | 1697 | if ( $Family == LEGEND_FAMILY_BOX ) |
1696 | 1698 | { |
@@ -1699,13 +1701,11 @@ discard block |
||
1699 | 1701 | |
1700 | 1702 | $this->drawFilledRectangle($X+1+$XOffset,$Y+1+$YOffset,$X+$BoxWidth+$XOffset+1,$Y+$BoxHeight+1+$YOffset,array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); |
1701 | 1703 | $this->drawFilledRectangle($X+$XOffset,$Y+$YOffset,$X+$BoxWidth+$XOffset,$Y+$BoxHeight+$YOffset,array("R"=>$R,"G"=>$G,"B"=>$B,"Surrounding"=>20)); |
1702 | - } |
|
1703 | - elseif ( $Family == LEGEND_FAMILY_CIRCLE ) |
|
1704 | + } elseif ( $Family == LEGEND_FAMILY_CIRCLE ) |
|
1704 | 1705 | { |
1705 | 1706 | $this->drawFilledCircle($X+1+$IconAreaWidth/2,$Y+1+$IconAreaHeight/2,min($IconAreaHeight/2,$IconAreaWidth/2),array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); |
1706 | 1707 | $this->drawFilledCircle($X+$IconAreaWidth/2,$Y+$IconAreaHeight/2,min($IconAreaHeight/2,$IconAreaWidth/2),array("R"=>$R,"G"=>$G,"B"=>$B,"Surrounding"=>20)); |
1707 | - } |
|
1708 | - elseif ( $Family == LEGEND_FAMILY_LINE ) |
|
1708 | + } elseif ( $Family == LEGEND_FAMILY_LINE ) |
|
1709 | 1709 | { |
1710 | 1710 | $this->drawLine($X+1,$Y+1+$IconAreaHeight/2,$X+1+$IconAreaWidth,$Y+1+$IconAreaHeight/2,array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>20,"Ticks"=>$Ticks,"Weight"=>$Weight)); |
1711 | 1711 | $this->drawLine($X,$Y+$IconAreaHeight/2,$X+$IconAreaWidth,$Y+$IconAreaHeight/2,array("R"=>$R,"G"=>$G,"B"=>$B,"Ticks"=>$Ticks,"Weight"=>$Weight)); |
@@ -1715,12 +1715,12 @@ discard block |
||
1715 | 1715 | if ( $Mode == LEGEND_VERTICAL ) |
1716 | 1716 | { |
1717 | 1717 | $Lines = preg_split("/\n/",$Serie["Description"]); |
1718 | - foreach($Lines as $Key => $Value) |
|
1719 | - $this->drawText($X+$IconAreaWidth+4,$Y+$IconAreaHeight/2+(($this->FontSize+3)*$Key),$Value,array("R"=>$FontR,"G"=>$FontG,"B"=>$FontB,"Align"=>TEXT_ALIGN_MIDDLELEFT,"FontSize"=>$FontSize,"FontName"=>$FontName)); |
|
1718 | + foreach($Lines as $Key => $Value) { |
|
1719 | + $this->drawText($X+$IconAreaWidth+4,$Y+$IconAreaHeight/2+(($this->FontSize+3)*$Key),$Value,array("R"=>$FontR,"G"=>$FontG,"B"=>$FontB,"Align"=>TEXT_ALIGN_MIDDLELEFT,"FontSize"=>$FontSize,"FontName"=>$FontName)); |
|
1720 | + } |
|
1720 | 1721 | |
1721 | 1722 | $Y=$Y+max($this->FontSize*count($Lines),$IconAreaHeight) + 5; |
1722 | - } |
|
1723 | - elseif ( $Mode == LEGEND_HORIZONTAL ) |
|
1723 | + } elseif ( $Mode == LEGEND_HORIZONTAL ) |
|
1724 | 1724 | { |
1725 | 1725 | $Lines = preg_split("/\n/",$Serie["Description"]); |
1726 | 1726 | $Width = ""; |
@@ -1829,12 +1829,9 @@ discard block |
||
1829 | 1829 | if ( $AxisParameter["Identity"] == AXIS_X ) { $GotXAxis = TRUE; } |
1830 | 1830 | |
1831 | 1831 | if ( $Pos == SCALE_POS_LEFTRIGHT && $AxisParameter["Identity"] == AXIS_Y) |
1832 | - { $Height = $this->GraphAreaY2-$this->GraphAreaY1 - $YMargin*2; } |
|
1833 | - elseif ( $Pos == SCALE_POS_LEFTRIGHT && $AxisParameter["Identity"] == AXIS_X) |
|
1834 | - { $Height = $this->GraphAreaX2-$this->GraphAreaX1; } |
|
1835 | - elseif ( $Pos == SCALE_POS_TOPBOTTOM && $AxisParameter["Identity"] == AXIS_Y) |
|
1836 | - { $Height = $this->GraphAreaX2-$this->GraphAreaX1 - $YMargin*2;; } |
|
1837 | - else |
|
1832 | + { $Height = $this->GraphAreaY2-$this->GraphAreaY1 - $YMargin*2; } elseif ( $Pos == SCALE_POS_LEFTRIGHT && $AxisParameter["Identity"] == AXIS_X) |
|
1833 | + { $Height = $this->GraphAreaX2-$this->GraphAreaX1; } elseif ( $Pos == SCALE_POS_TOPBOTTOM && $AxisParameter["Identity"] == AXIS_Y) |
|
1834 | + { $Height = $this->GraphAreaX2-$this->GraphAreaX1 - $YMargin*2;; } else |
|
1838 | 1835 | { $Height = $this->GraphAreaY2-$this->GraphAreaY1; } |
1839 | 1836 | |
1840 | 1837 | $AxisMin = ABSOLUTE_MAX; $AxisMax = OUT_OF_SIGHT; |
@@ -1852,18 +1849,15 @@ discard block |
||
1852 | 1849 | |
1853 | 1850 | $Data["Axis"][$AxisID]["Min"] = $AxisMin-$AutoMargin; $Data["Axis"][$AxisID]["Max"] = $AxisMax+$AutoMargin; |
1854 | 1851 | if ( $Mode == SCALE_MODE_START0 ) { $Data["Axis"][$AxisID]["Min"] = 0; } |
1855 | - } |
|
1856 | - elseif ( $Mode == SCALE_MODE_MANUAL ) |
|
1852 | + } elseif ( $Mode == SCALE_MODE_MANUAL ) |
|
1857 | 1853 | { |
1858 | 1854 | if ( isset($ManualScale[$AxisID]["Min"]) && isset($ManualScale[$AxisID]["Max"]) ) |
1859 | 1855 | { |
1860 | 1856 | $Data["Axis"][$AxisID]["Min"] = $ManualScale[$AxisID]["Min"]; |
1861 | 1857 | $Data["Axis"][$AxisID]["Max"] = $ManualScale[$AxisID]["Max"]; |
1862 | - } |
|
1863 | - else |
|
1858 | + } else |
|
1864 | 1859 | { echo "Manual scale boundaries not set."; exit(); } |
1865 | - } |
|
1866 | - elseif ( $Mode == SCALE_MODE_ADDALL || $Mode == SCALE_MODE_ADDALL_START0 ) |
|
1860 | + } elseif ( $Mode == SCALE_MODE_ADDALL || $Mode == SCALE_MODE_ADDALL_START0 ) |
|
1867 | 1861 | { |
1868 | 1862 | $Series = ""; |
1869 | 1863 | foreach($Data["Series"] as $SerieID => $SerieParameter) |
@@ -1911,12 +1905,12 @@ discard block |
||
1911 | 1905 | if ( $Abscissa != NULL ) |
1912 | 1906 | { |
1913 | 1907 | $Points = count($Data["Series"][$Abscissa]["Data"]); |
1914 | - if ( $AutoAxisLabels ) |
|
1915 | - $AxisName = isset($Data["Series"][$Abscissa]["Description"]) ? $Data["Series"][$Abscissa]["Description"] : NULL; |
|
1916 | - else |
|
1917 | - $AxisName = NULL; |
|
1918 | - } |
|
1919 | - else |
|
1908 | + if ( $AutoAxisLabels ) { |
|
1909 | + $AxisName = isset($Data["Series"][$Abscissa]["Description"]) ? $Data["Series"][$Abscissa]["Description"] : NULL; |
|
1910 | + } else { |
|
1911 | + $AxisName = NULL; |
|
1912 | + } |
|
1913 | + } else |
|
1920 | 1914 | { |
1921 | 1915 | $Points = 0; |
1922 | 1916 | $AxisName = isset($Data["XAxisName"]) ? $Data["XAxisName"] : NULL; |
@@ -1931,16 +1925,15 @@ discard block |
||
1931 | 1925 | if ( $XMargin == AUTO ) |
1932 | 1926 | { |
1933 | 1927 | if ( $Pos == SCALE_POS_LEFTRIGHT ) |
1934 | - { $Height = $this->GraphAreaX2-$this->GraphAreaX1; } |
|
1935 | - else |
|
1928 | + { $Height = $this->GraphAreaX2-$this->GraphAreaX1; } else |
|
1936 | 1929 | { $Height = $this->GraphAreaY2-$this->GraphAreaY1; } |
1937 | 1930 | |
1938 | - if ( $Points == 1 ) |
|
1939 | - $Data["Axis"][$AxisID]["Margin"] = $Height / 2; |
|
1940 | - else |
|
1941 | - $Data["Axis"][$AxisID]["Margin"] = ($Height/$Points) / 2; |
|
1942 | - } |
|
1943 | - else |
|
1931 | + if ( $Points == 1 ) { |
|
1932 | + $Data["Axis"][$AxisID]["Margin"] = $Height / 2; |
|
1933 | + } else { |
|
1934 | + $Data["Axis"][$AxisID]["Margin"] = ($Height/$Points) / 2; |
|
1935 | + } |
|
1936 | + } else |
|
1944 | 1937 | { $Data["Axis"][$AxisID]["Margin"] = $XMargin; } |
1945 | 1938 | $Data["Axis"][$AxisID]["Rows"] = $Points-1; |
1946 | 1939 | if ( !isset($Data["Axis"][$AxisID]["Display"]) ) { $Data["Axis"][$AxisID]["Display"] = NULL; } |
@@ -1952,8 +1945,7 @@ discard block |
||
1952 | 1945 | if ( $Pos != SCALE_POS_LEFTRIGHT ) |
1953 | 1946 | { |
1954 | 1947 | if ( $Data["AbsicssaPosition"] == AXIS_POSITION_BOTTOM ) |
1955 | - { $Data["AbsicssaPosition"] = AXIS_POSITION_LEFT; } |
|
1956 | - else |
|
1948 | + { $Data["AbsicssaPosition"] = AXIS_POSITION_LEFT; } else |
|
1957 | 1949 | { $Data["AbsicssaPosition"] = AXIS_POSITION_RIGHT; } |
1958 | 1950 | } |
1959 | 1951 | $Data["Axis"][$AxisID]["Position"] = $Data["AbsicssaPosition"]; |
@@ -1972,8 +1964,7 @@ discard block |
||
1972 | 1964 | $AxisR = $Parameters["Color"]["R"]; $AxisG = $Parameters["Color"]["G"]; $AxisB = $Parameters["Color"]["B"]; |
1973 | 1965 | $TickR = $Parameters["Color"]["R"]; $TickG = $Parameters["Color"]["G"]; $TickB = $Parameters["Color"]["B"]; |
1974 | 1966 | $this->setFontProperties(array("R"=>$Parameters["Color"]["R"],"G"=>$Parameters["Color"]["G"],"B"=>$Parameters["Color"]["B"])); |
1975 | - } |
|
1976 | - else |
|
1967 | + } else |
|
1977 | 1968 | { |
1978 | 1969 | $AxisR = $AxisRo; $AxisG = $AxisGo; $AxisB = $AxisBo; |
1979 | 1970 | $TickR = $TickRo; $TickG = $TickGo; $TickB = $TickBo; |
@@ -1995,8 +1986,7 @@ discard block |
||
1995 | 1986 | if ( !$RemoveXAxis ) |
1996 | 1987 | { |
1997 | 1988 | if ( $Floating ) |
1998 | - { $FloatingOffset = $YMargin; $this->drawLine($this->GraphAreaX1+$Parameters["Margin"],$AxisPos["B"],$this->GraphAreaX2-$Parameters["Margin"],$AxisPos["B"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
|
1999 | - else |
|
1989 | + { $FloatingOffset = $YMargin; $this->drawLine($this->GraphAreaX1+$Parameters["Margin"],$AxisPos["B"],$this->GraphAreaX2-$Parameters["Margin"],$AxisPos["B"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } else |
|
2000 | 1990 | { $FloatingOffset = 0; $this->drawLine($this->GraphAreaX1,$AxisPos["B"],$this->GraphAreaX2,$AxisPos["B"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
2001 | 1991 | |
2002 | 1992 | if ( $DrawArrows ) { $this->drawArrow($this->GraphAreaX2-$Parameters["Margin"],$AxisPos["B"],$this->GraphAreaX2+($ArrowSize*2),$AxisPos["B"],array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); } |
@@ -2013,13 +2003,13 @@ discard block |
||
2013 | 2003 | $YPos = $AxisPos["B"]; |
2014 | 2004 | |
2015 | 2005 | if ( $Abscissa != NULL ) |
2016 | - { if ( isset($Data["Series"][$Abscissa]["Data"][$i]) ) { $Value = $this->scaleFormat($Data["Series"][$Abscissa]["Data"][$i],$Data["XAxisDisplay"],$Data["XAxisFormat"],$Data["XAxisUnit"]); } else { $Value = ""; } } |
|
2017 | - else |
|
2006 | + { if ( isset($Data["Series"][$Abscissa]["Data"][$i]) ) { $Value = $this->scaleFormat($Data["Series"][$Abscissa]["Data"][$i],$Data["XAxisDisplay"],$Data["XAxisFormat"],$Data["XAxisUnit"]); } else { $Value = ""; } } else |
|
2018 | 2007 | { |
2019 | - if ( isset($Parameters["ScaleMin"]) && isset ($Parameters["RowHeight"]) ) |
|
2020 | - $Value = $this->scaleFormat($Parameters["ScaleMin"] + $Parameters["RowHeight"]*$i,$Data["XAxisDisplay"],$Data["XAxisFormat"],$Data["XAxisUnit"]); |
|
2021 | - else |
|
2022 | - $Value = $i; |
|
2008 | + if ( isset($Parameters["ScaleMin"]) && isset ($Parameters["RowHeight"]) ) { |
|
2009 | + $Value = $this->scaleFormat($Parameters["ScaleMin"] + $Parameters["RowHeight"]*$i,$Data["XAxisDisplay"],$Data["XAxisFormat"],$Data["XAxisUnit"]); |
|
2010 | + } else { |
|
2011 | + $Value = $i; |
|
2012 | + } |
|
2023 | 2013 | } |
2024 | 2014 | |
2025 | 2015 | $ID++; $Skipped = TRUE; |
@@ -2038,8 +2028,7 @@ discard block |
||
2038 | 2028 | { |
2039 | 2029 | if ( $DrawXLines ) { $this->drawLine($XPos,$this->GraphAreaY1+$FloatingOffset,$XPos,$this->GraphAreaY2-$FloatingOffset,$SkippedAxisColor); } |
2040 | 2030 | if ( ($SkippedInnerTickWidth !=0 || $SkippedOuterTickWidth != 0) && !$RemoveXAxis ) { $this->drawLine($XPos,$YPos-$SkippedInnerTickWidth,$XPos,$YPos+$SkippedOuterTickWidth,$SkippedTickColor); } |
2041 | - } |
|
2042 | - else |
|
2031 | + } else |
|
2043 | 2032 | { |
2044 | 2033 | if ( $DrawXLines && ($XPos != $this->GraphAreaX1 && $XPos != $this->GraphAreaX2) ) { $this->drawLine($XPos,$this->GraphAreaY1+$FloatingOffset,$XPos,$this->GraphAreaY2-$FloatingOffset,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); } |
2045 | 2034 | if ( ($InnerTickWidth !=0 || $OuterTickWidth != 0) && !$RemoveXAxis ) { $this->drawLine($XPos,$YPos-$InnerTickWidth,$XPos,$YPos+$OuterTickWidth,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha)); } |
@@ -2057,8 +2046,7 @@ discard block |
||
2057 | 2046 | } |
2058 | 2047 | |
2059 | 2048 | $AxisPos["B"] = $MaxBottom + $ScaleSpacing; |
2060 | - } |
|
2061 | - elseif ( $Parameters["Position"] == AXIS_POSITION_TOP ) |
|
2049 | + } elseif ( $Parameters["Position"] == AXIS_POSITION_TOP ) |
|
2062 | 2050 | { |
2063 | 2051 | if ( $LabelRotation == 0 ) { $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $YLabelOffset = 2; } |
2064 | 2052 | if ( $LabelRotation > 0 && $LabelRotation < 190 ) { $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $YLabelOffset = 2; } |
@@ -2068,8 +2056,7 @@ discard block |
||
2068 | 2056 | if ( !$RemoveXAxis ) |
2069 | 2057 | { |
2070 | 2058 | if ( $Floating ) |
2071 | - { $FloatingOffset = $YMargin; $this->drawLine($this->GraphAreaX1+$Parameters["Margin"],$AxisPos["T"],$this->GraphAreaX2-$Parameters["Margin"],$AxisPos["T"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
|
2072 | - else |
|
2059 | + { $FloatingOffset = $YMargin; $this->drawLine($this->GraphAreaX1+$Parameters["Margin"],$AxisPos["T"],$this->GraphAreaX2-$Parameters["Margin"],$AxisPos["T"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } else |
|
2073 | 2060 | { $FloatingOffset = 0; $this->drawLine($this->GraphAreaX1,$AxisPos["T"],$this->GraphAreaX2,$AxisPos["T"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
2074 | 2061 | |
2075 | 2062 | if ( $DrawArrows ) { $this->drawArrow($this->GraphAreaX2-$Parameters["Margin"],$AxisPos["T"],$this->GraphAreaX2+($ArrowSize*2),$AxisPos["T"],array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); } |
@@ -2086,13 +2073,13 @@ discard block |
||
2086 | 2073 | $YPos = $AxisPos["T"]; |
2087 | 2074 | |
2088 | 2075 | if ( $Abscissa != NULL ) |
2089 | - { if ( isset($Data["Series"][$Abscissa]["Data"][$i]) ) { $Value = $this->scaleFormat($Data["Series"][$Abscissa]["Data"][$i],$Data["XAxisDisplay"],$Data["XAxisFormat"],$Data["XAxisUnit"]); } else { $Value = ""; } } |
|
2090 | - else |
|
2076 | + { if ( isset($Data["Series"][$Abscissa]["Data"][$i]) ) { $Value = $this->scaleFormat($Data["Series"][$Abscissa]["Data"][$i],$Data["XAxisDisplay"],$Data["XAxisFormat"],$Data["XAxisUnit"]); } else { $Value = ""; } } else |
|
2091 | 2077 | { |
2092 | - if ( isset($Parameters["ScaleMin"]) && isset ($Parameters["RowHeight"]) ) |
|
2093 | - $Value = $this->scaleFormat($Parameters["ScaleMin"] + $Parameters["RowHeight"]*$i,$Data["XAxisDisplay"],$Data["XAxisFormat"],$Data["XAxisUnit"]); |
|
2094 | - else |
|
2095 | - $Value = $i; |
|
2078 | + if ( isset($Parameters["ScaleMin"]) && isset ($Parameters["RowHeight"]) ) { |
|
2079 | + $Value = $this->scaleFormat($Parameters["ScaleMin"] + $Parameters["RowHeight"]*$i,$Data["XAxisDisplay"],$Data["XAxisFormat"],$Data["XAxisUnit"]); |
|
2080 | + } else { |
|
2081 | + $Value = $i; |
|
2082 | + } |
|
2096 | 2083 | } |
2097 | 2084 | |
2098 | 2085 | $ID++; $Skipped = TRUE; |
@@ -2111,8 +2098,7 @@ discard block |
||
2111 | 2098 | { |
2112 | 2099 | if ( $DrawXLines ) { $this->drawLine($XPos,$this->GraphAreaY1+$FloatingOffset,$XPos,$this->GraphAreaY2-$FloatingOffset,$SkippedAxisColor); } |
2113 | 2100 | if ( ($SkippedInnerTickWidth !=0 || $SkippedOuterTickWidth != 0) && !$RemoveXAxis ) { $this->drawLine($XPos,$YPos+$SkippedInnerTickWidth,$XPos,$YPos-$SkippedOuterTickWidth,$SkippedTickColor); } |
2114 | - } |
|
2115 | - else |
|
2101 | + } else |
|
2116 | 2102 | { |
2117 | 2103 | if ( $DrawXLines ) { $this->drawLine($XPos,$this->GraphAreaY1+$FloatingOffset,$XPos,$this->GraphAreaY2-$FloatingOffset,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); } |
2118 | 2104 | if ( ($InnerTickWidth !=0 || $OuterTickWidth != 0) && !$RemoveXAxis ) { $this->drawLine($XPos,$YPos+$InnerTickWidth,$XPos,$YPos-$OuterTickWidth,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha)); } |
@@ -2132,8 +2118,7 @@ discard block |
||
2132 | 2118 | |
2133 | 2119 | $AxisPos["T"] = $MinTop - $ScaleSpacing; |
2134 | 2120 | } |
2135 | - } |
|
2136 | - elseif ( $Pos == SCALE_POS_TOPBOTTOM ) |
|
2121 | + } elseif ( $Pos == SCALE_POS_TOPBOTTOM ) |
|
2137 | 2122 | { |
2138 | 2123 | if ( $Parameters["Position"] == AXIS_POSITION_LEFT ) |
2139 | 2124 | { |
@@ -2145,8 +2130,7 @@ discard block |
||
2145 | 2130 | if ( !$RemoveXAxis ) |
2146 | 2131 | { |
2147 | 2132 | if ( $Floating ) |
2148 | - { $FloatingOffset = $YMargin; $this->drawLine($AxisPos["L"],$this->GraphAreaY1+$Parameters["Margin"],$AxisPos["L"],$this->GraphAreaY2-$Parameters["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
|
2149 | - else |
|
2133 | + { $FloatingOffset = $YMargin; $this->drawLine($AxisPos["L"],$this->GraphAreaY1+$Parameters["Margin"],$AxisPos["L"],$this->GraphAreaY2-$Parameters["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } else |
|
2150 | 2134 | { $FloatingOffset = 0; $this->drawLine($AxisPos["L"],$this->GraphAreaY1,$AxisPos["L"],$this->GraphAreaY2,array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
2151 | 2135 | |
2152 | 2136 | if ( $DrawArrows ) { $this->drawArrow($AxisPos["L"],$this->GraphAreaY2-$Parameters["Margin"],$AxisPos["L"],$this->GraphAreaY2+($ArrowSize*2),array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); } |
@@ -2163,13 +2147,13 @@ discard block |
||
2163 | 2147 | $XPos = $AxisPos["L"]; |
2164 | 2148 | |
2165 | 2149 | if ( $Abscissa != NULL ) |
2166 | - { if ( isset($Data["Series"][$Abscissa]["Data"][$i]) ) { $Value = $this->scaleFormat($Data["Series"][$Abscissa]["Data"][$i],$Data["XAxisDisplay"],$Data["XAxisFormat"],$Data["XAxisUnit"]); } else { $Value = ""; } } |
|
2167 | - else |
|
2150 | + { if ( isset($Data["Series"][$Abscissa]["Data"][$i]) ) { $Value = $this->scaleFormat($Data["Series"][$Abscissa]["Data"][$i],$Data["XAxisDisplay"],$Data["XAxisFormat"],$Data["XAxisUnit"]); } else { $Value = ""; } } else |
|
2168 | 2151 | { |
2169 | - if ( isset($Parameters["ScaleMin"]) && isset ($Parameters["RowHeight"]) ) |
|
2170 | - $Value = $this->scaleFormat($Parameters["ScaleMin"] + $Parameters["RowHeight"]*$i,$Data["XAxisDisplay"],$Data["XAxisFormat"],$Data["XAxisUnit"]); |
|
2171 | - else |
|
2172 | - $Value = $i; |
|
2152 | + if ( isset($Parameters["ScaleMin"]) && isset ($Parameters["RowHeight"]) ) { |
|
2153 | + $Value = $this->scaleFormat($Parameters["ScaleMin"] + $Parameters["RowHeight"]*$i,$Data["XAxisDisplay"],$Data["XAxisFormat"],$Data["XAxisUnit"]); |
|
2154 | + } else { |
|
2155 | + $Value = $i; |
|
2156 | + } |
|
2173 | 2157 | } |
2174 | 2158 | |
2175 | 2159 | $ID++; $Skipped = TRUE; |
@@ -2188,8 +2172,7 @@ discard block |
||
2188 | 2172 | { |
2189 | 2173 | if ( $DrawXLines ) { $this->drawLine($this->GraphAreaX1+$FloatingOffset,$YPos,$this->GraphAreaX2-$FloatingOffset,$YPos,$SkippedAxisColor); } |
2190 | 2174 | if ( ($SkippedInnerTickWidth !=0 || $SkippedOuterTickWidth != 0) && !$RemoveXAxis ) { $this->drawLine($XPos-$SkippedOuterTickWidth,$YPos,$XPos+$SkippedInnerTickWidth,$YPos,$SkippedTickColor); } |
2191 | - } |
|
2192 | - else |
|
2175 | + } else |
|
2193 | 2176 | { |
2194 | 2177 | if ( $DrawXLines && ($YPos != $this->GraphAreaY1 && $YPos != $this->GraphAreaY2) ) { $this->drawLine($this->GraphAreaX1+$FloatingOffset,$YPos,$this->GraphAreaX2-$FloatingOffset,$YPos,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); } |
2195 | 2178 | if ( ($InnerTickWidth !=0 || $OuterTickWidth != 0) && !$RemoveXAxis ) { $this->drawLine($XPos-$OuterTickWidth,$YPos,$XPos+$InnerTickWidth,$YPos,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha)); } |
@@ -2207,8 +2190,7 @@ discard block |
||
2207 | 2190 | } |
2208 | 2191 | |
2209 | 2192 | $AxisPos["L"] = $MinLeft - $ScaleSpacing; |
2210 | - } |
|
2211 | - elseif ( $Parameters["Position"] == AXIS_POSITION_RIGHT ) |
|
2193 | + } elseif ( $Parameters["Position"] == AXIS_POSITION_RIGHT ) |
|
2212 | 2194 | { |
2213 | 2195 | if ( $LabelRotation == 0 ) { $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $XLabelOffset = 2; } |
2214 | 2196 | if ( $LabelRotation > 0 && $LabelRotation < 190 ) { $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $XLabelOffset = 6; } |
@@ -2218,8 +2200,7 @@ discard block |
||
2218 | 2200 | if ( !$RemoveXAxis ) |
2219 | 2201 | { |
2220 | 2202 | if ( $Floating ) |
2221 | - { $FloatingOffset = $YMargin; $this->drawLine($AxisPos["R"],$this->GraphAreaY1+$Parameters["Margin"],$AxisPos["R"],$this->GraphAreaY2-$Parameters["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
|
2222 | - else |
|
2203 | + { $FloatingOffset = $YMargin; $this->drawLine($AxisPos["R"],$this->GraphAreaY1+$Parameters["Margin"],$AxisPos["R"],$this->GraphAreaY2-$Parameters["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } else |
|
2223 | 2204 | { $FloatingOffset = 0; $this->drawLine($AxisPos["R"],$this->GraphAreaY1,$AxisPos["R"],$this->GraphAreaY2,array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
2224 | 2205 | |
2225 | 2206 | if ( $DrawArrows ) { $this->drawArrow($AxisPos["R"],$this->GraphAreaY2-$Parameters["Margin"],$AxisPos["R"],$this->GraphAreaY2+($ArrowSize*2),array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); } |
@@ -2236,13 +2217,13 @@ discard block |
||
2236 | 2217 | $XPos = $AxisPos["R"]; |
2237 | 2218 | |
2238 | 2219 | if ( $Abscissa != NULL ) |
2239 | - { if ( isset($Data["Series"][$Abscissa]["Data"][$i]) ) { $Value = $this->scaleFormat($Data["Series"][$Abscissa]["Data"][$i],$Data["XAxisDisplay"],$Data["XAxisFormat"],$Data["XAxisUnit"]); } else { $Value = ""; } } |
|
2240 | - else |
|
2220 | + { if ( isset($Data["Series"][$Abscissa]["Data"][$i]) ) { $Value = $this->scaleFormat($Data["Series"][$Abscissa]["Data"][$i],$Data["XAxisDisplay"],$Data["XAxisFormat"],$Data["XAxisUnit"]); } else { $Value = ""; } } else |
|
2241 | 2221 | { |
2242 | - if ( isset($Parameters["ScaleMin"]) && isset ($Parameters["RowHeight"]) ) |
|
2243 | - $Value = $this->scaleFormat($Parameters["ScaleMin"] + $Parameters["RowHeight"]*$i,$Data["XAxisDisplay"],$Data["XAxisFormat"],$Data["XAxisUnit"]); |
|
2244 | - else |
|
2245 | - $Value = $i; |
|
2222 | + if ( isset($Parameters["ScaleMin"]) && isset ($Parameters["RowHeight"]) ) { |
|
2223 | + $Value = $this->scaleFormat($Parameters["ScaleMin"] + $Parameters["RowHeight"]*$i,$Data["XAxisDisplay"],$Data["XAxisFormat"],$Data["XAxisUnit"]); |
|
2224 | + } else { |
|
2225 | + $Value = $i; |
|
2226 | + } |
|
2246 | 2227 | } |
2247 | 2228 | |
2248 | 2229 | $ID++; $Skipped = TRUE; |
@@ -2261,8 +2242,7 @@ discard block |
||
2261 | 2242 | { |
2262 | 2243 | if ( $DrawXLines ) { $this->drawLine($this->GraphAreaX1+$FloatingOffset,$YPos,$this->GraphAreaX2-$FloatingOffset,$YPos,$SkippedAxisColor); } |
2263 | 2244 | if ( ($SkippedInnerTickWidth != 0 || $SkippedOuterTickWidth != 0) && !$RemoveXAxis ) { $this->drawLine($XPos+$SkippedOuterTickWidth,$YPos,$XPos-$SkippedInnerTickWidth,$YPos,$SkippedTickColor); } |
2264 | - } |
|
2265 | - else |
|
2245 | + } else |
|
2266 | 2246 | { |
2267 | 2247 | if ( $DrawXLines ) { $this->drawLine($this->GraphAreaX1+$FloatingOffset,$YPos,$this->GraphAreaX2-$FloatingOffset,$YPos,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); } |
2268 | 2248 | if ( ($InnerTickWidth != 0 || $OuterTickWidth != 0) && !$RemoveXAxis ) { $this->drawLine($XPos+$OuterTickWidth,$YPos,$XPos-$InnerTickWidth,$YPos,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha)); } |
@@ -2295,8 +2275,7 @@ discard block |
||
2295 | 2275 | { |
2296 | 2276 | |
2297 | 2277 | if ( $Floating ) |
2298 | - { $FloatingOffset = $XMargin; $this->drawLine($AxisPos["L"],$this->GraphAreaY1+$Parameters["Margin"],$AxisPos["L"],$this->GraphAreaY2-$Parameters["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
|
2299 | - else |
|
2278 | + { $FloatingOffset = $XMargin; $this->drawLine($AxisPos["L"],$this->GraphAreaY1+$Parameters["Margin"],$AxisPos["L"],$this->GraphAreaY2-$Parameters["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } else |
|
2300 | 2279 | { $FloatingOffset = 0; $this->drawLine($AxisPos["L"],$this->GraphAreaY1,$AxisPos["L"],$this->GraphAreaY2,array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
2301 | 2280 | |
2302 | 2281 | if ( $DrawArrows ) { $this->drawArrow($AxisPos["L"],$this->GraphAreaY1+$Parameters["Margin"],$AxisPos["L"],$this->GraphAreaY1-($ArrowSize*2),array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); } |
@@ -2315,8 +2294,9 @@ discard block |
||
2315 | 2294 | |
2316 | 2295 | if ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) ) { $this->drawLine($this->GraphAreaX1+$FloatingOffset,$YPos,$this->GraphAreaX2-$FloatingOffset,$YPos,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); } |
2317 | 2296 | |
2318 | - if ( $DrawSubTicks && $i != $Parameters["Rows"] ) |
|
2319 | - $this->drawLine($XPos-$OuterSubTickWidth,$YPos-$SubTicksSize,$XPos+$InnerSubTickWidth,$YPos-$SubTicksSize,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha)); |
|
2297 | + if ( $DrawSubTicks && $i != $Parameters["Rows"] ) { |
|
2298 | + $this->drawLine($XPos-$OuterSubTickWidth,$YPos-$SubTicksSize,$XPos+$InnerSubTickWidth,$YPos-$SubTicksSize,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha)); |
|
2299 | + } |
|
2320 | 2300 | |
2321 | 2301 | $this->drawLine($XPos-$OuterTickWidth,$YPos,$XPos+$InnerTickWidth,$YPos,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha)); |
2322 | 2302 | $Bounds = $this->drawText($XPos-$OuterTickWidth-2,$YPos,$Value,array("Align"=>TEXT_ALIGN_MIDDLERIGHT)); |
@@ -2337,12 +2317,10 @@ discard block |
||
2337 | 2317 | } |
2338 | 2318 | |
2339 | 2319 | $AxisPos["L"] = $MinLeft - $ScaleSpacing; |
2340 | - } |
|
2341 | - elseif ( $Parameters["Position"] == AXIS_POSITION_RIGHT ) |
|
2320 | + } elseif ( $Parameters["Position"] == AXIS_POSITION_RIGHT ) |
|
2342 | 2321 | { |
2343 | 2322 | if ( $Floating ) |
2344 | - { $FloatingOffset = $XMargin; $this->drawLine($AxisPos["R"],$this->GraphAreaY1+$Parameters["Margin"],$AxisPos["R"],$this->GraphAreaY2-$Parameters["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
|
2345 | - else |
|
2323 | + { $FloatingOffset = $XMargin; $this->drawLine($AxisPos["R"],$this->GraphAreaY1+$Parameters["Margin"],$AxisPos["R"],$this->GraphAreaY2-$Parameters["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } else |
|
2346 | 2324 | { $FloatingOffset = 0; $this->drawLine($AxisPos["R"],$this->GraphAreaY1,$AxisPos["R"],$this->GraphAreaY2,array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
2347 | 2325 | |
2348 | 2326 | if ( $DrawArrows ) { $this->drawArrow($AxisPos["R"],$this->GraphAreaY1+$Parameters["Margin"],$AxisPos["R"],$this->GraphAreaY1-($ArrowSize*2),array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); } |
@@ -2361,8 +2339,9 @@ discard block |
||
2361 | 2339 | |
2362 | 2340 | if ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) ) { $this->drawLine($this->GraphAreaX1+$FloatingOffset,$YPos,$this->GraphAreaX2-$FloatingOffset,$YPos,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); } |
2363 | 2341 | |
2364 | - if ( $DrawSubTicks && $i != $Parameters["Rows"] ) |
|
2365 | - $this->drawLine($XPos-$OuterSubTickWidth,$YPos-$SubTicksSize,$XPos+$InnerSubTickWidth,$YPos-$SubTicksSize,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha)); |
|
2342 | + if ( $DrawSubTicks && $i != $Parameters["Rows"] ) { |
|
2343 | + $this->drawLine($XPos-$OuterSubTickWidth,$YPos-$SubTicksSize,$XPos+$InnerSubTickWidth,$YPos-$SubTicksSize,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha)); |
|
2344 | + } |
|
2366 | 2345 | |
2367 | 2346 | $this->drawLine($XPos-$InnerTickWidth,$YPos,$XPos+$OuterTickWidth,$YPos,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha)); |
2368 | 2347 | $Bounds = $this->drawText($XPos+$OuterTickWidth+2,$YPos,$Value,array("Align"=>TEXT_ALIGN_MIDDLELEFT)); |
@@ -2383,14 +2362,12 @@ discard block |
||
2383 | 2362 | } |
2384 | 2363 | $AxisPos["R"] = $MaxLeft + $ScaleSpacing; |
2385 | 2364 | } |
2386 | - } |
|
2387 | - elseif ( $Pos == SCALE_POS_TOPBOTTOM ) |
|
2365 | + } elseif ( $Pos == SCALE_POS_TOPBOTTOM ) |
|
2388 | 2366 | { |
2389 | 2367 | if ( $Parameters["Position"] == AXIS_POSITION_TOP ) |
2390 | 2368 | { |
2391 | 2369 | if ( $Floating ) |
2392 | - { $FloatingOffset = $XMargin; $this->drawLine($this->GraphAreaX1+$Parameters["Margin"],$AxisPos["T"],$this->GraphAreaX2-$Parameters["Margin"],$AxisPos["T"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
|
2393 | - else |
|
2370 | + { $FloatingOffset = $XMargin; $this->drawLine($this->GraphAreaX1+$Parameters["Margin"],$AxisPos["T"],$this->GraphAreaX2-$Parameters["Margin"],$AxisPos["T"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } else |
|
2394 | 2371 | { $FloatingOffset = 0; $this->drawLine($this->GraphAreaX1,$AxisPos["T"],$this->GraphAreaX2,$AxisPos["T"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
2395 | 2372 | |
2396 | 2373 | if ( $DrawArrows ) { $this->drawArrow($this->GraphAreaX2-$Parameters["Margin"],$AxisPos["T"],$this->GraphAreaX2+($ArrowSize*2),$AxisPos["T"],array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); } |
@@ -2409,8 +2386,9 @@ discard block |
||
2409 | 2386 | |
2410 | 2387 | if ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) ) { $this->drawLine($XPos,$this->GraphAreaY1+$FloatingOffset,$XPos,$this->GraphAreaY2-$FloatingOffset,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); } |
2411 | 2388 | |
2412 | - if ( $DrawSubTicks && $i != $Parameters["Rows"] ) |
|
2413 | - $this->drawLine($XPos+$SubTicksSize,$YPos-$OuterSubTickWidth,$XPos+$SubTicksSize,$YPos+$InnerSubTickWidth,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha)); |
|
2389 | + if ( $DrawSubTicks && $i != $Parameters["Rows"] ) { |
|
2390 | + $this->drawLine($XPos+$SubTicksSize,$YPos-$OuterSubTickWidth,$XPos+$SubTicksSize,$YPos+$InnerSubTickWidth,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha)); |
|
2391 | + } |
|
2414 | 2392 | |
2415 | 2393 | $this->drawLine($XPos,$YPos-$OuterTickWidth,$XPos,$YPos+$InnerTickWidth,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha)); |
2416 | 2394 | $Bounds = $this->drawText($XPos,$YPos-$OuterTickWidth-2,$Value,array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); |
@@ -2431,12 +2409,10 @@ discard block |
||
2431 | 2409 | } |
2432 | 2410 | |
2433 | 2411 | $AxisPos["T"] = $MinTop - $ScaleSpacing; |
2434 | - } |
|
2435 | - elseif ( $Parameters["Position"] == AXIS_POSITION_BOTTOM ) |
|
2412 | + } elseif ( $Parameters["Position"] == AXIS_POSITION_BOTTOM ) |
|
2436 | 2413 | { |
2437 | 2414 | if ( $Floating ) |
2438 | - { $FloatingOffset = $XMargin; $this->drawLine($this->GraphAreaX1+$Parameters["Margin"],$AxisPos["B"],$this->GraphAreaX2-$Parameters["Margin"],$AxisPos["B"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
|
2439 | - else |
|
2415 | + { $FloatingOffset = $XMargin; $this->drawLine($this->GraphAreaX1+$Parameters["Margin"],$AxisPos["B"],$this->GraphAreaX2-$Parameters["Margin"],$AxisPos["B"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } else |
|
2440 | 2416 | { $FloatingOffset = 0; $this->drawLine($this->GraphAreaX1,$AxisPos["B"],$this->GraphAreaX2,$AxisPos["B"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
2441 | 2417 | |
2442 | 2418 | if ( $DrawArrows ) { $this->drawArrow($this->GraphAreaX2-$Parameters["Margin"],$AxisPos["B"],$this->GraphAreaX2+($ArrowSize*2),$AxisPos["B"],array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); } |
@@ -2455,8 +2431,9 @@ discard block |
||
2455 | 2431 | |
2456 | 2432 | if ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) ) { $this->drawLine($XPos,$this->GraphAreaY1+$FloatingOffset,$XPos,$this->GraphAreaY2-$FloatingOffset,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); } |
2457 | 2433 | |
2458 | - if ( $DrawSubTicks && $i != $Parameters["Rows"] ) |
|
2459 | - $this->drawLine($XPos+$SubTicksSize,$YPos-$OuterSubTickWidth,$XPos+$SubTicksSize,$YPos+$InnerSubTickWidth,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha)); |
|
2434 | + if ( $DrawSubTicks && $i != $Parameters["Rows"] ) { |
|
2435 | + $this->drawLine($XPos+$SubTicksSize,$YPos-$OuterSubTickWidth,$XPos+$SubTicksSize,$YPos+$InnerSubTickWidth,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha)); |
|
2436 | + } |
|
2460 | 2437 | |
2461 | 2438 | $this->drawLine($XPos,$YPos-$OuterTickWidth,$XPos,$YPos+$InnerTickWidth,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha)); |
2462 | 2439 | $Bounds = $this->drawText($XPos,$YPos+$OuterTickWidth+2,$Value,array("Align"=>TEXT_ALIGN_TOPMIDDLE)); |
@@ -2498,8 +2475,9 @@ discard block |
||
2498 | 2475 | { |
2499 | 2476 | /* Compute each factors */ |
2500 | 2477 | $Results = ""; |
2501 | - foreach ($Factors as $Key => $Factor) |
|
2502 | - $Results[$Factor] = $this->processScale($XMin,$XMax,$MaxDivs,array($Factor),$AxisID); |
|
2478 | + foreach ($Factors as $Key => $Factor) { |
|
2479 | + $Results[$Factor] = $this->processScale($XMin,$XMax,$MaxDivs,array($Factor),$AxisID); |
|
2480 | + } |
|
2503 | 2481 | |
2504 | 2482 | /* Remove scales that are creating to much decimals */ |
2505 | 2483 | $GoodScaleFactors = ""; |
@@ -2526,15 +2504,17 @@ discard block |
||
2526 | 2504 | { |
2527 | 2505 | $ScaleHeight = abs(ceil($XMax)-floor($XMin)); |
2528 | 2506 | |
2529 | - if ( isset($this->DataSet->Data["Axis"][$AxisID]["Format"]) ) |
|
2530 | - $Format = $this->DataSet->Data["Axis"][$AxisID]["Format"]; |
|
2531 | - else |
|
2532 | - $Format = NULL; |
|
2507 | + if ( isset($this->DataSet->Data["Axis"][$AxisID]["Format"]) ) { |
|
2508 | + $Format = $this->DataSet->Data["Axis"][$AxisID]["Format"]; |
|
2509 | + } else { |
|
2510 | + $Format = NULL; |
|
2511 | + } |
|
2533 | 2512 | |
2534 | - if ( isset($this->DataSet->Data["Axis"][$AxisID]["Display"]) ) |
|
2535 | - $Mode = $this->DataSet->Data["Axis"][$AxisID]["Display"]; |
|
2536 | - else |
|
2537 | - $Mode = AXIS_FORMAT_DEFAULT; |
|
2513 | + if ( isset($this->DataSet->Data["Axis"][$AxisID]["Display"]) ) { |
|
2514 | + $Mode = $this->DataSet->Data["Axis"][$AxisID]["Display"]; |
|
2515 | + } else { |
|
2516 | + $Mode = AXIS_FORMAT_DEFAULT; |
|
2517 | + } |
|
2538 | 2518 | |
2539 | 2519 | $Scale = ""; |
2540 | 2520 | if ( $XMin != $XMax ) |
@@ -2589,8 +2569,7 @@ discard block |
||
2589 | 2569 | |
2590 | 2570 | $Scale["Format"] = $GoodDecimals; |
2591 | 2571 | } |
2592 | - } |
|
2593 | - else |
|
2572 | + } else |
|
2594 | 2573 | { |
2595 | 2574 | /* If all values are the same we keep a +1/-1 scale */ |
2596 | 2575 | $Rows = 2; $XMin = $XMax-1; $XMax = $XMax+1; $RowHeight = 1; |
@@ -2673,13 +2652,14 @@ discard block |
||
2673 | 2652 | { |
2674 | 2653 | if ( isset($Data["Abscissa"]) ) |
2675 | 2654 | { |
2676 | - if ( isset($Data["Series"][$Data["Abscissa"]]["Data"][$Value]) ) |
|
2677 | - $Caption = $Data["Series"][$Data["Abscissa"]]["Data"][$Value]; |
|
2678 | - else |
|
2679 | - $Caption = $Value; |
|
2680 | - } |
|
2681 | - else |
|
2682 | - $Caption = $Value; |
|
2655 | + if ( isset($Data["Series"][$Data["Abscissa"]]["Data"][$Value]) ) { |
|
2656 | + $Caption = $Data["Series"][$Data["Abscissa"]]["Data"][$Value]; |
|
2657 | + } else { |
|
2658 | + $Caption = $Value; |
|
2659 | + } |
|
2660 | + } else { |
|
2661 | + $Caption = $Value; |
|
2662 | + } |
|
2683 | 2663 | } |
2684 | 2664 | |
2685 | 2665 | if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT ) |
@@ -2702,8 +2682,7 @@ discard block |
||
2702 | 2682 | if ( $WriteCaption ) |
2703 | 2683 | { |
2704 | 2684 | if ( $CaptionAlign == CAPTION_LEFT_TOP ) |
2705 | - { $Y = $YPos1 + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE; } |
|
2706 | - else |
|
2685 | + { $Y = $YPos1 + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE; } else |
|
2707 | 2686 | { $Y = $YPos2 - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_BOTTOMMIDDLE; } |
2708 | 2687 | |
2709 | 2688 | $this->drawText($XPos,$Y,$Caption,$CaptionSettings); |
@@ -2711,8 +2690,7 @@ discard block |
||
2711 | 2690 | |
2712 | 2691 | return(array("X"=>$XPos)); |
2713 | 2692 | } |
2714 | - } |
|
2715 | - elseif( $Data["Orientation"] == SCALE_POS_TOPBOTTOM ) |
|
2693 | + } elseif( $Data["Orientation"] == SCALE_POS_TOPBOTTOM ) |
|
2716 | 2694 | { |
2717 | 2695 | $XStep = (($this->GraphAreaY2 - $this->GraphAreaY1) - $XScale[0] *2 ) / $XScale[1]; |
2718 | 2696 | $XPos = $this->GraphAreaY1 + $XScale[0] + $XStep * $Value; |
@@ -2732,8 +2710,7 @@ discard block |
||
2732 | 2710 | if ( $WriteCaption ) |
2733 | 2711 | { |
2734 | 2712 | if ( $CaptionAlign == CAPTION_LEFT_TOP ) |
2735 | - { $Y = $YPos1 + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLELEFT; } |
|
2736 | - else |
|
2713 | + { $Y = $YPos1 + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLELEFT; } else |
|
2737 | 2714 | { $Y = $YPos2 - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLERIGHT; } |
2738 | 2715 | |
2739 | 2716 | $this->drawText($Y,$XPos,$Caption,$CaptionSettings); |
@@ -2813,8 +2790,7 @@ discard block |
||
2813 | 2790 | |
2814 | 2791 | $this->Shadow = $RestoreShadow; |
2815 | 2792 | return(array("X1"=>$XPos1,"X2"=>$XPos2)); |
2816 | - } |
|
2817 | - elseif ( $Data["Orientation"] == SCALE_POS_TOPBOTTOM ) |
|
2793 | + } elseif ( $Data["Orientation"] == SCALE_POS_TOPBOTTOM ) |
|
2818 | 2794 | { |
2819 | 2795 | $XStep = (($this->GraphAreaY2 - $this->GraphAreaY1) - $XScale[0] *2 ) / $XScale[1]; |
2820 | 2796 | $XPos1 = $this->GraphAreaY1 + $XScale[0] + $XStep * $Value1; |
@@ -2919,8 +2895,7 @@ discard block |
||
2919 | 2895 | if ( $WriteCaption ) |
2920 | 2896 | { |
2921 | 2897 | if ( $CaptionAlign == CAPTION_LEFT_TOP ) |
2922 | - { $X = $X1 + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLELEFT; } |
|
2923 | - else |
|
2898 | + { $X = $X1 + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLELEFT; } else |
|
2924 | 2899 | { $X = $X2 - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLERIGHT; } |
2925 | 2900 | |
2926 | 2901 | $this->drawText($X,$YPos,$Caption,$CaptionSettings); |
@@ -2949,8 +2924,7 @@ discard block |
||
2949 | 2924 | if ( $WriteCaption ) |
2950 | 2925 | { |
2951 | 2926 | if ( $CaptionAlign == CAPTION_LEFT_TOP ) |
2952 | - { $Y = $Y1 + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE; } |
|
2953 | - else |
|
2927 | + { $Y = $Y1 + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE; } else |
|
2954 | 2928 | { $Y = $Y2 - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_BOTTOMMIDDLE; } |
2955 | 2929 | |
2956 | 2930 | $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE; |
@@ -3028,8 +3002,7 @@ discard block |
||
3028 | 3002 | |
3029 | 3003 | $this->Shadow = $RestoreShadow; |
3030 | 3004 | return(array("Y1"=>$YPos1,"Y2"=>$YPos2)); |
3031 | - } |
|
3032 | - elseif ( $Data["Orientation"] == SCALE_POS_TOPBOTTOM ) |
|
3005 | + } elseif ( $Data["Orientation"] == SCALE_POS_TOPBOTTOM ) |
|
3033 | 3006 | { |
3034 | 3007 | $YPos1 = $this->GraphAreaY1 + $AbscissaMargin; |
3035 | 3008 | $YPos2 = $this->GraphAreaY2 - $AbscissaMargin; |
@@ -3102,26 +3075,24 @@ discard block |
||
3102 | 3075 | $Step = $Height / $ScaleHeight; |
3103 | 3076 | |
3104 | 3077 | if ( $ReturnOnly0Height ) |
3105 | - { foreach($Values as $Key => $Value) { if ( $Value == VOID ) { $Result[] = VOID; } else { $Result[] = $Step * $Value; } } } |
|
3106 | - else |
|
3078 | + { foreach($Values as $Key => $Value) { if ( $Value == VOID ) { $Result[] = VOID; } else { $Result[] = $Step * $Value; } } } else |
|
3107 | 3079 | { foreach($Values as $Key => $Value) { if ( $Value == VOID ) { $Result[] = VOID; } else { $Result[] = $this->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - ($Step * ($Value-$Data["Axis"][$AxisID]["ScaleMin"])); } } } |
3108 | - } |
|
3109 | - else |
|
3080 | + } else |
|
3110 | 3081 | { |
3111 | 3082 | $Width = ($this->GraphAreaX2 - $this->GraphAreaX1) - $Data["Axis"][$AxisID]["Margin"]*2; |
3112 | 3083 | $ScaleWidth = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"]; |
3113 | 3084 | $Step = $Width / $ScaleWidth; |
3114 | 3085 | |
3115 | 3086 | if ( $ReturnOnly0Height ) |
3116 | - { foreach($Values as $Key => $Value) { if ( $Value == VOID ) { $Result[] = VOID; } else { $Result[] = $Step * $Value; } } } |
|
3117 | - else |
|
3087 | + { foreach($Values as $Key => $Value) { if ( $Value == VOID ) { $Result[] = VOID; } else { $Result[] = $Step * $Value; } } } else |
|
3118 | 3088 | { foreach($Values as $Key => $Value) { if ( $Value == VOID ) { $Result[] = VOID; } else { $Result[] = $this->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + ($Step * ($Value-$Data["Axis"][$AxisID]["ScaleMin"])); } } } |
3119 | 3089 | } |
3120 | 3090 | |
3121 | - if ( count($Result) == 1 ) |
|
3122 | - return($Result[0]); |
|
3123 | - else |
|
3124 | - return($Result); |
|
3091 | + if ( count($Result) == 1 ) { |
|
3092 | + return($Result[0]); |
|
3093 | + } else { |
|
3094 | + return($Result); |
|
3095 | + } |
|
3125 | 3096 | } |
3126 | 3097 | |
3127 | 3098 | /* Format the axis values */ |
@@ -3143,12 +3114,14 @@ discard block |
||
3143 | 3114 | |
3144 | 3115 | if ( $Mode == AXIS_FORMAT_METRIC ) |
3145 | 3116 | { |
3146 | - if (abs($Value) > 1000000000) |
|
3147 | - return(round($Value/1000000000,$Format)."g".$Unit); |
|
3148 | - if (abs($Value) > 1000000) |
|
3149 | - return(round($Value/1000000,$Format)."m".$Unit); |
|
3150 | - elseif (abs($Value) >= 1000) |
|
3151 | - return(round($Value/1000,$Format)."k".$Unit); |
|
3117 | + if (abs($Value) > 1000000000) { |
|
3118 | + return(round($Value/1000000000,$Format)."g".$Unit); |
|
3119 | + } |
|
3120 | + if (abs($Value) > 1000000) { |
|
3121 | + return(round($Value/1000000,$Format)."m".$Unit); |
|
3122 | + } elseif (abs($Value) >= 1000) { |
|
3123 | + return(round($Value/1000,$Format)."k".$Unit); |
|
3124 | + } |
|
3152 | 3125 | |
3153 | 3126 | } |
3154 | 3127 | return($Value.$Unit); |
@@ -3264,8 +3237,7 @@ discard block |
||
3264 | 3237 | |
3265 | 3238 | $this->drawText($XPos+$XOffset,$YPos-$DisplayOffset+$YOffset,$Label,$CaptionSettings); |
3266 | 3239 | } |
3267 | - } |
|
3268 | - else |
|
3240 | + } else |
|
3269 | 3241 | { |
3270 | 3242 | $XStep = ($this->GraphAreaY2-$this->GraphAreaY1-$XMargin*2)/$XDivs; |
3271 | 3243 | $X = $this->GraphAreaY1 + $XMargin; |
@@ -3351,8 +3323,7 @@ discard block |
||
3351 | 3323 | $R = $Serie["Color"]["R"]; $G = $Serie["Color"]["G"]; $B = $Serie["Color"]["B"]; $Alpha = $Serie["Color"]["Alpha"]; $Ticks = $Serie["Ticks"]; |
3352 | 3324 | if ( $Surrounding != NULL ) { $BorderR = $R + $Surrounding; $BorderG = $G + $Surrounding; $BorderB = $B + $Surrounding; } |
3353 | 3325 | if ( isset($Serie["Picture"]) ) |
3354 | - { $Picture = $Serie["Picture"]; list($PicWidth,$PicHeight,$PicType) = $this->getPicInfo($Picture); } |
|
3355 | - else { $Picture = NULL; $PicOffset = 0; } |
|
3326 | + { $Picture = $Serie["Picture"]; list($PicWidth,$PicHeight,$PicType) = $this->getPicInfo($Picture); } else { $Picture = NULL; $PicOffset = 0; } |
|
3356 | 3327 | |
3357 | 3328 | if ( $DisplayColor == DISPLAY_AUTO ) { $DisplayR = $R; $DisplayG = $G; $DisplayB = $B; } |
3358 | 3329 | |
@@ -3377,22 +3348,21 @@ discard block |
||
3377 | 3348 | if ( !is_array($PosArray) ) { $Value = $PosArray; $PosArray = ""; $PosArray[0] = $Value; } |
3378 | 3349 | foreach($PosArray as $Key => $Y) |
3379 | 3350 | { |
3380 | - if ( $DisplayValues ) |
|
3381 | - $this->drawText($X,$Y-$DisplayOffset-$SerieWeight-$BorderSize-$PicOffset,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); |
|
3351 | + if ( $DisplayValues ) { |
|
3352 | + $this->drawText($X,$Y-$DisplayOffset-$SerieWeight-$BorderSize-$PicOffset,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); |
|
3353 | + } |
|
3382 | 3354 | |
3383 | 3355 | if ( $Y != VOID ) |
3384 | 3356 | { |
3385 | 3357 | if ( $RecordImageMap ) { $this->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".$SerieWeight,$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } |
3386 | 3358 | |
3387 | 3359 | if ( $Picture != NULL ) |
3388 | - { $this->drawFromPicture($PicType,$Picture,$X-$PicWidth/2,$Y-$PicHeight/2); } |
|
3389 | - else |
|
3360 | + { $this->drawFromPicture($PicType,$Picture,$X-$PicWidth/2,$Y-$PicHeight/2); } else |
|
3390 | 3361 | { $this->drawShape($X,$Y,$Shape,$SerieWeight,$PlotBorder,$BorderSize,$R,$G,$B,$Alpha,$BorderR,$BorderG,$BorderB,$BorderAlpha); } |
3391 | 3362 | } |
3392 | 3363 | $X = $X + $XStep; |
3393 | 3364 | } |
3394 | - } |
|
3395 | - else |
|
3365 | + } else |
|
3396 | 3366 | { |
3397 | 3367 | if ( $XDivs == 0 ) { $YStep = ($this->GraphAreaY2-$this->GraphAreaY1)/4; } else { $YStep = ($this->GraphAreaY2-$this->GraphAreaY1-$XMargin*2)/$XDivs; } |
3398 | 3368 | if ( $Picture != NULL ) { $PicOffset = $PicWidth / 2; $SerieWeight = 0; } |
@@ -3401,16 +3371,16 @@ discard block |
||
3401 | 3371 | if ( !is_array($PosArray) ) { $Value = $PosArray; $PosArray = ""; $PosArray[0] = $Value; } |
3402 | 3372 | foreach($PosArray as $Key => $X) |
3403 | 3373 | { |
3404 | - if ( $DisplayValues ) |
|
3405 | - $this->drawText($X+$DisplayOffset+$SerieWeight+$BorderSize+$PicOffset,$Y,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("Angle"=>270,"R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); |
|
3374 | + if ( $DisplayValues ) { |
|
3375 | + $this->drawText($X+$DisplayOffset+$SerieWeight+$BorderSize+$PicOffset,$Y,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("Angle"=>270,"R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); |
|
3376 | + } |
|
3406 | 3377 | |
3407 | 3378 | if ( $X != VOID ) |
3408 | 3379 | { |
3409 | 3380 | if ( $RecordImageMap ) { $this->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".$SerieWeight,$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } |
3410 | 3381 | |
3411 | 3382 | if ( $Picture != NULL ) |
3412 | - { $this->drawFromPicture($PicType,$Picture,$X-$PicWidth/2,$Y-$PicHeight/2); } |
|
3413 | - else |
|
3383 | + { $this->drawFromPicture($PicType,$Picture,$X-$PicWidth/2,$Y-$PicHeight/2); } else |
|
3414 | 3384 | { $this->drawShape($X,$Y,$Shape,$SerieWeight,$PlotBorder,$BorderSize,$R,$G,$B,$Alpha,$BorderR,$BorderG,$BorderB,$BorderAlpha); } |
3415 | 3385 | } |
3416 | 3386 | $Y = $Y + $YStep; |
@@ -3447,10 +3417,11 @@ discard block |
||
3447 | 3417 | { |
3448 | 3418 | $R = $Serie["Color"]["R"]; $G = $Serie["Color"]["G"]; $B = $Serie["Color"]["B"]; $Alpha = $Serie["Color"]["Alpha"]; $Ticks = $Serie["Ticks"]; $Weight = $Serie["Weight"]; |
3449 | 3419 | |
3450 | - if ( $BreakR == NULL ) |
|
3451 | - $BreakSettings = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$VoidTicks); |
|
3452 | - else |
|
3453 | - $BreakSettings = array("R"=>$BreakR,"G"=>$BreakG,"B"=>$BreakB,"Alpha"=>$Alpha,"Ticks"=>$VoidTicks,"Weight"=>$Weight); |
|
3420 | + if ( $BreakR == NULL ) { |
|
3421 | + $BreakSettings = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$VoidTicks); |
|
3422 | + } else { |
|
3423 | + $BreakSettings = array("R"=>$BreakR,"G"=>$BreakG,"B"=>$BreakB,"Alpha"=>$Alpha,"Ticks"=>$VoidTicks,"Weight"=>$Weight); |
|
3424 | + } |
|
3454 | 3425 | |
3455 | 3426 | if ( $DisplayColor == DISPLAY_AUTO ) { $DisplayR = $R; $DisplayG = $G; $DisplayB = $B; } |
3456 | 3427 | |
@@ -3475,8 +3446,9 @@ discard block |
||
3475 | 3446 | $LastGoodY = NULL; $LastGoodX = NULL; $LastX = 1; $LastY = 1; |
3476 | 3447 | foreach($PosArray as $Key => $Y) |
3477 | 3448 | { |
3478 | - if ( $DisplayValues ) |
|
3479 | - $this->drawText($X,$Y-$DisplayOffset,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); |
|
3449 | + if ( $DisplayValues ) { |
|
3450 | + $this->drawText($X,$Y-$DisplayOffset,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); |
|
3451 | + } |
|
3480 | 3452 | |
3481 | 3453 | if ( $RecordImageMap && $Y != VOID ) { $this->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".$ImageMapPlotSize,$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } |
3482 | 3454 | |
@@ -3486,8 +3458,9 @@ discard block |
||
3486 | 3458 | if ( $Y != VOID && $LastY == NULL && $LastGoodY != NULL && !$BreakVoid ) |
3487 | 3459 | { $this->drawLine($LastGoodX,$LastGoodY,$X,$Y,$BreakSettings); } |
3488 | 3460 | |
3489 | - if ( $Y != VOID ) |
|
3490 | - $WayPoints[] = array($X,$Y); |
|
3461 | + if ( $Y != VOID ) { |
|
3462 | + $WayPoints[] = array($X,$Y); |
|
3463 | + } |
|
3491 | 3464 | |
3492 | 3465 | if ( $Y != VOID ) { $LastGoodY = $Y; $LastGoodX = $X; } |
3493 | 3466 | if ( $Y == VOID ) { $Y = NULL; } |
@@ -3496,8 +3469,7 @@ discard block |
||
3496 | 3469 | $X = $X + $XStep; |
3497 | 3470 | } |
3498 | 3471 | $this->drawSpline($WayPoints,array("Force"=>$Force,"R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight)); |
3499 | - } |
|
3500 | - else |
|
3472 | + } else |
|
3501 | 3473 | { |
3502 | 3474 | if ( $XDivs == 0 ) { $YStep = ($this->GraphAreaY2-$this->GraphAreaY1)/4; } else { $YStep = ($this->GraphAreaY2-$this->GraphAreaY1-$XMargin*2)/$XDivs; } |
3503 | 3475 | $Y = $this->GraphAreaY1 + $XMargin; $WayPoints = ""; |
@@ -3507,8 +3479,9 @@ discard block |
||
3507 | 3479 | $LastGoodY = NULL; $LastGoodX = NULL; $LastX = 1; $LastY = 1; |
3508 | 3480 | foreach($PosArray as $Key => $X) |
3509 | 3481 | { |
3510 | - if ( $DisplayValues ) |
|
3511 | - $this->drawText($X+$DisplayOffset,$Y,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("Angle"=>270,"R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); |
|
3482 | + if ( $DisplayValues ) { |
|
3483 | + $this->drawText($X+$DisplayOffset,$Y,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("Angle"=>270,"R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); |
|
3484 | + } |
|
3512 | 3485 | |
3513 | 3486 | if ( $RecordImageMap && $X != VOID ) { $this->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".$ImageMapPlotSize,$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } |
3514 | 3487 | |
@@ -3518,8 +3491,9 @@ discard block |
||
3518 | 3491 | if ( $X != VOID && $LastX == NULL && $LastGoodX != NULL && !$BreakVoid ) |
3519 | 3492 | { $this->drawLine($LastGoodX,$LastGoodY,$X,$Y,$BreakSettings); } |
3520 | 3493 | |
3521 | - if ( $X != VOID ) |
|
3522 | - $WayPoints[] = array($X,$Y); |
|
3494 | + if ( $X != VOID ) { |
|
3495 | + $WayPoints[] = array($X,$Y); |
|
3496 | + } |
|
3523 | 3497 | |
3524 | 3498 | if ( $X != VOID ) { $LastGoodX = $X; $LastGoodY = $Y; } |
3525 | 3499 | if ( $X == VOID ) { $X = NULL; } |
@@ -3589,8 +3563,9 @@ discard block |
||
3589 | 3563 | if ( !is_array($PosArray) ) { $Value = $PosArray; $PosArray = ""; $PosArray[0] = $Value; } |
3590 | 3564 | foreach($PosArray as $Key => $Y) |
3591 | 3565 | { |
3592 | - if ( $DisplayValues ) |
|
3593 | - $this->drawText($X,$Y-$DisplayOffset,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); |
|
3566 | + if ( $DisplayValues ) { |
|
3567 | + $this->drawText($X,$Y-$DisplayOffset,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); |
|
3568 | + } |
|
3594 | 3569 | |
3595 | 3570 | if ( $Y == VOID ) |
3596 | 3571 | { |
@@ -3614,9 +3589,10 @@ discard block |
||
3614 | 3589 | } |
3615 | 3590 | |
3616 | 3591 | $WayPoints = ""; |
3617 | - } |
|
3618 | - else |
|
3619 | - $WayPoints[] = array($X,$Y-.5); /* -.5 for AA visual fix */ |
|
3592 | + } else { |
|
3593 | + $WayPoints[] = array($X,$Y-.5); |
|
3594 | + } |
|
3595 | + /* -.5 for AA visual fix */ |
|
3620 | 3596 | |
3621 | 3597 | $X = $X + $XStep; |
3622 | 3598 | } |
@@ -3638,8 +3614,7 @@ discard block |
||
3638 | 3614 | } |
3639 | 3615 | $this->drawSpline($WayPoints,array("Force"=>$Force,"R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks)); |
3640 | 3616 | } |
3641 | - } |
|
3642 | - else |
|
3617 | + } else |
|
3643 | 3618 | { |
3644 | 3619 | if ( $XDivs == 0 ) { $YStep = ($this->GraphAreaY2-$this->GraphAreaY1)/4; } else { $YStep = ($this->GraphAreaY2-$this->GraphAreaY1-$XMargin*2)/$XDivs; } |
3645 | 3620 | $Y = $this->GraphAreaY1 + $XMargin; $WayPoints = ""; |
@@ -3652,8 +3627,9 @@ discard block |
||
3652 | 3627 | if ( !is_array($PosArray) ) { $Value = $PosArray; $PosArray = ""; $PosArray[0] = $Value; } |
3653 | 3628 | foreach($PosArray as $Key => $X) |
3654 | 3629 | { |
3655 | - if ( $DisplayValues ) |
|
3656 | - $this->drawText($X+$DisplayOffset,$Y,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("Angle"=>270,"R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); |
|
3630 | + if ( $DisplayValues ) { |
|
3631 | + $this->drawText($X+$DisplayOffset,$Y,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("Angle"=>270,"R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE)); |
|
3632 | + } |
|
3657 | 3633 | |
3658 | 3634 | if ( $X == VOID ) |
3659 | 3635 | { |
@@ -3677,9 +3653,9 @@ discard block |
||
3677 | 3653 | } |
3678 | 3654 | |
3679 | 3655 | $WayPoints = ""; |
3680 | - } |
|
3681 | - else |
|
3682 | - $WayPoints[] = array($X,$Y); |
|
3656 | + } else { |
|
3657 | + $WayPoints[] = array($X,$Y); |
|
3658 | + } |
|
3683 | 3659 | |
3684 | 3660 | $Y = $Y + $YStep; |
3685 | 3661 | } |
@@ -3742,10 +3718,11 @@ discard block |
||
3742 | 3718 | if ( $ForceColor ) |
3743 | 3719 | { $R = $ForceR; $G = $ForceG; $B = $ForceB; $Alpha = $ForceAlpha; } |
3744 | 3720 | |
3745 | - if ( $BreakR == NULL ) |
|
3746 | - $BreakSettings = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$VoidTicks,"Weight"=>$Weight); |
|
3747 | - else |
|
3748 | - $BreakSettings = array("R"=>$BreakR,"G"=>$BreakG,"B"=>$BreakB,"Alpha"=>$Alpha,"Ticks"=>$VoidTicks,"Weight"=>$Weight); |
|
3721 | + if ( $BreakR == NULL ) { |
|
3722 | + $BreakSettings = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$VoidTicks,"Weight"=>$Weight); |
|
3723 | + } else { |
|
3724 | + $BreakSettings = array("R"=>$BreakR,"G"=>$BreakG,"B"=>$BreakB,"Alpha"=>$Alpha,"Ticks"=>$VoidTicks,"Weight"=>$Weight); |
|
3725 | + } |
|
3749 | 3726 | |
3750 | 3727 | if ( $DisplayColor == DISPLAY_AUTO ) { $DisplayR = $R; $DisplayG = $G; $DisplayB = $B; } |
3751 | 3728 | |
@@ -3777,8 +3754,9 @@ discard block |
||
3777 | 3754 | |
3778 | 3755 | if ( $RecordImageMap && $Y != VOID ) { $this->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".$ImageMapPlotSize,$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } |
3779 | 3756 | |
3780 | - if ( $Y != VOID && $LastX != NULL && $LastY != NULL ) |
|
3781 | - $this->drawLine($LastX,$LastY,$X,$Y,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight)); |
|
3757 | + if ( $Y != VOID && $LastX != NULL && $LastY != NULL ) { |
|
3758 | + $this->drawLine($LastX,$LastY,$X,$Y,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight)); |
|
3759 | + } |
|
3782 | 3760 | |
3783 | 3761 | if ( $Y != VOID && $LastY == NULL && $LastGoodY != NULL && !$BreakVoid ) |
3784 | 3762 | { $this->drawLine($LastGoodX,$LastGoodY,$X,$Y,$BreakSettings); $LastGoodY = NULL; } |
@@ -3789,8 +3767,7 @@ discard block |
||
3789 | 3767 | $LastX = $X; $LastY = $Y; |
3790 | 3768 | $X = $X + $XStep; |
3791 | 3769 | } |
3792 | - } |
|
3793 | - else |
|
3770 | + } else |
|
3794 | 3771 | { |
3795 | 3772 | if ( $XDivs == 0 ) { $YStep = ($this->GraphAreaY2-$this->GraphAreaY1)/4; } else { $YStep = ($this->GraphAreaY2-$this->GraphAreaY1-$XMargin*2)/$XDivs; } |
3796 | 3773 | $Y = $this->GraphAreaY1 + $XMargin; $LastX = NULL; $LastY = NULL; |
@@ -3804,8 +3781,9 @@ discard block |
||
3804 | 3781 | |
3805 | 3782 | if ( $RecordImageMap && $X != VOID ) { $this->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".$ImageMapPlotSize,$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } |
3806 | 3783 | |
3807 | - if ( $X != VOID && $LastX != NULL && $LastY != NULL ) |
|
3808 | - $this->drawLine($LastX,$LastY,$X,$Y,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight)); |
|
3784 | + if ( $X != VOID && $LastX != NULL && $LastY != NULL ) { |
|
3785 | + $this->drawLine($LastX,$LastY,$X,$Y,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight)); |
|
3786 | + } |
|
3809 | 3787 | |
3810 | 3788 | if ( $X != VOID && $LastX == NULL && $LastGoodY != NULL && !$BreakVoid ) |
3811 | 3789 | { $this->drawLine($LastGoodX,$LastGoodY,$X,$Y,$BreakSettings); $LastGoodY = NULL; } |
@@ -3879,8 +3857,7 @@ discard block |
||
3879 | 3857 | $this->drawLine($BoundsA[$i],$BoundsA[$i+1],$BoundsA[$i+2],$BoundsA[$i+3],array("R"=>$LineR,"G"=>$LineG,"B"=>$LineB,"Alpha"=>$LineAlpha,"Ticks"=>$LineTicks)); |
3880 | 3858 | $this->drawLine($BoundsB[$i],$BoundsB[$i+1],$BoundsB[$i+2],$BoundsB[$i+3],array("R"=>$LineR,"G"=>$LineG,"B"=>$LineB,"Alpha"=>$LineAlpha,"Ticks"=>$LineTicks)); |
3881 | 3859 | } |
3882 | - } |
|
3883 | - else |
|
3860 | + } else |
|
3884 | 3861 | { |
3885 | 3862 | if ( $XDivs == 0 ) { $YStep = ($this->GraphAreaY2-$this->GraphAreaY1)/4; } else { $YStep = ($this->GraphAreaY2-$this->GraphAreaY1-$XMargin*2)/$XDivs; } |
3886 | 3863 | $Y = $this->GraphAreaY1 + $XMargin; $LastX = NULL; $LastY = NULL; |
@@ -3940,10 +3917,11 @@ discard block |
||
3940 | 3917 | |
3941 | 3918 | if (isset($Serie["Description"])) { $SerieDescription = $Serie["Description"]; } else { $SerieDescription = $SerieName; } |
3942 | 3919 | |
3943 | - if ( $BreakR == NULL ) |
|
3944 | - $BreakSettings = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$VoidTicks,"Weight"=>$Weight); |
|
3945 | - else |
|
3946 | - $BreakSettings = array("R"=>$BreakR,"G"=>$BreakG,"B"=>$BreakB,"Alpha"=>$Alpha,"Ticks"=>$VoidTicks,"Weight"=>$Weight); |
|
3920 | + if ( $BreakR == NULL ) { |
|
3921 | + $BreakSettings = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$VoidTicks,"Weight"=>$Weight); |
|
3922 | + } else { |
|
3923 | + $BreakSettings = array("R"=>$BreakR,"G"=>$BreakG,"B"=>$BreakB,"Alpha"=>$Alpha,"Ticks"=>$VoidTicks,"Weight"=>$Weight); |
|
3924 | + } |
|
3947 | 3925 | |
3948 | 3926 | if ( $DisplayColor == DISPLAY_AUTO ) { $DisplayR = $R; $DisplayG = $G; $DisplayB = $B; } |
3949 | 3927 | |
@@ -3980,8 +3958,7 @@ discard block |
||
3980 | 3958 | { |
3981 | 3959 | $this->drawLine($X,$Y,$X+$XStep,$Y,$Color); |
3982 | 3960 | if ( $RecordImageMap ) { $this->addToImageMap("RECT",floor($X-$ImageMapPlotSize).",".floor($Y-$ImageMapPlotSize).",".floor($X+$XStep+$ImageMapPlotSize).",".floor($Y+$ImageMapPlotSize),$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } |
3983 | - } |
|
3984 | - else |
|
3961 | + } else |
|
3985 | 3962 | { if ( $RecordImageMap ) { $this->addToImageMap("RECT",floor($LastX-$ImageMapPlotSize).",".floor($LastY-$ImageMapPlotSize).",".floor($X+$ImageMapPlotSize).",".floor($LastY+$ImageMapPlotSize),$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } } |
3986 | 3963 | } |
3987 | 3964 | |
@@ -3991,8 +3968,7 @@ discard block |
||
3991 | 3968 | { |
3992 | 3969 | $this->drawLine($LastGoodX+$XStep,$LastGoodY,$X,$LastGoodY,$BreakSettings); |
3993 | 3970 | if ( $RecordImageMap ) { $this->addToImageMap("RECT",floor($LastGoodX+$XStep-$ImageMapPlotSize).",".floor($LastGoodY-$ImageMapPlotSize).",".floor($X+$ImageMapPlotSize).",".floor($LastGoodY+$ImageMapPlotSize),$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } |
3994 | - } |
|
3995 | - else |
|
3971 | + } else |
|
3996 | 3972 | { |
3997 | 3973 | $this->drawLine($LastGoodX,$LastGoodY,$X,$LastGoodY,$BreakSettings); |
3998 | 3974 | if ( $RecordImageMap ) { $this->addToImageMap("RECT",floor($LastGoodX-$ImageMapPlotSize).",".floor($LastGoodY-$ImageMapPlotSize).",".floor($X+$ImageMapPlotSize).",".floor($LastGoodY+$ImageMapPlotSize),$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } |
@@ -4000,8 +3976,7 @@ discard block |
||
4000 | 3976 | |
4001 | 3977 | $this->drawLine($X,$LastGoodY,$X,$Y,$BreakSettings); |
4002 | 3978 | $LastGoodY = NULL; |
4003 | - } |
|
4004 | - elseif( !$BreakVoid && $LastGoodY == NULL && $Y != VOID ) |
|
3979 | + } elseif( !$BreakVoid && $LastGoodY == NULL && $Y != VOID ) |
|
4005 | 3980 | { |
4006 | 3981 | $this->drawLine($this->GraphAreaX1 + $XMargin,$Y,$X,$Y,$BreakSettings); |
4007 | 3982 | if ( $RecordImageMap ) { $this->addToImageMap("RECT",floor($this->GraphAreaX1+$XMargin-$ImageMapPlotSize).",".floor($Y-$ImageMapPlotSize).",".floor($X+$ImageMapPlotSize).",".floor($Y+$ImageMapPlotSize),$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } |
@@ -4020,8 +3995,7 @@ discard block |
||
4020 | 3995 | $this->drawLine($LastX,$LastY,$this->GraphAreaX2 - $XMargin,$LastY,$Color); |
4021 | 3996 | if ( $RecordImageMap ) { $this->addToImageMap("RECT",floor($LastX-$ImageMapPlotSize).",".floor($LastY-$ImageMapPlotSize).",".floor($this->GraphAreaX2-$XMargin+$ImageMapPlotSize).",".floor($LastY+$ImageMapPlotSize),$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } |
4022 | 3997 | } |
4023 | - } |
|
4024 | - else |
|
3998 | + } else |
|
4025 | 3999 | { |
4026 | 4000 | if ( $XDivs == 0 ) { $YStep = ($this->GraphAreaY2-$this->GraphAreaY1)/4; } else { $YStep = ($this->GraphAreaY2-$this->GraphAreaY1-$XMargin*2)/$XDivs; } |
4027 | 4001 | $Y = $this->GraphAreaY1 + $XMargin; $LastX = NULL; $LastY = NULL; |
@@ -4054,8 +4028,7 @@ discard block |
||
4054 | 4028 | |
4055 | 4029 | $this->drawLine($LastGoodX,$Y,$X,$Y,$BreakSettings); |
4056 | 4030 | $LastGoodY = NULL; |
4057 | - } |
|
4058 | - elseif ( $X != VOID && $LastGoodY == NULL && !$BreakVoid ) |
|
4031 | + } elseif ( $X != VOID && $LastGoodY == NULL && !$BreakVoid ) |
|
4059 | 4032 | { |
4060 | 4033 | $this->drawLine($X,$this->GraphAreaY1 + $XMargin,$X,$Y,$BreakSettings); |
4061 | 4034 | if ( $RecordImageMap ) { $this->addToImageMap("RECT",floor($X-$ImageMapPlotSize).",".floor($this->GraphAreaY1+$XMargin-$ImageMapPlotSize).",".floor($X+$ImageMapPlotSize).",".floor($Y+$ImageMapPlotSize),$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } |
@@ -4161,13 +4134,11 @@ discard block |
||
4161 | 4134 | { |
4162 | 4135 | $Points[] = $LastX+$XStep/2; $Points[] = $LastY; |
4163 | 4136 | $Points[] = $LastX+$XStep/2; $Points[] = $YZero; |
4164 | - } |
|
4165 | - else |
|
4137 | + } else |
|
4166 | 4138 | { $Points[] = $LastX; $Points[] = $YZero; } |
4167 | 4139 | |
4168 | 4140 | $this->drawPolygon($Points,$Color); |
4169 | - } |
|
4170 | - else |
|
4141 | + } else |
|
4171 | 4142 | { |
4172 | 4143 | if ( $YZero < $this->GraphAreaX1+1 ) { $YZero = $this->GraphAreaX1+1; } |
4173 | 4144 | if ( $YZero > $this->GraphAreaX2-1 ) { $YZero = $this->GraphAreaX2-1; } |
@@ -4209,8 +4180,7 @@ discard block |
||
4209 | 4180 | { |
4210 | 4181 | $Points[] = $LastX; $Points[] = $LastY+$YStep/2; |
4211 | 4182 | $Points[] = $YZero; $Points[] = $LastY+$YStep/2; |
4212 | - } |
|
4213 | - else |
|
4183 | + } else |
|
4214 | 4184 | { $Points[] = $YZero; $Points[] = $LastY; } |
4215 | 4185 | |
4216 | 4186 | $this->drawPolygon($Points,$Color); |
@@ -4286,14 +4256,12 @@ discard block |
||
4286 | 4256 | if ( $Y == VOID && isset($Areas[$AreaID]) ) |
4287 | 4257 | { |
4288 | 4258 | if($LastX == NULL) |
4289 | - { $Areas[$AreaID][] = $X; } |
|
4290 | - else |
|
4259 | + { $Areas[$AreaID][] = $X; } else |
|
4291 | 4260 | { $Areas[$AreaID][] = $LastX; } |
4292 | 4261 | |
4293 | 4262 | if ( $AroundZero ) { $Areas[$AreaID][] = $YZero; } else { $Areas[$AreaID][] = $this->GraphAreaY2-1; } |
4294 | 4263 | $AreaID++; |
4295 | - } |
|
4296 | - elseif ($Y != VOID) |
|
4264 | + } elseif ($Y != VOID) |
|
4297 | 4265 | { |
4298 | 4266 | if ( !isset($Areas[$AreaID]) ) |
4299 | 4267 | { |
@@ -4321,23 +4289,23 @@ discard block |
||
4321 | 4289 | foreach($Points as $Key2 => $Value) |
4322 | 4290 | { |
4323 | 4291 | if ( $Key2 % 2 == 0 ) |
4324 | - { $ShadowArea[$Key][] = $Value + $this->ShadowX; } |
|
4325 | - else |
|
4292 | + { $ShadowArea[$Key][] = $Value + $this->ShadowX; } else |
|
4326 | 4293 | { $ShadowArea[$Key][] = $Value + $this->ShadowY; } |
4327 | 4294 | } |
4328 | 4295 | } |
4329 | 4296 | |
4330 | - foreach($ShadowArea as $Key => $Points) |
|
4331 | - $this->drawPolygonChart($Points,array("R"=>$this->ShadowR,"G"=>$this->ShadowG,"B"=>$this->ShadowB,"Alpha"=>$this->Shadowa)); |
|
4297 | + foreach($ShadowArea as $Key => $Points) { |
|
4298 | + $this->drawPolygonChart($Points,array("R"=>$this->ShadowR,"G"=>$this->ShadowG,"B"=>$this->ShadowB,"Alpha"=>$this->Shadowa)); |
|
4299 | + } |
|
4332 | 4300 | } |
4333 | 4301 | |
4334 | 4302 | $Alpha = $ForceTransparency != NULL ? $ForceTransparency : $Alpha; |
4335 | 4303 | $Color = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Threshold"=>$Threshold); |
4336 | 4304 | |
4337 | - foreach($Areas as $Key => $Points) |
|
4338 | - $this->drawPolygonChart($Points,$Color); |
|
4339 | - } |
|
4340 | - else |
|
4305 | + foreach($Areas as $Key => $Points) { |
|
4306 | + $this->drawPolygonChart($Points,$Color); |
|
4307 | + } |
|
4308 | + } else |
|
4341 | 4309 | { |
4342 | 4310 | if ( $YZero < $this->GraphAreaX1+1 ) { $YZero = $this->GraphAreaX1+1; } |
4343 | 4311 | if ( $YZero > $this->GraphAreaX2-1 ) { $YZero = $this->GraphAreaX2-1; } |
@@ -4363,13 +4331,11 @@ discard block |
||
4363 | 4331 | if ( $AroundZero ) { $Areas[$AreaID][] = $YZero; } else { $Areas[$AreaID][] = $this->GraphAreaX1+1; } |
4364 | 4332 | |
4365 | 4333 | if($LastY == NULL) |
4366 | - { $Areas[$AreaID][] = $Y; } |
|
4367 | - else |
|
4334 | + { $Areas[$AreaID][] = $Y; } else |
|
4368 | 4335 | { $Areas[$AreaID][] = $LastY; } |
4369 | 4336 | |
4370 | 4337 | $AreaID++; |
4371 | - } |
|
4372 | - elseif ($X != VOID) |
|
4338 | + } elseif ($X != VOID) |
|
4373 | 4339 | { |
4374 | 4340 | if ( !isset($Areas[$AreaID]) ) |
4375 | 4341 | { |
@@ -4397,21 +4363,22 @@ discard block |
||
4397 | 4363 | foreach($Points as $Key2 => $Value) |
4398 | 4364 | { |
4399 | 4365 | if ( $Key2 % 2 == 0 ) |
4400 | - { $ShadowArea[$Key][] = $Value + $this->ShadowX; } |
|
4401 | - else |
|
4366 | + { $ShadowArea[$Key][] = $Value + $this->ShadowX; } else |
|
4402 | 4367 | { $ShadowArea[$Key][] = $Value + $this->ShadowY; } |
4403 | 4368 | } |
4404 | 4369 | } |
4405 | 4370 | |
4406 | - foreach($ShadowArea as $Key => $Points) |
|
4407 | - $this->drawPolygonChart($Points,array("R"=>$this->ShadowR,"G"=>$this->ShadowG,"B"=>$this->ShadowB,"Alpha"=>$this->Shadowa)); |
|
4371 | + foreach($ShadowArea as $Key => $Points) { |
|
4372 | + $this->drawPolygonChart($Points,array("R"=>$this->ShadowR,"G"=>$this->ShadowG,"B"=>$this->ShadowB,"Alpha"=>$this->Shadowa)); |
|
4373 | + } |
|
4408 | 4374 | } |
4409 | 4375 | |
4410 | 4376 | $Alpha = $ForceTransparency != NULL ? $ForceTransparency : $Alpha; |
4411 | 4377 | $Color = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Threshold"=>$Threshold); |
4412 | 4378 | |
4413 | - foreach($Areas as $Key => $Points) |
|
4414 | - $this->drawPolygonChart($Points,$Color); |
|
4379 | + foreach($Areas as $Key => $Points) { |
|
4380 | + $this->drawPolygonChart($Points,$Color); |
|
4381 | + } |
|
4415 | 4382 | } |
4416 | 4383 | } |
4417 | 4384 | } |
@@ -4497,8 +4464,7 @@ discard block |
||
4497 | 4464 | $PosArray = $this->scaleComputeY($Serie["Data"],array("AxisID"=>$Serie["Axis"])); |
4498 | 4465 | |
4499 | 4466 | if ( $Floating0Value != NULL ) |
4500 | - { $YZero = $this->scaleComputeY($Floating0Value,array("AxisID"=>$Serie["Axis"])); } |
|
4501 | - else |
|
4467 | + { $YZero = $this->scaleComputeY($Floating0Value,array("AxisID"=>$Serie["Axis"])); } else |
|
4502 | 4468 | { $YZero = $this->scaleComputeY(0,array("AxisID"=>$Serie["Axis"])); } |
4503 | 4469 | |
4504 | 4470 | if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT ) |
@@ -4527,8 +4493,7 @@ discard block |
||
4527 | 4493 | if ( $Floating0Serie != NULL ) |
4528 | 4494 | { |
4529 | 4495 | if ( isset($Data["Series"][$Floating0Serie]["Data"][$Key]) ) |
4530 | - { $Value = $Data["Series"][$Floating0Serie]["Data"][$Key]; } |
|
4531 | - else |
|
4496 | + { $Value = $Data["Series"][$Floating0Serie]["Data"][$Key]; } else |
|
4532 | 4497 | { $Value = 0; } |
4533 | 4498 | |
4534 | 4499 | $YZero = $this->scaleComputeY($Value,array("AxisID"=>$Serie["Axis"])); |
@@ -4549,14 +4514,13 @@ discard block |
||
4549 | 4514 | { |
4550 | 4515 | $this->drawLine($X+$XOffset+$XSpace,$Y1,$X+$XOffset+$XSize-$XSpace,$Y1,$Color); |
4551 | 4516 | if ( $RecordImageMap ) { $this->addToImageMap("RECT",floor($X+$XOffset+$XSpace).",".floor($Y1-1).",".floor($X+$XOffset+$XSize-$XSpace).",".floor($Y1+1),$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } |
4552 | - } |
|
4553 | - else |
|
4517 | + } else |
|
4554 | 4518 | { |
4555 | 4519 | if ( $RecordImageMap ) { $this->addToImageMap("RECT",floor($X+$XOffset+$XSpace).",".floor($Y1).",".floor($X+$XOffset+$XSize-$XSpace).",".floor($Y2),$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } |
4556 | 4520 | |
4557 | - if ( $Rounded ) |
|
4558 | - $this->drawRoundedFilledRectangle($X+$XOffset+$XSpace,$Y1,$X+$XOffset+$XSize-$XSpace,$Y2,$RoundRadius,$Color); |
|
4559 | - else |
|
4521 | + if ( $Rounded ) { |
|
4522 | + $this->drawRoundedFilledRectangle($X+$XOffset+$XSpace,$Y1,$X+$XOffset+$XSize-$XSpace,$Y2,$RoundRadius,$Color); |
|
4523 | + } else |
|
4560 | 4524 | { |
4561 | 4525 | $this->drawFilledRectangle($X+$XOffset+$XSpace,$Y1,$X+$XOffset+$XSize-$XSpace,$Y2,$Color); |
4562 | 4526 | |
@@ -4568,14 +4532,14 @@ discard block |
||
4568 | 4532 | |
4569 | 4533 | if ( $GradientMode == GRADIENT_SIMPLE ) |
4570 | 4534 | { |
4571 | - if ( $Serie["Data"][$Key] >= 0 ) |
|
4572 | - $GradienColor = array("StartR"=>$GradientStartR,"StartG"=>$GradientStartG,"StartB"=>$GradientStartB,"EndR"=>$GradientEndR,"EndG"=>$GradientEndG,"EndB"=>$GradientEndB,"Alpha"=>$GradientAlpha); |
|
4573 | - else |
|
4574 | - $GradienColor = array("StartR"=>$GradientEndR,"StartG"=>$GradientEndG,"StartB"=>$GradientEndB,"EndR"=>$GradientStartR,"EndG"=>$GradientStartG,"EndB"=>$GradientStartB,"Alpha"=>$GradientAlpha); |
|
4535 | + if ( $Serie["Data"][$Key] >= 0 ) { |
|
4536 | + $GradienColor = array("StartR"=>$GradientStartR,"StartG"=>$GradientStartG,"StartB"=>$GradientStartB,"EndR"=>$GradientEndR,"EndG"=>$GradientEndG,"EndB"=>$GradientEndB,"Alpha"=>$GradientAlpha); |
|
4537 | + } else { |
|
4538 | + $GradienColor = array("StartR"=>$GradientEndR,"StartG"=>$GradientEndG,"StartB"=>$GradientEndB,"EndR"=>$GradientStartR,"EndG"=>$GradientStartG,"EndB"=>$GradientStartB,"Alpha"=>$GradientAlpha); |
|
4539 | + } |
|
4575 | 4540 | |
4576 | 4541 | $this->drawGradientArea($X+$XOffset+$XSpace,$Y1,$X+$XOffset+$XSize-$XSpace,$Y2,DIRECTION_VERTICAL,$GradienColor); |
4577 | - } |
|
4578 | - elseif ( $GradientMode == GRADIENT_EFFECT_CAN ) |
|
4542 | + } elseif ( $GradientMode == GRADIENT_EFFECT_CAN ) |
|
4579 | 4543 | { |
4580 | 4544 | $GradienColor1 = array("StartR"=>$GradientEndR,"StartG"=>$GradientEndG,"StartB"=>$GradientEndB,"EndR"=>$GradientStartR,"EndG"=>$GradientStartG,"EndB"=>$GradientStartB,"Alpha"=>$GradientAlpha); |
4581 | 4545 | $GradienColor2 = array("StartR"=>$GradientStartR,"StartG"=>$GradientStartG,"StartB"=>$GradientStartB,"EndR"=>$GradientEndR,"EndG"=>$GradientEndG,"EndB"=>$GradientEndB,"Alpha"=>$GradientAlpha); |
@@ -4614,8 +4578,7 @@ discard block |
||
4614 | 4578 | $CenterY = ($Y2-$Y1)/2 + $Y1; |
4615 | 4579 | |
4616 | 4580 | $this->drawText($CenterX,$CenterY,$Caption,array("R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE,"FontSize"=>$DisplaySize,"Angle"=>90)); |
4617 | - } |
|
4618 | - else |
|
4581 | + } else |
|
4619 | 4582 | { |
4620 | 4583 | if ( $Serie["Data"][$Key] >= 0 ) { $Align = TEXT_ALIGN_BOTTOMMIDDLE; $Offset = $DisplayOffset; } else { $Align = TEXT_ALIGN_TOPMIDDLE; $Offset = -$DisplayOffset; } |
4621 | 4584 | $this->drawText($X+$XOffset+$XSize/2,$Y2-$Offset,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>$Align,"FontSize"=>$DisplaySize)); |
@@ -4628,8 +4591,7 @@ discard block |
||
4628 | 4591 | $X = $X + $XStep; |
4629 | 4592 | $ID++; |
4630 | 4593 | } |
4631 | - } |
|
4632 | - else |
|
4594 | + } else |
|
4633 | 4595 | { |
4634 | 4596 | if ( $YZero < $this->GraphAreaX1+1 ) { $YZero = $this->GraphAreaX1+1; } |
4635 | 4597 | if ( $YZero > $this->GraphAreaX2-1 ) { $YZero = $this->GraphAreaX2-1; } |
@@ -4655,9 +4617,9 @@ discard block |
||
4655 | 4617 | { |
4656 | 4618 | if ( $Floating0Serie != NULL ) |
4657 | 4619 | { |
4658 | - if ( isset($Data["Series"][$Floating0Serie]["Data"][$Key]) ) |
|
4659 | - $Value = $Data["Series"][$Floating0Serie]["Data"][$Key]; |
|
4660 | - else { $Value = 0; } |
|
4620 | + if ( isset($Data["Series"][$Floating0Serie]["Data"][$Key]) ) { |
|
4621 | + $Value = $Data["Series"][$Floating0Serie]["Data"][$Key]; |
|
4622 | + } else { $Value = 0; } |
|
4661 | 4623 | |
4662 | 4624 | $YZero = $this->scaleComputeY($Value,array("AxisID"=>$Serie["Axis"])); |
4663 | 4625 | if ( $YZero < $this->GraphAreaX1+1 ) { $YZero = $this->GraphAreaX1+1; } |
@@ -4676,14 +4638,13 @@ discard block |
||
4676 | 4638 | { |
4677 | 4639 | $this->drawLine($X1,$Y+$YOffset+$YSpace,$X1,$Y+$YOffset+$YSize-$YSpace,$Color); |
4678 | 4640 | if ( $RecordImageMap ) { $this->addToImageMap("RECT",floor($X1-1).",".floor($Y+$YOffset+$YSpace).",".floor($X1+1).",".floor($Y+$YOffset+$YSize-$YSpace),$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } |
4679 | - } |
|
4680 | - else |
|
4641 | + } else |
|
4681 | 4642 | { |
4682 | 4643 | if ( $RecordImageMap ) { $this->addToImageMap("RECT",floor($X1).",".floor($Y+$YOffset+$YSpace).",".floor($X2).",".floor($Y+$YOffset+$YSize-$YSpace),$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } |
4683 | 4644 | |
4684 | - if ( $Rounded ) |
|
4685 | - $this->drawRoundedFilledRectangle($X1+1,$Y+$YOffset+$YSpace,$X2,$Y+$YOffset+$YSize-$YSpace,$RoundRadius,$Color); |
|
4686 | - else |
|
4645 | + if ( $Rounded ) { |
|
4646 | + $this->drawRoundedFilledRectangle($X1+1,$Y+$YOffset+$YSpace,$X2,$Y+$YOffset+$YSize-$YSpace,$RoundRadius,$Color); |
|
4647 | + } else |
|
4687 | 4648 | { |
4688 | 4649 | $this->drawFilledRectangle($X1,$Y+$YOffset+$YSpace,$X2,$Y+$YOffset+$YSize-$YSpace,$Color); |
4689 | 4650 | |
@@ -4695,14 +4656,14 @@ discard block |
||
4695 | 4656 | |
4696 | 4657 | if ( $GradientMode == GRADIENT_SIMPLE ) |
4697 | 4658 | { |
4698 | - if ( $Serie["Data"][$Key] >= 0 ) |
|
4699 | - $GradienColor = array("StartR"=>$GradientStartR,"StartG"=>$GradientStartG,"StartB"=>$GradientStartB,"EndR"=>$GradientEndR,"EndG"=>$GradientEndG,"EndB"=>$GradientEndB,"Alpha"=>$GradientAlpha); |
|
4700 | - else |
|
4701 | - $GradienColor = array("StartR"=>$GradientEndR,"StartG"=>$GradientEndG,"StartB"=>$GradientEndB,"EndR"=>$GradientStartR,"EndG"=>$GradientStartG,"EndB"=>$GradientStartB,"Alpha"=>$GradientAlpha); |
|
4659 | + if ( $Serie["Data"][$Key] >= 0 ) { |
|
4660 | + $GradienColor = array("StartR"=>$GradientStartR,"StartG"=>$GradientStartG,"StartB"=>$GradientStartB,"EndR"=>$GradientEndR,"EndG"=>$GradientEndG,"EndB"=>$GradientEndB,"Alpha"=>$GradientAlpha); |
|
4661 | + } else { |
|
4662 | + $GradienColor = array("StartR"=>$GradientEndR,"StartG"=>$GradientEndG,"StartB"=>$GradientEndB,"EndR"=>$GradientStartR,"EndG"=>$GradientStartG,"EndB"=>$GradientStartB,"Alpha"=>$GradientAlpha); |
|
4663 | + } |
|
4702 | 4664 | |
4703 | 4665 | $this->drawGradientArea($X1,$Y+$YOffset+$YSpace,$X2,$Y+$YOffset+$YSize-$YSpace,DIRECTION_HORIZONTAL,$GradienColor); |
4704 | - } |
|
4705 | - elseif ( $GradientMode == GRADIENT_EFFECT_CAN ) |
|
4666 | + } elseif ( $GradientMode == GRADIENT_EFFECT_CAN ) |
|
4706 | 4667 | { |
4707 | 4668 | $GradienColor1 = array("StartR"=>$GradientEndR,"StartG"=>$GradientEndG,"StartB"=>$GradientEndB,"EndR"=>$GradientStartR,"EndG"=>$GradientStartG,"EndB"=>$GradientStartB,"Alpha"=>$GradientAlpha); |
4708 | 4669 | $GradienColor2 = array("StartR"=>$GradientStartR,"StartG"=>$GradientStartG,"StartB"=>$GradientStartB,"EndR"=>$GradientEndR,"EndG"=>$GradientEndG,"EndB"=>$GradientEndB,"Alpha"=>$GradientAlpha); |
@@ -4741,8 +4702,7 @@ discard block |
||
4741 | 4702 | $CenterY = (($Y+$YOffset+$YSize-$YSpace)-($Y+$YOffset+$YSpace))/2 + ($Y+$YOffset+$YSpace); |
4742 | 4703 | |
4743 | 4704 | $this->drawText($CenterX,$CenterY,$Caption,array("R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE,"FontSize"=>$DisplaySize)); |
4744 | - } |
|
4745 | - else |
|
4705 | + } else |
|
4746 | 4706 | { |
4747 | 4707 | if ( $Serie["Data"][$Key] >= 0 ) { $Align = TEXT_ALIGN_MIDDLELEFT; $Offset = $DisplayOffset; } else { $Align = TEXT_ALIGN_MIDDLERIGHT; $Offset = -$DisplayOffset; } |
4748 | 4708 | $this->drawText($X2+$Offset,$Y+$YOffset+$YSize/2,$Caption,array("R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Align"=>$Align,"FontSize"=>$DisplaySize)); |
@@ -4856,9 +4816,9 @@ discard block |
||
4856 | 4816 | |
4857 | 4817 | if ( $RecordImageMap ) { $this->addToImageMap("RECT",floor($X+$XOffset).",".floor($Y1-$YSpaceUp+$YSpaceDown).",".floor($X+$XOffset+$XSize).",".floor($Y2),$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } |
4858 | 4818 | |
4859 | - if ( $Rounded ) |
|
4860 | - $this->drawRoundedFilledRectangle($X+$XOffset,$Y1-$YSpaceUp+$YSpaceDown,$X+$XOffset+$XSize,$Y2,$RoundRadius,$Color); |
|
4861 | - else |
|
4819 | + if ( $Rounded ) { |
|
4820 | + $this->drawRoundedFilledRectangle($X+$XOffset,$Y1-$YSpaceUp+$YSpaceDown,$X+$XOffset+$XSize,$Y2,$RoundRadius,$Color); |
|
4821 | + } else |
|
4862 | 4822 | { |
4863 | 4823 | $this->drawFilledRectangle($X+$XOffset,$Y1-$YSpaceUp+$YSpaceDown,$X+$XOffset+$XSize,$Y2,$Color); |
4864 | 4824 | |
@@ -4872,8 +4832,7 @@ discard block |
||
4872 | 4832 | { |
4873 | 4833 | $GradientColor = array("StartR"=>$GradientStartR,"StartG"=>$GradientStartG,"StartB"=>$GradientStartB,"EndR"=>$GradientEndR,"EndG"=>$GradientEndG,"EndB"=>$GradientEndB,"Alpha"=>$GradientAlpha); |
4874 | 4834 | $this->drawGradientArea($X+$XOffset,$Y1-1-$YSpaceUp+$YSpaceDown,$X+$XOffset+$XSize,$Y2+1,DIRECTION_VERTICAL,$GradientColor); |
4875 | - } |
|
4876 | - elseif ( $GradientMode == GRADIENT_EFFECT_CAN ) |
|
4835 | + } elseif ( $GradientMode == GRADIENT_EFFECT_CAN ) |
|
4877 | 4836 | { |
4878 | 4837 | $GradientColor1 = array("StartR"=>$GradientEndR,"StartG"=>$GradientEndG,"StartB"=>$GradientEndB,"EndR"=>$GradientStartR,"EndG"=>$GradientStartG,"EndB"=>$GradientStartB,"Alpha"=>$GradientAlpha); |
4879 | 4838 | $GradientColor2 = array("StartR"=>$GradientStartR,"StartG"=>$GradientStartG,"StartB"=>$GradientStartB,"EndR"=>$GradientEndR,"EndG"=>$GradientEndG,"EndB"=>$GradientEndB,"Alpha"=>$GradientAlpha); |
@@ -4911,8 +4870,9 @@ discard block |
||
4911 | 4870 | |
4912 | 4871 | if ( $DisplayOrientation == ORIENTATION_VERTICAL || ( $DisplayOrientation == ORIENTATION_AUTO && !$Done) ) |
4913 | 4872 | { |
4914 | - if ( $TxtHeight < $BarWidth && $TxtWidth < $BarHeight ) |
|
4915 | - $this->drawText($XCenter,$YCenter,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Angle"=>90,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE,"FontSize"=>$DisplaySize,"FontName"=>$DisplayFont)); |
|
4873 | + if ( $TxtHeight < $BarWidth && $TxtWidth < $BarHeight ) { |
|
4874 | + $this->drawText($XCenter,$YCenter,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Angle"=>90,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE,"FontSize"=>$DisplaySize,"FontName"=>$DisplayFont)); |
|
4875 | + } |
|
4916 | 4876 | } |
4917 | 4877 | } |
4918 | 4878 | |
@@ -4921,8 +4881,7 @@ discard block |
||
4921 | 4881 | |
4922 | 4882 | $X = $X + $XStep; |
4923 | 4883 | } |
4924 | - } |
|
4925 | - else |
|
4884 | + } else |
|
4926 | 4885 | { |
4927 | 4886 | if ( $YZero < $this->GraphAreaX1+1 ) { $YZero = $this->GraphAreaX1+1; } |
4928 | 4887 | if ( $YZero > $this->GraphAreaX2-1 ) { $YZero = $this->GraphAreaX2-1; } |
@@ -4951,9 +4910,9 @@ discard block |
||
4951 | 4910 | |
4952 | 4911 | if ( $RecordImageMap ) { $this->addToImageMap("RECT",floor($X1+$XSpaceLeft).",".floor($Y+$YOffset).",".floor($X2-$XSpaceRight).",".floor($Y+$YOffset+$YSize),$this->toHTMLColor($R,$G,$B),$SerieDescription,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit)); } |
4953 | 4912 | |
4954 | - if ( $Rounded ) |
|
4955 | - $this->drawRoundedFilledRectangle($X1+$XSpaceLeft,$Y+$YOffset,$X2-$XSpaceRight,$Y+$YOffset+$YSize,$RoundRadius,$Color); |
|
4956 | - else |
|
4913 | + if ( $Rounded ) { |
|
4914 | + $this->drawRoundedFilledRectangle($X1+$XSpaceLeft,$Y+$YOffset,$X2-$XSpaceRight,$Y+$YOffset+$YSize,$RoundRadius,$Color); |
|
4915 | + } else |
|
4957 | 4916 | { |
4958 | 4917 | $this->drawFilledRectangle($X1+$XSpaceLeft,$Y+$YOffset,$X2-$XSpaceRight,$Y+$YOffset+$YSize,$Color); |
4959 | 4918 | |
@@ -4967,8 +4926,7 @@ discard block |
||
4967 | 4926 | { |
4968 | 4927 | $GradientColor = array("StartR"=>$GradientStartR,"StartG"=>$GradientStartG,"StartB"=>$GradientStartB,"EndR"=>$GradientEndR,"EndG"=>$GradientEndG,"EndB"=>$GradientEndB,"Alpha"=>$GradientAlpha); |
4969 | 4928 | $this->drawGradientArea($X1+$XSpaceLeft,$Y+$YOffset,$X2-$XSpaceRight,$Y+$YOffset+$YSize,DIRECTION_HORIZONTAL,$GradientColor); |
4970 | - } |
|
4971 | - elseif ( $GradientMode == GRADIENT_EFFECT_CAN ) |
|
4929 | + } elseif ( $GradientMode == GRADIENT_EFFECT_CAN ) |
|
4972 | 4930 | { |
4973 | 4931 | $GradientColor1 = array("StartR"=>$GradientEndR,"StartG"=>$GradientEndG,"StartB"=>$GradientEndB,"EndR"=>$GradientStartR,"EndG"=>$GradientStartG,"EndB"=>$GradientStartB,"Alpha"=>$GradientAlpha); |
4974 | 4932 | $GradientColor2 = array("StartR"=>$GradientStartR,"StartG"=>$GradientStartG,"StartB"=>$GradientStartB,"EndR"=>$GradientEndR,"EndG"=>$GradientEndG,"EndB"=>$GradientEndB,"Alpha"=>$GradientAlpha); |
@@ -5005,8 +4963,9 @@ discard block |
||
5005 | 4963 | |
5006 | 4964 | if ( $DisplayOrientation == ORIENTATION_VERTICAL || ( $DisplayOrientation == ORIENTATION_AUTO && !$Done) ) |
5007 | 4965 | { |
5008 | - if ( $TxtHeight < $BarWidth && $TxtWidth < $BarHeight ) |
|
5009 | - $this->drawText($XCenter,$YCenter,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Angle"=>90,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE,"FontSize"=>$DisplaySize,"FontName"=>$DisplayFont)); |
|
4966 | + if ( $TxtHeight < $BarWidth && $TxtWidth < $BarHeight ) { |
|
4967 | + $this->drawText($XCenter,$YCenter,$this->scaleFormat($Serie["Data"][$Key],$Mode,$Format,$Unit),array("R"=>$DisplayR,"G"=>$DisplayG,"B"=>$DisplayB,"Angle"=>90,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE,"FontSize"=>$DisplaySize,"FontName"=>$DisplayFont)); |
|
4968 | + } |
|
5010 | 4969 | } |
5011 | 4970 | } |
5012 | 4971 | |
@@ -5064,8 +5023,7 @@ discard block |
||
5064 | 5023 | if ( !isset($OverallOffset[$Key]) || !isset($OverallOffset[$Key][$Sign]) ) { $OverallOffset[$Key][$Sign] = 0; } |
5065 | 5024 | |
5066 | 5025 | if ( $Sign == "+" ) |
5067 | - { $Data["Series"][$SerieName]["Data"][$Key] = $Value + $OverallOffset[$Key][$Sign]; } |
|
5068 | - else |
|
5026 | + { $Data["Series"][$SerieName]["Data"][$Key] = $Value + $OverallOffset[$Key][$Sign]; } else |
|
5069 | 5027 | { $Data["Series"][$SerieName]["Data"][$Key] = $Value - $OverallOffset[$Key][$Sign]; } |
5070 | 5028 | |
5071 | 5029 | $OverallOffset[$Key][$Sign] = $OverallOffset[$Key][$Sign] + abs($Value); |
@@ -5085,17 +5043,19 @@ discard block |
||
5085 | 5043 | |
5086 | 5044 | $Color = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha); |
5087 | 5045 | |
5088 | - if ( $LineSurrounding != NULL ) |
|
5089 | - $LineColor = array("R"=>$R+$LineSurrounding,"G"=>$G+$LineSurrounding,"B"=>$B+$LineSurrounding,"Alpha"=>$Alpha); |
|
5090 | - elseif ( $LineR != VOID ) |
|
5091 | - $LineColor = array("R"=>$LineR,"G"=>$LineG,"B"=>$LineB,"Alpha"=>$LineAlpha); |
|
5092 | - else |
|
5093 | - $LineColor = $Color; |
|
5046 | + if ( $LineSurrounding != NULL ) { |
|
5047 | + $LineColor = array("R"=>$R+$LineSurrounding,"G"=>$G+$LineSurrounding,"B"=>$B+$LineSurrounding,"Alpha"=>$Alpha); |
|
5048 | + } elseif ( $LineR != VOID ) { |
|
5049 | + $LineColor = array("R"=>$LineR,"G"=>$LineG,"B"=>$LineB,"Alpha"=>$LineAlpha); |
|
5050 | + } else { |
|
5051 | + $LineColor = $Color; |
|
5052 | + } |
|
5094 | 5053 | |
5095 | - if ( $PlotBorderSurrounding != NULL ) |
|
5096 | - $PlotBorderColor = array("R"=>$R+$PlotBorderSurrounding,"G"=>$G+$PlotBorderSurrounding,"B"=>$B+$PlotBorderSurrounding,"Alpha"=>$PlotBorderAlpha); |
|
5097 | - else |
|
5098 | - $PlotBorderColor = array("R"=>$PlotBorderR,"G"=>$PlotBorderG,"B"=>$PlotBorderB,"Alpha"=>$PlotBorderAlpha); |
|
5054 | + if ( $PlotBorderSurrounding != NULL ) { |
|
5055 | + $PlotBorderColor = array("R"=>$R+$PlotBorderSurrounding,"G"=>$G+$PlotBorderSurrounding,"B"=>$B+$PlotBorderSurrounding,"Alpha"=>$PlotBorderAlpha); |
|
5056 | + } else { |
|
5057 | + $PlotBorderColor = array("R"=>$PlotBorderR,"G"=>$PlotBorderG,"B"=>$PlotBorderB,"Alpha"=>$PlotBorderAlpha); |
|
5058 | + } |
|
5099 | 5059 | |
5100 | 5060 | $AxisID = $Serie["Axis"]; |
5101 | 5061 | $Mode = $Data["Axis"][$AxisID]["Display"]; |
@@ -5140,8 +5100,7 @@ discard block |
||
5140 | 5100 | } |
5141 | 5101 | } |
5142 | 5102 | $this->Shadow = FALSE; |
5143 | - } |
|
5144 | - elseif ( $Data["Orientation"] == SCALE_POS_TOPBOTTOM ) |
|
5103 | + } elseif ( $Data["Orientation"] == SCALE_POS_TOPBOTTOM ) |
|
5145 | 5104 | { |
5146 | 5105 | if ( $YZero < $this->GraphAreaX1+1 ) { $YZero = $this->GraphAreaX1+1; } |
5147 | 5106 | if ( $YZero > $this->GraphAreaX2-1 ) { $YZero = $this->GraphAreaX2-1; } |
@@ -5203,8 +5162,7 @@ discard block |
||
5203 | 5162 | $Result[$Key]["BorderR"] = $Result[$Key]["R"] + $Surrounding; |
5204 | 5163 | $Result[$Key]["BorderG"] = $Result[$Key]["G"] + $Surrounding; |
5205 | 5164 | $Result[$Key]["BorderB"] = $Result[$Key]["B"] + $Surrounding; |
5206 | - } |
|
5207 | - else |
|
5165 | + } else |
|
5208 | 5166 | { |
5209 | 5167 | if ( isset($Values["BorderR"]) ) { $Result[$Key]["BorderR"] = $Values["BorderR"]; } else { $Result[$Key]["BorderR"] = $Result[$Key]["R"]; } |
5210 | 5168 | if ( isset($Values["BorderG"]) ) { $Result[$Key]["BorderG"] = $Values["BorderG"]; } else { $Result[$Key]["BorderG"] = $Result[$Key]["G"]; } |
@@ -5263,10 +5221,11 @@ discard block |
||
5263 | 5221 | |
5264 | 5222 | list($XMargin,$XDivs) = $this->scaleGetXSettings(); |
5265 | 5223 | |
5266 | - if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT ) |
|
5267 | - $YPos = $this->DataSet->Data["GraphArea"]["Y2"] + $Offset; |
|
5268 | - else |
|
5269 | - $XPos = $this->DataSet->Data["GraphArea"]["X2"] + $Offset; |
|
5224 | + if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT ) { |
|
5225 | + $YPos = $this->DataSet->Data["GraphArea"]["Y2"] + $Offset; |
|
5226 | + } else { |
|
5227 | + $XPos = $this->DataSet->Data["GraphArea"]["X2"] + $Offset; |
|
5228 | + } |
|
5270 | 5229 | |
5271 | 5230 | foreach($Data["Series"] as $SerieName => $Serie) |
5272 | 5231 | { |
@@ -5289,9 +5248,9 @@ discard block |
||
5289 | 5248 | $CaptionSettings = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight); |
5290 | 5249 | if ( $CaptionBox ) { $this->drawFilledRectangle($StartX,$YPos,$EndX,$YPos+$CaptionHeight,array("R"=>$CaptionFillR,"G"=>$CaptionFillG,"B"=>$CaptionFillB,"BorderR"=>$CaptionBorderR,"BorderG"=>$CaptionBorderG,"BorderB"=>$CaptionBorderB,"Alpha"=>$CaptionFillAlpha)); } |
5291 | 5250 | $this->drawLine($StartX+2,$YPos+($CaptionHeight/2),$EndX-2,$YPos+($CaptionHeight/2),$CaptionSettings); |
5292 | - } |
|
5293 | - else |
|
5294 | - $this->drawFilledRectangle($this->GraphAreaX1-$CaptionWidth+$XMargin-$CaptionMargin,$YPos,$this->GraphAreaX1-$CaptionMargin+$XMargin,$YPos+$CaptionHeight,array("R"=>$R,"G"=>$G,"B"=>$B,"BorderR"=>$CaptionBorderR,"BorderG"=>$CaptionBorderG,"BorderB"=>$CaptionBorderB)); |
|
5251 | + } else { |
|
5252 | + $this->drawFilledRectangle($this->GraphAreaX1-$CaptionWidth+$XMargin-$CaptionMargin,$YPos,$this->GraphAreaX1-$CaptionMargin+$XMargin,$YPos+$CaptionHeight,array("R"=>$R,"G"=>$G,"B"=>$B,"BorderR"=>$CaptionBorderR,"BorderG"=>$CaptionBorderG,"BorderB"=>$CaptionBorderB)); |
|
5253 | + } |
|
5295 | 5254 | } |
5296 | 5255 | |
5297 | 5256 | if ( $XDivs == 0 ) { $XStep = ($this->GraphAreaX2-$this->GraphAreaX1)/4; } else { $XStep = ($this->GraphAreaX2-$this->GraphAreaX1-$XMargin*2)/$XDivs; } |
@@ -5319,8 +5278,7 @@ discard block |
||
5319 | 5278 | { $Slope = ($LastY - $Y); if ( $Slope > $MaxSlope ) { $MaxSlope = $Slope; } if ( $Slope < $MinSlope ) { $MinSlope = $Slope; } } |
5320 | 5279 | |
5321 | 5280 | if ( $Y == VOID ) |
5322 | - { $LastX = NULL; $LastY = NULL; } |
|
5323 | - else |
|
5281 | + { $LastX = NULL; $LastY = NULL; } else |
|
5324 | 5282 | { $LastX = $X; $LastY = $Y; } |
5325 | 5283 | } |
5326 | 5284 | |
@@ -5337,8 +5295,7 @@ discard block |
||
5337 | 5295 | $R = (($PositiveSlopeEndR - $PositiveSlopeStartR)/100)*$SlopeIndex+$PositiveSlopeStartR; |
5338 | 5296 | $G = (($PositiveSlopeEndG - $PositiveSlopeStartG)/100)*$SlopeIndex+$PositiveSlopeStartG; |
5339 | 5297 | $B = (($PositiveSlopeEndB - $PositiveSlopeStartB)/100)*$SlopeIndex+$PositiveSlopeStartB; |
5340 | - } |
|
5341 | - elseif ( $Slope < 0 ) |
|
5298 | + } elseif ( $Slope < 0 ) |
|
5342 | 5299 | { |
5343 | 5300 | $SlopeIndex = (100 / abs($MinSlope)) * abs($Slope); |
5344 | 5301 | $R = (($NegativeSlopeEndR - $NegativeSlopeStartR)/100)*$SlopeIndex+$NegativeSlopeStartR; |
@@ -5348,28 +5305,29 @@ discard block |
||
5348 | 5305 | |
5349 | 5306 | $Color = array("R"=>$R,"G"=>$G,"B"=>$B); |
5350 | 5307 | |
5351 | - if ( $ShadedSlopeBox && $LastColor != NULL ) // && $Slope != 0 |
|
5308 | + if ( $ShadedSlopeBox && $LastColor != NULL ) { |
|
5309 | + // && $Slope != 0 |
|
5352 | 5310 | { |
5353 | 5311 | $GradientSettings = array("StartR"=>$LastColor["R"],"StartG"=>$LastColor["G"],"StartB"=>$LastColor["B"],"EndR"=>$R,"EndG"=>$G,"EndB"=>$B); |
5312 | + } |
|
5354 | 5313 | $this->drawGradientArea($LastX,$TopY,$X,$BottomY,DIRECTION_HORIZONTAL,$GradientSettings); |
5355 | - } |
|
5356 | - elseif ( !$ShadedSlopeBox || $LastColor == NULL ) // || $Slope == 0 |
|
5314 | + } elseif ( !$ShadedSlopeBox || $LastColor == NULL ) { |
|
5315 | + // || $Slope == 0 |
|
5357 | 5316 | $this->drawFilledRectangle(floor($LastX),$TopY,floor($X),$BottomY,$Color); |
5317 | + } |
|
5358 | 5318 | |
5359 | 5319 | $LastColor = $Color; |
5360 | 5320 | } |
5361 | 5321 | |
5362 | 5322 | if ( $Y == VOID ) |
5363 | - { $LastY = NULL; } |
|
5364 | - else |
|
5323 | + { $LastY = NULL; } else |
|
5365 | 5324 | { $LastX = $X; $LastY = $Y; } |
5366 | 5325 | |
5367 | 5326 | $X = $X + $XStep; |
5368 | 5327 | } |
5369 | 5328 | |
5370 | 5329 | $YPos = $YPos + $CaptionHeight + $SerieSpacing; |
5371 | - } |
|
5372 | - else |
|
5330 | + } else |
|
5373 | 5331 | { |
5374 | 5332 | if ( $Caption ) |
5375 | 5333 | { |
@@ -5380,9 +5338,9 @@ discard block |
||
5380 | 5338 | $CaptionSettings = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight); |
5381 | 5339 | if ( $CaptionBox ) { $this->drawFilledRectangle($XPos,$StartY,$XPos+$CaptionHeight,$EndY,array("R"=>$CaptionFillR,"G"=>$CaptionFillG,"B"=>$CaptionFillB,"BorderR"=>$CaptionBorderR,"BorderG"=>$CaptionBorderG,"BorderB"=>$CaptionBorderB,"Alpha"=>$CaptionFillAlpha)); } |
5382 | 5340 | $this->drawLine($XPos+($CaptionHeight/2),$StartY+2,$XPos+($CaptionHeight/2),$EndY-2,$CaptionSettings); |
5383 | - } |
|
5384 | - else |
|
5385 | - $this->drawFilledRectangle($XPos,$StartY,$XPos+$CaptionHeight,$EndY,array("R"=>$R,"G"=>$G,"B"=>$B,"BorderR"=>$CaptionBorderR,"BorderG"=>$CaptionBorderG,"BorderB"=>$CaptionBorderB)); |
|
5341 | + } else { |
|
5342 | + $this->drawFilledRectangle($XPos,$StartY,$XPos+$CaptionHeight,$EndY,array("R"=>$R,"G"=>$G,"B"=>$B,"BorderR"=>$CaptionBorderR,"BorderG"=>$CaptionBorderG,"BorderB"=>$CaptionBorderB)); |
|
5343 | + } |
|
5386 | 5344 | } |
5387 | 5345 | |
5388 | 5346 | |
@@ -5411,8 +5369,7 @@ discard block |
||
5411 | 5369 | { $Slope = ($X - $LastX); if ( $Slope > $MaxSlope ) { $MaxSlope = $Slope; } if ( $Slope < $MinSlope ) { $MinSlope = $Slope; } } |
5412 | 5370 | |
5413 | 5371 | if ( $X == VOID ) |
5414 | - { $LastX = NULL; } |
|
5415 | - else |
|
5372 | + { $LastX = NULL; } else |
|
5416 | 5373 | { $LastX = $X; } |
5417 | 5374 | } |
5418 | 5375 | |
@@ -5429,8 +5386,7 @@ discard block |
||
5429 | 5386 | $R = (($PositiveSlopeEndR - $PositiveSlopeStartR)/100)*$SlopeIndex+$PositiveSlopeStartR; |
5430 | 5387 | $G = (($PositiveSlopeEndG - $PositiveSlopeStartG)/100)*$SlopeIndex+$PositiveSlopeStartG; |
5431 | 5388 | $B = (($PositiveSlopeEndB - $PositiveSlopeStartB)/100)*$SlopeIndex+$PositiveSlopeStartB; |
5432 | - } |
|
5433 | - elseif ( $Slope < 0 ) |
|
5389 | + } elseif ( $Slope < 0 ) |
|
5434 | 5390 | { |
5435 | 5391 | $SlopeIndex = (100 / abs($MinSlope)) * abs($Slope); |
5436 | 5392 | $R = (($NegativeSlopeEndR - $NegativeSlopeStartR)/100)*$SlopeIndex+$NegativeSlopeStartR; |
@@ -5445,16 +5401,15 @@ discard block |
||
5445 | 5401 | $GradientSettings = array("StartR"=>$LastColor["R"],"StartG"=>$LastColor["G"],"StartB"=>$LastColor["B"],"EndR"=>$R,"EndG"=>$G,"EndB"=>$B); |
5446 | 5402 | |
5447 | 5403 | $this->drawGradientArea($TopX,$LastY,$BottomX,$Y,DIRECTION_VERTICAL,$GradientSettings); |
5448 | - } |
|
5449 | - elseif ( !$ShadedSlopeBox || $LastColor == NULL ) |
|
5450 | - $this->drawFilledRectangle($TopX,floor($LastY),$BottomX,floor($Y),$Color); |
|
5404 | + } elseif ( !$ShadedSlopeBox || $LastColor == NULL ) { |
|
5405 | + $this->drawFilledRectangle($TopX,floor($LastY),$BottomX,floor($Y),$Color); |
|
5406 | + } |
|
5451 | 5407 | |
5452 | 5408 | $LastColor = $Color; |
5453 | 5409 | } |
5454 | 5410 | |
5455 | 5411 | if ( $X == VOID ) |
5456 | - { $LastX = NULL; } |
|
5457 | - else |
|
5412 | + { $LastX = NULL; } else |
|
5458 | 5413 | { $LastX = $X; $LastY = $Y; } |
5459 | 5414 | |
5460 | 5415 | $Y = $Y + $XStep; |
@@ -5527,8 +5482,7 @@ discard block |
||
5527 | 5482 | if ( $Y2 > $this->GraphAreaY2 ) { $X2 = $X2 - ($Y2-$this->GraphAreaY2); $Y2 = $this->GraphAreaY2; } |
5528 | 5483 | |
5529 | 5484 | $this->drawLine($X1,$Y1,$X2,$Y2,$Color); |
5530 | - } |
|
5531 | - else |
|
5485 | + } else |
|
5532 | 5486 | { |
5533 | 5487 | if ( $XDivs == 0 ) { $YStep = ($this->GraphAreaY2-$this->GraphAreaY1)/4; } else { $YStep = ($this->GraphAreaY2-$this->GraphAreaY1-$XMargin*2)/$XDivs; } |
5534 | 5488 | $Y = $this->GraphAreaY1 + $XMargin; |
@@ -5605,17 +5559,18 @@ discard block |
||
5605 | 5559 | { |
5606 | 5560 | $AxisID = $Data["Series"][$SerieName]["Axis"]; |
5607 | 5561 | |
5608 | - if ( $OverrideTitle != NULL) |
|
5609 | - $Description = $OverrideTitle; |
|
5610 | - elseif ( count($SeriesName) == 1 ) |
|
5562 | + if ( $OverrideTitle != NULL) { |
|
5563 | + $Description = $OverrideTitle; |
|
5564 | + } elseif ( count($SeriesName) == 1 ) |
|
5611 | 5565 | { |
5612 | - if ( isset($Data["Abscissa"]) && isset($Data["Series"][$Data["Abscissa"]]["Data"][$Index]) ) |
|
5613 | - $Description = $Data["Series"][$SerieName]["Description"]." - ".$Data["Series"][$Data["Abscissa"]]["Data"][$Index]; |
|
5614 | - else |
|
5615 | - $Description = $Data["Series"][$SerieName]["Description"]; |
|
5616 | - } |
|
5617 | - elseif ( isset($Data["Abscissa"]) && isset($Data["Series"][$Data["Abscissa"]]["Data"][$Index]) ) |
|
5618 | - $Description = $Data["Series"][$Data["Abscissa"]]["Data"][$Index]; |
|
5566 | + if ( isset($Data["Abscissa"]) && isset($Data["Series"][$Data["Abscissa"]]["Data"][$Index]) ) { |
|
5567 | + $Description = $Data["Series"][$SerieName]["Description"]." - ".$Data["Series"][$Data["Abscissa"]]["Data"][$Index]; |
|
5568 | + } else { |
|
5569 | + $Description = $Data["Series"][$SerieName]["Description"]; |
|
5570 | + } |
|
5571 | + } elseif ( isset($Data["Abscissa"]) && isset($Data["Series"][$Data["Abscissa"]]["Data"][$Index]) ) { |
|
5572 | + $Description = $Data["Series"][$Data["Abscissa"]]["Data"][$Index]; |
|
5573 | + } |
|
5619 | 5574 | |
5620 | 5575 | $AxisMode = $Data["Axis"][$AxisID]["Display"]; |
5621 | 5576 | $AxisFormat = $Data["Axis"][$AxisID]["Format"]; |
@@ -5627,18 +5582,20 @@ discard block |
||
5627 | 5582 | $Serie["B"] = $Data["Series"][$SerieName]["Color"]["B"]; |
5628 | 5583 | $Serie["Alpha"] = $Data["Series"][$SerieName]["Color"]["Alpha"]; |
5629 | 5584 | |
5630 | - if ( count($SeriesName) == 1 && isset($Data["Series"][$SerieName]["XOffset"]) ) |
|
5631 | - $SerieOffset = $Data["Series"][$SerieName]["XOffset"]; |
|
5632 | - else |
|
5633 | - $SerieOffset = 0; |
|
5585 | + if ( count($SeriesName) == 1 && isset($Data["Series"][$SerieName]["XOffset"]) ) { |
|
5586 | + $SerieOffset = $Data["Series"][$SerieName]["XOffset"]; |
|
5587 | + } else { |
|
5588 | + $SerieOffset = 0; |
|
5589 | + } |
|
5634 | 5590 | |
5635 | 5591 | $Value = $Data["Series"][$SerieName]["Data"][$Index]; |
5636 | 5592 | if ( $Value == VOID ) { $Value = "NaN"; } |
5637 | 5593 | |
5638 | - if ( $ForceLabels != NULL ) |
|
5639 | - $Caption = isset($ForceLabels[$Key]) ? $ForceLabels[$Key] : "Not set"; |
|
5640 | - else |
|
5641 | - $Caption = $this->scaleFormat($Value,$AxisMode,$AxisFormat,$AxisUnit); |
|
5594 | + if ( $ForceLabels != NULL ) { |
|
5595 | + $Caption = isset($ForceLabels[$Key]) ? $ForceLabels[$Key] : "Not set"; |
|
5596 | + } else { |
|
5597 | + $Caption = $this->scaleFormat($Value,$AxisMode,$AxisFormat,$AxisUnit); |
|
5598 | + } |
|
5642 | 5599 | |
5643 | 5600 | if ( $this->LastChartLayout == CHART_LAST_LAYOUT_STACKED ) |
5644 | 5601 | { |
@@ -5664,18 +5621,18 @@ discard block |
||
5664 | 5621 | |
5665 | 5622 | if ($Y < $MinY) { $MinY = $Y; } |
5666 | 5623 | |
5667 | - if ( $DrawPoint == LABEL_POINT_CIRCLE ) |
|
5668 | - $this->drawFilledCircle($X,$Y,3,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0)); |
|
5669 | - elseif ( $DrawPoint == LABEL_POINT_BOX ) |
|
5670 | - $this->drawFilledRectangle($X-2,$Y-2,$X+2,$Y+2,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0)); |
|
5624 | + if ( $DrawPoint == LABEL_POINT_CIRCLE ) { |
|
5625 | + $this->drawFilledCircle($X,$Y,3,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0)); |
|
5626 | + } elseif ( $DrawPoint == LABEL_POINT_BOX ) { |
|
5627 | + $this->drawFilledRectangle($X-2,$Y-2,$X+2,$Y+2,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0)); |
|
5628 | + } |
|
5671 | 5629 | |
5672 | 5630 | $Series[] = array("Format"=>$Serie,"Caption"=>$Caption); |
5673 | 5631 | } |
5674 | 5632 | } |
5675 | 5633 | $this->drawLabelBox($X,$MinY-3,$Description,$Series,$Format); |
5676 | 5634 | |
5677 | - } |
|
5678 | - else |
|
5635 | + } else |
|
5679 | 5636 | { |
5680 | 5637 | if ( $XDivs == 0 ) { $XStep = ($this->GraphAreaY2-$this->GraphAreaY1)/4; } else { $XStep = ($this->GraphAreaY2-$this->GraphAreaY1-$XMargin*2)/$XDivs; } |
5681 | 5638 | $Y = $this->GraphAreaY1 + $XMargin + $Index * $XStep; |
@@ -5689,17 +5646,18 @@ discard block |
||
5689 | 5646 | { |
5690 | 5647 | $AxisID = $Data["Series"][$SerieName]["Axis"]; |
5691 | 5648 | |
5692 | - if ( $OverrideTitle != NULL) |
|
5693 | - $Description = $OverrideTitle; |
|
5694 | - elseif ( count($SeriesName) == 1 ) |
|
5649 | + if ( $OverrideTitle != NULL) { |
|
5650 | + $Description = $OverrideTitle; |
|
5651 | + } elseif ( count($SeriesName) == 1 ) |
|
5695 | 5652 | { |
5696 | - if ( isset($Data["Abscissa"]) && isset($Data["Series"][$Data["Abscissa"]]["Data"][$Index]) ) |
|
5697 | - $Description = $Data["Series"][$SerieName]["Description"]." - ".$Data["Series"][$Data["Abscissa"]]["Data"][$Index]; |
|
5698 | - else |
|
5699 | - $Description = $Data["Series"][$SerieName]["Description"]; |
|
5700 | - } |
|
5701 | - elseif ( isset($Data["Abscissa"]) && isset($Data["Series"][$Data["Abscissa"]]["Data"][$Index]) ) |
|
5702 | - $Description = $Data["Series"][$Data["Abscissa"]]["Data"][$Index]; |
|
5653 | + if ( isset($Data["Abscissa"]) && isset($Data["Series"][$Data["Abscissa"]]["Data"][$Index]) ) { |
|
5654 | + $Description = $Data["Series"][$SerieName]["Description"]." - ".$Data["Series"][$Data["Abscissa"]]["Data"][$Index]; |
|
5655 | + } else { |
|
5656 | + $Description = $Data["Series"][$SerieName]["Description"]; |
|
5657 | + } |
|
5658 | + } elseif ( isset($Data["Abscissa"]) && isset($Data["Series"][$Data["Abscissa"]]["Data"][$Index]) ) { |
|
5659 | + $Description = $Data["Series"][$Data["Abscissa"]]["Data"][$Index]; |
|
5660 | + } |
|
5703 | 5661 | |
5704 | 5662 | $AxisMode = $Data["Axis"][$AxisID]["Display"]; |
5705 | 5663 | $AxisFormat = $Data["Axis"][$AxisID]["Format"]; |
@@ -5712,8 +5670,7 @@ discard block |
||
5712 | 5670 | $Serie["G"] = $Data["Extended"]["Palette"][$Index]["G"]; |
5713 | 5671 | $Serie["B"] = $Data["Extended"]["Palette"][$Index]["B"]; |
5714 | 5672 | $Serie["Alpha"] = $Data["Extended"]["Palette"][$Index]["Alpha"]; |
5715 | - } |
|
5716 | - else |
|
5673 | + } else |
|
5717 | 5674 | { |
5718 | 5675 | $Serie["R"] = $Data["Series"][$SerieName]["Color"]["R"]; |
5719 | 5676 | $Serie["G"] = $Data["Series"][$SerieName]["Color"]["G"]; |
@@ -5721,16 +5678,18 @@ discard block |
||
5721 | 5678 | $Serie["Alpha"] = $Data["Series"][$SerieName]["Color"]["Alpha"]; |
5722 | 5679 | } |
5723 | 5680 | |
5724 | - if ( count($SeriesName) == 1 && isset($Data["Series"][$SerieName]["XOffset"]) ) |
|
5725 | - $SerieOffset = $Data["Series"][$SerieName]["XOffset"]; |
|
5726 | - else |
|
5727 | - $SerieOffset = 0; |
|
5681 | + if ( count($SeriesName) == 1 && isset($Data["Series"][$SerieName]["XOffset"]) ) { |
|
5682 | + $SerieOffset = $Data["Series"][$SerieName]["XOffset"]; |
|
5683 | + } else { |
|
5684 | + $SerieOffset = 0; |
|
5685 | + } |
|
5728 | 5686 | |
5729 | 5687 | $Value = $Data["Series"][$SerieName]["Data"][$Index]; |
5730 | - if ( $ForceLabels != NULL ) |
|
5731 | - $Caption = isset($ForceLabels[$Key]) ? $ForceLabels[$Key] : "Not set"; |
|
5732 | - else |
|
5733 | - $Caption = $this->scaleFormat($Value,$AxisMode,$AxisFormat,$AxisUnit); |
|
5688 | + if ( $ForceLabels != NULL ) { |
|
5689 | + $Caption = isset($ForceLabels[$Key]) ? $ForceLabels[$Key] : "Not set"; |
|
5690 | + } else { |
|
5691 | + $Caption = $this->scaleFormat($Value,$AxisMode,$AxisFormat,$AxisUnit); |
|
5692 | + } |
|
5734 | 5693 | if ( $Value == VOID ) { $Value = "NaN"; } |
5735 | 5694 | |
5736 | 5695 | if ( $this->LastChartLayout == CHART_LAST_LAYOUT_STACKED ) |
@@ -5757,10 +5716,11 @@ discard block |
||
5757 | 5716 | |
5758 | 5717 | if ($X < $MinX) { $MinX = $X; } |
5759 | 5718 | |
5760 | - if ( $DrawPoint == LABEL_POINT_CIRCLE ) |
|
5761 | - $this->drawFilledCircle($X,$Y,3,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0)); |
|
5762 | - elseif ( $DrawPoint == LABEL_POINT_BOX ) |
|
5763 | - $this->drawFilledRectangle($X-2,$Y-2,$X+2,$Y+2,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0)); |
|
5719 | + if ( $DrawPoint == LABEL_POINT_CIRCLE ) { |
|
5720 | + $this->drawFilledCircle($X,$Y,3,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0)); |
|
5721 | + } elseif ( $DrawPoint == LABEL_POINT_BOX ) { |
|
5722 | + $this->drawFilledRectangle($X-2,$Y-2,$X+2,$Y+2,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0)); |
|
5723 | + } |
|
5764 | 5724 | |
5765 | 5725 | $Series[] = array("Format"=>$Serie,"Caption"=>$Caption); |
5766 | 5726 | } |
@@ -5844,8 +5804,7 @@ discard block |
||
5844 | 5804 | { |
5845 | 5805 | $Poly[] = $XMax+$this->ShadowX; $Poly[] = $Y-5-$TitleHeight-$CaptionHeight-$HorizontalMargin*2+$this->ShadowX; |
5846 | 5806 | $Poly[] = $XMin+$this->ShadowX; $Poly[] = $Y-5-$TitleHeight-$CaptionHeight-$HorizontalMargin*2+$this->ShadowX; |
5847 | - } |
|
5848 | - else |
|
5807 | + } else |
|
5849 | 5808 | { |
5850 | 5809 | $Poly[] = $XMax+$this->ShadowX; $Poly[] = $Y-5-$TitleHeight-$CaptionHeight-$HorizontalMargin*3+$this->ShadowX; |
5851 | 5810 | $Poly[] = $XMin+$this->ShadowX; $Poly[] = $Y-5-$TitleHeight-$CaptionHeight-$HorizontalMargin*3+$this->ShadowX; |
@@ -5858,10 +5817,11 @@ discard block |
||
5858 | 5817 | |
5859 | 5818 | /* Draw the background */ |
5860 | 5819 | $GradientSettings = array("StartR"=>$GradientStartR,"StartG"=>$GradientStartG,"StartB"=>$GradientStartB,"EndR"=>$GradientEndR,"EndG"=>$GradientEndG,"EndB"=>$GradientEndB); |
5861 | - if ( $NoTitle ) |
|
5862 | - $this->drawGradientArea($XMin,$Y-5-$TitleHeight-$CaptionHeight-$HorizontalMargin*2,$XMax,$Y-6,DIRECTION_VERTICAL,$GradientSettings); |
|
5863 | - else |
|
5864 | - $this->drawGradientArea($XMin,$Y-5-$TitleHeight-$CaptionHeight-$HorizontalMargin*3,$XMax,$Y-6,DIRECTION_VERTICAL,$GradientSettings); |
|
5820 | + if ( $NoTitle ) { |
|
5821 | + $this->drawGradientArea($XMin,$Y-5-$TitleHeight-$CaptionHeight-$HorizontalMargin*2,$XMax,$Y-6,DIRECTION_VERTICAL,$GradientSettings); |
|
5822 | + } else { |
|
5823 | + $this->drawGradientArea($XMin,$Y-5-$TitleHeight-$CaptionHeight-$HorizontalMargin*3,$XMax,$Y-6,DIRECTION_VERTICAL,$GradientSettings); |
|
5824 | + } |
|
5865 | 5825 | $Poly = ""; $Poly[] = $X; $Poly[] = $Y; $Poly[] = $X-5; $Poly[] = $Y-5; $Poly[] = $X+5; $Poly[] = $Y-5; |
5866 | 5826 | $this->drawPolygon($Poly,array("R"=>$GradientEndR,"G"=>$GradientEndG,"B"=>$GradientEndB,"NoBorder"=>TRUE)); |
5867 | 5827 | |
@@ -5876,8 +5836,7 @@ discard block |
||
5876 | 5836 | imageline($this->Picture,$XMin,$Y-5-$TitleHeight-$CaptionHeight-$HorizontalMargin*2,$XMin,$Y-5,$OuterBorderColor); |
5877 | 5837 | imageline($this->Picture,$XMax,$Y-5-$TitleHeight-$CaptionHeight-$HorizontalMargin*2,$XMax,$Y-5,$OuterBorderColor); |
5878 | 5838 | imageline($this->Picture,$XMin,$Y-5-$TitleHeight-$CaptionHeight-$HorizontalMargin*2,$XMax,$Y-5-$TitleHeight-$CaptionHeight-$HorizontalMargin*2,$OuterBorderColor); |
5879 | - } |
|
5880 | - else |
|
5839 | + } else |
|
5881 | 5840 | { |
5882 | 5841 | imageline($this->Picture,$XMin,$Y-5-$TitleHeight-$CaptionHeight-$HorizontalMargin*3,$XMin,$Y-5,$OuterBorderColor); |
5883 | 5842 | imageline($this->Picture,$XMax,$Y-5-$TitleHeight-$CaptionHeight-$HorizontalMargin*3,$XMax,$Y-5,$OuterBorderColor); |
@@ -5895,8 +5854,7 @@ discard block |
||
5895 | 5854 | imageline($this->Picture,$XMin+1,$Y-4-$TitleHeight-$CaptionHeight-$HorizontalMargin*2,$XMin+1,$Y-6,$InnerBorderColor); |
5896 | 5855 | imageline($this->Picture,$XMax-1,$Y-4-$TitleHeight-$CaptionHeight-$HorizontalMargin*2,$XMax-1,$Y-6,$InnerBorderColor); |
5897 | 5856 | imageline($this->Picture,$XMin+1,$Y-4-$TitleHeight-$CaptionHeight-$HorizontalMargin*2,$XMax-1,$Y-4-$TitleHeight-$CaptionHeight-$HorizontalMargin*2,$InnerBorderColor); |
5898 | - } |
|
5899 | - else |
|
5857 | + } else |
|
5900 | 5858 | { |
5901 | 5859 | imageline($this->Picture,$XMin+1,$Y-4-$TitleHeight-$CaptionHeight-$HorizontalMargin*3,$XMin+1,$Y-6,$InnerBorderColor); |
5902 | 5860 | imageline($this->Picture,$XMax-1,$Y-4-$TitleHeight-$CaptionHeight-$HorizontalMargin*3,$XMax-1,$Y-6,$InnerBorderColor); |
@@ -5910,16 +5868,16 @@ discard block |
||
5910 | 5868 | $XMargin = $VerticalMargin / 2; |
5911 | 5869 | $this->drawLine($XMin+$XMargin,$YPos+1,$XMax-$XMargin,$YPos+1,array("R"=>$GradientEndR,"G"=>$GradientEndG,"B"=>$GradientEndB)); |
5912 | 5870 | $this->drawLine($XMin+$XMargin,$YPos,$XMax-$XMargin,$YPos,array("R"=>$GradientStartR,"G"=>$GradientStartG,"B"=>$GradientStartB)); |
5913 | - } |
|
5914 | - elseif ( $TitleMode == LABEL_TITLE_BACKGROUND ) |
|
5871 | + } elseif ( $TitleMode == LABEL_TITLE_BACKGROUND ) |
|
5915 | 5872 | { |
5916 | 5873 | $this->drawFilledRectangle($XMin,$Y-5-$TitleHeight-$CaptionHeight-$HorizontalMargin*3,$XMax,$Y-5-$TitleHeight-$CaptionHeight-$HorizontalMargin+$HorizontalMargin/2,array("R"=>$TitleBackgroundR,"G"=>$TitleBackgroundG,"B"=>$TitleBackgroundB)); |
5917 | 5874 | imageline($this->Picture,$XMin+1,$Y-5-$TitleHeight-$CaptionHeight-$HorizontalMargin+$HorizontalMargin/2+1,$XMax-1,$Y-5-$TitleHeight-$CaptionHeight-$HorizontalMargin+$HorizontalMargin/2+1,$InnerBorderColor); |
5918 | 5875 | } |
5919 | 5876 | |
5920 | 5877 | /* Write the description */ |
5921 | - if ( !$NoTitle ) |
|
5922 | - $this->drawText($XMin+$VerticalMargin,$Y-7-$CaptionHeight-$HorizontalMargin*2,$Title,array("Align"=>TEXT_ALIGN_BOTTOMLEFT,"R"=>$TitleR,"G"=>$TitleG,"B"=>$TitleB)); |
|
5878 | + if ( !$NoTitle ) { |
|
5879 | + $this->drawText($XMin+$VerticalMargin,$Y-7-$CaptionHeight-$HorizontalMargin*2,$Title,array("Align"=>TEXT_ALIGN_BOTTOMLEFT,"R"=>$TitleR,"G"=>$TitleG,"B"=>$TitleB)); |
|
5880 | + } |
|
5923 | 5881 | |
5924 | 5882 | /* Write the value */ |
5925 | 5883 | $YPos = $Y-5-$HorizontalMargin; $XPos = $XMin+$VerticalMargin+$SerieBoxSize+$SerieBoxSpacing; |
@@ -5951,13 +5909,11 @@ discard block |
||
5951 | 5909 | { |
5952 | 5910 | if ( $PlotBorder ) { $this->drawFilledCircle($X,$Y,$PlotSize+$BorderSize,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha)); } |
5953 | 5911 | $this->drawFilledCircle($X,$Y,$PlotSize,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha)); |
5954 | - } |
|
5955 | - elseif ( $Shape == SERIE_SHAPE_FILLEDSQUARE ) |
|
5912 | + } elseif ( $Shape == SERIE_SHAPE_FILLEDSQUARE ) |
|
5956 | 5913 | { |
5957 | 5914 | if ( $PlotBorder ) { $this->drawFilledRectangle($X-$PlotSize-$BorderSize,$Y-$PlotSize-$BorderSize,$X+$PlotSize+$BorderSize,$Y+$PlotSize+$BorderSize,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha)); } |
5958 | 5915 | $this->drawFilledRectangle($X-$PlotSize,$Y-$PlotSize,$X+$PlotSize,$Y+$PlotSize,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha)); |
5959 | - } |
|
5960 | - elseif ( $Shape == SERIE_SHAPE_FILLEDTRIANGLE ) |
|
5916 | + } elseif ( $Shape == SERIE_SHAPE_FILLEDTRIANGLE ) |
|
5961 | 5917 | { |
5962 | 5918 | if ( $PlotBorder ) |
5963 | 5919 | { |
@@ -5967,23 +5923,20 @@ discard block |
||
5967 | 5923 | |
5968 | 5924 | $Pos = ""; $Pos[]=$X; $Pos[]=$Y-$PlotSize; $Pos[]=$X-$PlotSize; $Pos[]=$Y+$PlotSize; $Pos[]=$X+$PlotSize; $Pos[]=$Y+$PlotSize; |
5969 | 5925 | $this->drawPolygon($Pos,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha)); |
5970 | - } |
|
5971 | - elseif ( $Shape == SERIE_SHAPE_TRIANGLE ) |
|
5926 | + } elseif ( $Shape == SERIE_SHAPE_TRIANGLE ) |
|
5972 | 5927 | { |
5973 | 5928 | $this->drawLine($X,$Y-$PlotSize,$X-$PlotSize,$Y+$PlotSize,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha)); |
5974 | 5929 | $this->drawLine($X-$PlotSize,$Y+$PlotSize,$X+$PlotSize,$Y+$PlotSize,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha)); |
5975 | 5930 | $this->drawLine($X+$PlotSize,$Y+$PlotSize,$X,$Y-$PlotSize,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha)); |
5976 | - } |
|
5977 | - elseif ( $Shape == SERIE_SHAPE_SQUARE ) |
|
5978 | - $this->drawRectangle($X-$PlotSize,$Y-$PlotSize,$X+$PlotSize,$Y+$PlotSize,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha)); |
|
5979 | - elseif ( $Shape == SERIE_SHAPE_CIRCLE ) |
|
5980 | - $this->drawCircle($X,$Y,$PlotSize,$PlotSize,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha)); |
|
5981 | - elseif ( $Shape == SERIE_SHAPE_DIAMOND ) |
|
5931 | + } elseif ( $Shape == SERIE_SHAPE_SQUARE ) { |
|
5932 | + $this->drawRectangle($X-$PlotSize,$Y-$PlotSize,$X+$PlotSize,$Y+$PlotSize,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha)); |
|
5933 | + } elseif ( $Shape == SERIE_SHAPE_CIRCLE ) { |
|
5934 | + $this->drawCircle($X,$Y,$PlotSize,$PlotSize,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha)); |
|
5935 | + } elseif ( $Shape == SERIE_SHAPE_DIAMOND ) |
|
5982 | 5936 | { |
5983 | 5937 | $Pos = ""; $Pos[]=$X-$PlotSize; $Pos[]=$Y; $Pos[]=$X; $Pos[]=$Y-$PlotSize; $Pos[]=$X+$PlotSize; $Pos[]=$Y; $Pos[]=$X; $Pos[]=$Y+$PlotSize; |
5984 | 5938 | $this->drawPolygon($Pos,array("NoFill"=>TRUE,"BorderR"=>$R,"BorderG"=>$G,"BorderB"=>$B,"BorderAlpha"=>$Alpha)); |
5985 | - } |
|
5986 | - elseif ( $Shape == SERIE_SHAPE_FILLEDDIAMOND ) |
|
5939 | + } elseif ( $Shape == SERIE_SHAPE_FILLEDDIAMOND ) |
|
5987 | 5940 | { |
5988 | 5941 | if ( $PlotBorder ) |
5989 | 5942 | { |
@@ -6035,8 +5988,7 @@ discard block |
||
6035 | 5988 | if ( $inHorizon ) { $inHorizon = FALSE; $Result[] = array("X1"=>$LastX,"Y1"=>$Pos["Y1"],"X2"=>$Pos["X1"],"Y2"=>$Pos["Y1"]); } |
6036 | 5989 | |
6037 | 5990 | $Result[] = array("X1"=>$Pos["X1"],"Y1"=>$Pos["Y1"],"X2"=>$Pos["X2"],"Y2"=>$Pos["Y2"]); |
6038 | - } |
|
6039 | - else { if ( !$inHorizon ) { $inHorizon = TRUE; $LastX = $Pos["X1"];} } |
|
5991 | + } else { if ( !$inHorizon ) { $inHorizon = TRUE; $LastX = $Pos["X1"];} } |
|
6040 | 5992 | } |
6041 | 5993 | $Segments = $Result; |
6042 | 5994 | |
@@ -6078,30 +6030,24 @@ discard block |
||
6078 | 6030 | if ( min($Y1,$Y2) <= $Y && max($Y1,$Y2) >= $Y ) |
6079 | 6031 | { |
6080 | 6032 | if ( $Y1 == $Y2 ) |
6081 | - { $X = $X1; } |
|
6082 | - else |
|
6033 | + { $X = $X1; } else |
|
6083 | 6034 | { $X = $X1 + ( ($Y-$Y1)*$X2 - ($Y-$Y1)*$X1 ) / ($Y2-$Y1); } |
6084 | 6035 | |
6085 | 6036 | $X = floor($X); |
6086 | 6037 | |
6087 | 6038 | if ( $X2 == $X1 ) |
6088 | - { $Slope = "!"; } |
|
6089 | - else |
|
6039 | + { $Slope = "!"; } else |
|
6090 | 6040 | { |
6091 | 6041 | $SlopeC = ($Y2 - $Y1) / ($X2 - $X1); |
6092 | 6042 | if( $SlopeC == 0 ) |
6093 | - { $Slope = "="; } |
|
6094 | - elseif( $SlopeC > 0 ) |
|
6095 | - { $Slope = "+"; } |
|
6096 | - elseif ( $SlopeC < 0 ) |
|
6043 | + { $Slope = "="; } elseif( $SlopeC > 0 ) |
|
6044 | + { $Slope = "+"; } elseif ( $SlopeC < 0 ) |
|
6097 | 6045 | { $Slope = "-"; } |
6098 | 6046 | } |
6099 | 6047 | |
6100 | 6048 | if ( !is_array($Intersections) ) |
6101 | - { $Intersections[] = $X; } |
|
6102 | - elseif( !in_array($X,$Intersections) ) |
|
6103 | - { $Intersections[] = $X; } |
|
6104 | - elseif( in_array($X,$Intersections) ) |
|
6049 | + { $Intersections[] = $X; } elseif( !in_array($X,$Intersections) ) |
|
6050 | + { $Intersections[] = $X; } elseif( in_array($X,$Intersections) ) |
|
6105 | 6051 | { |
6106 | 6052 | if ($Y == $DebugLine) { echo $Slope."/".$LastSlope."(".$X.") "; } |
6107 | 6053 | |
@@ -6138,9 +6084,9 @@ discard block |
||
6138 | 6084 | $LastX = OUT_OF_SIGHT; |
6139 | 6085 | foreach($Intersections as $Key => $X) |
6140 | 6086 | { |
6141 | - if ( $LastX == OUT_OF_SIGHT ) |
|
6142 | - $LastX = $X; |
|
6143 | - elseif ( $LastX != OUT_OF_SIGHT ) |
|
6087 | + if ( $LastX == OUT_OF_SIGHT ) { |
|
6088 | + $LastX = $X; |
|
6089 | + } elseif ( $LastX != OUT_OF_SIGHT ) |
|
6144 | 6090 | { |
6145 | 6091 | if ( $this->getFirstDecimal($LastX) > 1 ) { $LastX++; } |
6146 | 6092 | |
@@ -6175,8 +6121,9 @@ discard block |
||
6175 | 6121 | /* Draw the polygon border, if required */ |
6176 | 6122 | if ( !$NoBorder) |
6177 | 6123 | { |
6178 | - foreach($Segments as $Key => $Coords) |
|
6179 | - $this->drawLine($Coords["X1"],$Coords["Y1"],$Coords["X2"],$Coords["Y2"],array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Threshold"=>$Threshold)); |
|
6124 | + foreach($Segments as $Key => $Coords) { |
|
6125 | + $this->drawLine($Coords["X1"],$Coords["Y1"],$Coords["X2"],$Coords["Y2"],array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Threshold"=>$Threshold)); |
|
6126 | + } |
|
6180 | 6127 | } |
6181 | 6128 | |
6182 | 6129 | $this->Shadow = $RestoreShadow; |
@@ -84,16 +84,17 @@ discard block |
||
84 | 84 | /* Add a single point or an array to the given serie */ |
85 | 85 | function addPoints($Values,$SerieName="Serie1") |
86 | 86 | { |
87 | - if (!isset($this->Data["Series"][$SerieName])) |
|
88 | - $this->initialise($SerieName); |
|
87 | + if (!isset($this->Data["Series"][$SerieName])) { |
|
88 | + $this->initialise($SerieName); |
|
89 | + } |
|
89 | 90 | |
90 | 91 | if ( is_array($Values) ) |
91 | 92 | { |
92 | 93 | foreach($Values as $Key => $Value) |
93 | 94 | { $this->Data["Series"][$SerieName]["Data"][] = $Value; } |
94 | - } |
|
95 | - else |
|
96 | - $this->Data["Series"][$SerieName]["Data"][] = $Values; |
|
95 | + } else { |
|
96 | + $this->Data["Series"][$SerieName]["Data"][] = $Values; |
|
97 | + } |
|
97 | 98 | |
98 | 99 | if ( $Values != VOID ) |
99 | 100 | { |
@@ -273,9 +274,9 @@ discard block |
||
273 | 274 | { |
274 | 275 | $SerieData = $this->stripVOID($this->Data["Series"][$Serie]["Data"]); |
275 | 276 | return(array_sum($SerieData)/sizeof($SerieData)); |
276 | - } |
|
277 | - else |
|
278 | - return(NULL); |
|
277 | + } else { |
|
278 | + return(NULL); |
|
279 | + } |
|
279 | 280 | } |
280 | 281 | |
281 | 282 | /* Return the geometric mean of the given serie */ |
@@ -286,9 +287,9 @@ discard block |
||
286 | 287 | $SerieData = $this->stripVOID($this->Data["Series"][$Serie]["Data"]); |
287 | 288 | $Seriesum = 1; foreach($SerieData as $Key => $Value) { $Seriesum = $Seriesum * $Value; } |
288 | 289 | return(pow($Seriesum,1/sizeof($SerieData))); |
289 | - } |
|
290 | - else |
|
291 | - return(NULL); |
|
290 | + } else { |
|
291 | + return(NULL); |
|
292 | + } |
|
292 | 293 | } |
293 | 294 | |
294 | 295 | /* Return the harmonic mean of the given serie */ |
@@ -299,9 +300,9 @@ discard block |
||
299 | 300 | $SerieData = $this->stripVOID($this->Data["Series"][$Serie]["Data"]); |
300 | 301 | $Seriesum = 0; foreach($SerieData as $Key => $Value) { $Seriesum = $Seriesum + 1/$Value; } |
301 | 302 | return(sizeof($SerieData)/$Seriesum); |
302 | - } |
|
303 | - else |
|
304 | - return(NULL); |
|
303 | + } else { |
|
304 | + return(NULL); |
|
305 | + } |
|
305 | 306 | } |
306 | 307 | |
307 | 308 | /* Return the standard deviation of the given serie */ |
@@ -313,15 +314,16 @@ discard block |
||
313 | 314 | $SerieData = $this->stripVOID($this->Data["Series"][$Serie]["Data"]); |
314 | 315 | |
315 | 316 | $DeviationSum = 0; |
316 | - foreach($SerieData as $Key => $Value) |
|
317 | - $DeviationSum = $DeviationSum + ($Value-$Average)*($Value-$Average); |
|
317 | + foreach($SerieData as $Key => $Value) { |
|
318 | + $DeviationSum = $DeviationSum + ($Value-$Average)*($Value-$Average); |
|
319 | + } |
|
318 | 320 | |
319 | 321 | $Deviation = sqrt($DeviationSum/count($SerieData)); |
320 | 322 | |
321 | 323 | return($Deviation); |
322 | - } |
|
323 | - else |
|
324 | - return(NULL); |
|
324 | + } else { |
|
325 | + return(NULL); |
|
326 | + } |
|
325 | 327 | } |
326 | 328 | |
327 | 329 | /* Return the Coefficient of variation of the given serie */ |
@@ -332,13 +334,14 @@ discard block |
||
332 | 334 | $Average = $this->getSerieAverage($Serie); |
333 | 335 | $StandardDeviation = $this->getStandardDeviation($Serie); |
334 | 336 | |
335 | - if ( $StandardDeviation != 0 ) |
|
336 | - return($StandardDeviation/$Average); |
|
337 | - else |
|
338 | - return(NULL); |
|
339 | - } |
|
340 | - else |
|
341 | - return(NULL); |
|
337 | + if ( $StandardDeviation != 0 ) { |
|
338 | + return($StandardDeviation/$Average); |
|
339 | + } else { |
|
340 | + return(NULL); |
|
341 | + } |
|
342 | + } else { |
|
343 | + return(NULL); |
|
344 | + } |
|
342 | 345 | } |
343 | 346 | |
344 | 347 | /* Return the median value of the given serie */ |
@@ -350,13 +353,14 @@ discard block |
||
350 | 353 | sort($SerieData); |
351 | 354 | $SerieCenter = floor(sizeof($SerieData)/2); |
352 | 355 | |
353 | - if ( isset($SerieData[$SerieCenter]) ) |
|
354 | - return($SerieData[$SerieCenter]); |
|
355 | - else |
|
356 | - return(NULL); |
|
357 | - } |
|
358 | - else |
|
359 | - return(NULL); |
|
356 | + if ( isset($SerieData[$SerieCenter]) ) { |
|
357 | + return($SerieData[$SerieCenter]); |
|
358 | + } else { |
|
359 | + return(NULL); |
|
360 | + } |
|
361 | + } else { |
|
362 | + return(NULL); |
|
363 | + } |
|
360 | 364 | } |
361 | 365 | |
362 | 366 | /* Return the x th percentil of the given serie */ |
@@ -371,10 +375,11 @@ discard block |
||
371 | 375 | $SortedValues = $this->Data["Series"][$Serie]["Data"]; |
372 | 376 | sort($SortedValues); |
373 | 377 | |
374 | - if ( is_numeric($SortedValues[$PercentilID]) ) |
|
375 | - return($SortedValues[$PercentilID]); |
|
376 | - else |
|
377 | - return(NULL); |
|
378 | + if ( is_numeric($SortedValues[$PercentilID]) ) { |
|
379 | + return($SortedValues[$PercentilID]); |
|
380 | + } else { |
|
381 | + return(NULL); |
|
382 | + } |
|
378 | 383 | } |
379 | 384 | |
380 | 385 | /* Add random values to a given serie */ |
@@ -549,10 +554,11 @@ discard block |
||
549 | 554 | { |
550 | 555 | foreach($this->Data["Series"] as $Key => $Value) |
551 | 556 | { |
552 | - if ( !isset($this->Palette[$ID]) ) |
|
553 | - $this->Data["Series"][$Key]["Color"] = array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>0); |
|
554 | - else |
|
555 | - $this->Data["Series"][$Key]["Color"] = $this->Palette[$ID]; |
|
557 | + if ( !isset($this->Palette[$ID]) ) { |
|
558 | + $this->Data["Series"][$Key]["Color"] = array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>0); |
|
559 | + } else { |
|
560 | + $this->Data["Series"][$Key]["Color"] = $this->Palette[$ID]; |
|
561 | + } |
|
556 | 562 | $ID++; |
557 | 563 | } |
558 | 564 | } |
@@ -569,9 +575,9 @@ discard block |
||
569 | 575 | $this->Data["ScatterSeries"][$ID]["Ticks"] = 0; |
570 | 576 | $this->Data["ScatterSeries"][$ID]["Weight"] = 0; |
571 | 577 | |
572 | - if ( isset($this->Palette[$ID]) ) |
|
573 | - $this->Data["ScatterSeries"][$ID]["Color"] = $this->Palette[$ID]; |
|
574 | - else |
|
578 | + if ( isset($this->Palette[$ID]) ) { |
|
579 | + $this->Data["ScatterSeries"][$ID]["Color"] = $this->Palette[$ID]; |
|
580 | + } else |
|
575 | 581 | { |
576 | 582 | $this->Data["ScatterSeries"][$ID]["Color"]["R"] = rand(0,255); |
577 | 583 | $this->Data["ScatterSeries"][$ID]["Color"]["G"] = rand(0,255); |
@@ -595,9 +601,9 @@ discard block |
||
595 | 601 | $this->Data["Series"][$Serie]["Weight"] = 0; |
596 | 602 | $this->Data["Series"][$Serie]["Shape"] = SERIE_SHAPE_FILLEDCIRCLE; |
597 | 603 | |
598 | - if ( isset($this->Palette[$ID]) ) |
|
599 | - $this->Data["Series"][$Serie]["Color"] = $this->Palette[$ID]; |
|
600 | - else |
|
604 | + if ( isset($this->Palette[$ID]) ) { |
|
605 | + $this->Data["Series"][$Serie]["Color"] = $this->Palette[$ID]; |
|
606 | + } else |
|
601 | 607 | { |
602 | 608 | $this->Data["Series"][$Serie]["Color"]["R"] = rand(0,255); |
603 | 609 | $this->Data["Series"][$Serie]["Color"]["G"] = rand(0,255); |
@@ -633,8 +639,9 @@ discard block |
||
633 | 639 | foreach ($SelectedSeries as $Key => $SerieName ) |
634 | 640 | { |
635 | 641 | $Value = $this->Data["Series"][$SerieName]["Data"][$i]; |
636 | - if ( $Value != VOID ) |
|
637 | - $Factor = $Factor + abs($Value); |
|
642 | + if ( $Value != VOID ) { |
|
643 | + $Factor = $Factor + abs($Value); |
|
644 | + } |
|
638 | 645 | } |
639 | 646 | |
640 | 647 | if ( $Factor != 0 ) |
@@ -645,12 +652,13 @@ discard block |
||
645 | 652 | { |
646 | 653 | $Value = $this->Data["Series"][$SerieName]["Data"][$i]; |
647 | 654 | |
648 | - if ( $Value != VOID && $Factor != $NormalizationFactor ) |
|
649 | - $this->Data["Series"][$SerieName]["Data"][$i] = round(abs($Value)*$Factor,$Round); |
|
650 | - elseif ( $Value == VOID || $Value == 0 ) |
|
651 | - $this->Data["Series"][$SerieName]["Data"][$i] = VOID; |
|
652 | - elseif ( $Factor == $NormalizationFactor ) |
|
653 | - $this->Data["Series"][$SerieName]["Data"][$i] = $NormalizationFactor; |
|
655 | + if ( $Value != VOID && $Factor != $NormalizationFactor ) { |
|
656 | + $this->Data["Series"][$SerieName]["Data"][$i] = round(abs($Value)*$Factor,$Round); |
|
657 | + } elseif ( $Value == VOID || $Value == 0 ) { |
|
658 | + $this->Data["Series"][$SerieName]["Data"][$i] = VOID; |
|
659 | + } elseif ( $Factor == $NormalizationFactor ) { |
|
660 | + $this->Data["Series"][$SerieName]["Data"][$i] = $NormalizationFactor; |
|
661 | + } |
|
654 | 662 | } |
655 | 663 | } |
656 | 664 | } |
@@ -687,8 +695,7 @@ discard block |
||
687 | 695 | { |
688 | 696 | foreach($Values as $Key => $Name) { if ( !in_array($Key,$SkipColumns) ) { $SerieNames[$Key] = $Name; } } |
689 | 697 | $HeaderParsed = TRUE; |
690 | - } |
|
691 | - else |
|
698 | + } else |
|
692 | 699 | { |
693 | 700 | if ($SerieNames == "" ) { foreach($Values as $Key => $Name) { if ( !in_array($Key,$SkipColumns) ) { $SerieNames[$Key] = $DefaultSerieName.$Key; } } } |
694 | 701 | foreach($Values as $Key => $Value) { if ( !in_array($Key,$SkipColumns) ) { $this->addPoints($Value,$SerieNames[$Key]); } } |
@@ -52,19 +52,16 @@ discard block |
||
52 | 52 | $BubbleBounds = $Value + $this->pDataObject->Data["Series"][$SerieWeightName]["Data"][$Key]; |
53 | 53 | |
54 | 54 | if ( !isset($NewPositiveSerie[$Key]) ) |
55 | - { $NewPositiveSerie[$Key] = $BubbleBounds; } |
|
56 | - elseif ( $NewPositiveSerie[$Key] < $BubbleBounds ) |
|
55 | + { $NewPositiveSerie[$Key] = $BubbleBounds; } elseif ( $NewPositiveSerie[$Key] < $BubbleBounds ) |
|
57 | 56 | { $NewPositiveSerie[$Key] = $BubbleBounds; } |
58 | 57 | |
59 | 58 | $LastPositive = $BubbleBounds; |
60 | - } |
|
61 | - else |
|
59 | + } else |
|
62 | 60 | { |
63 | 61 | $BubbleBounds = $Value - $this->pDataObject->Data["Series"][$SerieWeightName]["Data"][$Key]; |
64 | 62 | |
65 | 63 | if ( !isset($NewNegativeSerie[$Key]) ) |
66 | - { $NewNegativeSerie[$Key] = $BubbleBounds; } |
|
67 | - elseif ( $NewNegativeSerie[$Key] > $BubbleBounds ) |
|
64 | + { $NewNegativeSerie[$Key] = $BubbleBounds; } elseif ( $NewNegativeSerie[$Key] > $BubbleBounds ) |
|
68 | 65 | { $NewNegativeSerie[$Key] = $BubbleBounds; } |
69 | 66 | |
70 | 67 | $LastNegative = $BubbleBounds; |
@@ -158,19 +155,16 @@ discard block |
||
158 | 155 | if ( $BorderWidth != 1 ) |
159 | 156 | { |
160 | 157 | if ( $Surrounding != NULL ) |
161 | - { $BorderR = $Palette[$Key]["R"]+$Surrounding; $BorderG = $Palette[$Key]["G"]+$Surrounding; $BorderB = $Palette[$Key]["B"]+$Surrounding; } |
|
162 | - else |
|
158 | + { $BorderR = $Palette[$Key]["R"]+$Surrounding; $BorderG = $Palette[$Key]["G"]+$Surrounding; $BorderB = $Palette[$Key]["B"]+$Surrounding; } else |
|
163 | 159 | { $BorderR = $BorderR; $BorderG = $BorderG; $BorderB = $BorderB; } |
164 | 160 | if ( $ForceAlpha != VOID ) { $BorderAlpha = $ForceAlpha/2; } |
165 | 161 | $BorderColor = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha); |
166 | - } |
|
167 | - else |
|
162 | + } else |
|
168 | 163 | { |
169 | 164 | $Color["BorderAlpha"] = $BorderAlpha; |
170 | 165 | |
171 | 166 | if ( $Surrounding != NULL ) |
172 | - { $Color["BorderR"] = $Palette[$Key]["R"]+$Surrounding; $Color["BorderG"] = $Palette[$Key]["G"]+$Surrounding; $Color["BorderB"] = $Palette[$Key]["B"]+$Surrounding; } |
|
173 | - else |
|
167 | + { $Color["BorderR"] = $Palette[$Key]["R"]+$Surrounding; $Color["BorderG"] = $Palette[$Key]["G"]+$Surrounding; $Color["BorderB"] = $Palette[$Key]["B"]+$Surrounding; } else |
|
174 | 168 | { $Color["BorderR"] = $BorderR; $Color["BorderG"] = $BorderG; $Color["BorderB"] = $BorderB; } |
175 | 169 | if ( $ForceAlpha != VOID ) { $Color["BorderAlpha"] = $ForceAlpha/2; } |
176 | 170 | } |
@@ -196,11 +190,10 @@ discard block |
||
196 | 190 | { |
197 | 191 | $this->pChartObject->drawFilledRectangle($X-$CircleRadius-$BorderWidth,$Y-$CircleRadius-$BorderWidth,$X+$CircleRadius+$BorderWidth,$Y+$CircleRadius+$BorderWidth,$BorderColor); |
198 | 192 | $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color); |
199 | - } |
|
200 | - else |
|
201 | - $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color); |
|
202 | - } |
|
203 | - elseif ( $Shape == BUBBLE_SHAPE_ROUND ) |
|
193 | + } else { |
|
194 | + $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color); |
|
195 | + } |
|
196 | + } elseif ( $Shape == BUBBLE_SHAPE_ROUND ) |
|
204 | 197 | { |
205 | 198 | if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".floor($CircleRadius),$this->pChartObject->toHTMLColor($Palette[$Key]["R"],$Palette[$Key]["G"],$Palette[$Key]["B"]),$SerieDescription,$Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); } |
206 | 199 | |
@@ -208,14 +201,13 @@ discard block |
||
208 | 201 | { |
209 | 202 | $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius+$BorderWidth,$BorderColor); |
210 | 203 | $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color); |
211 | - } |
|
212 | - else |
|
213 | - $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color); |
|
204 | + } else { |
|
205 | + $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color); |
|
206 | + } |
|
214 | 207 | } |
215 | 208 | |
216 | 209 | $X = $X + $XStep; |
217 | - } |
|
218 | - elseif ( $Data["Orientation"] == SCALE_POS_TOPBOTTOM ) |
|
210 | + } elseif ( $Data["Orientation"] == SCALE_POS_TOPBOTTOM ) |
|
219 | 211 | { |
220 | 212 | if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1-$XMargin*2)/$XDivs; } |
221 | 213 | $X = floor($PosArray); $CircleRadius = floor(abs($PosArray - $WeightArray)/2); |
@@ -228,11 +220,10 @@ discard block |
||
228 | 220 | { |
229 | 221 | $this->pChartObject->drawFilledRectangle($X-$CircleRadius-$BorderWidth,$Y-$CircleRadius-$BorderWidth,$X+$CircleRadius+$BorderWidth,$Y+$CircleRadius+$BorderWidth,$BorderColor); |
230 | 222 | $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color); |
231 | - } |
|
232 | - else |
|
233 | - $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color); |
|
234 | - } |
|
235 | - elseif ( $Shape == BUBBLE_SHAPE_ROUND ) |
|
223 | + } else { |
|
224 | + $this->pChartObject->drawFilledRectangle($X-$CircleRadius,$Y-$CircleRadius,$X+$CircleRadius,$Y+$CircleRadius,$Color); |
|
225 | + } |
|
226 | + } elseif ( $Shape == BUBBLE_SHAPE_ROUND ) |
|
236 | 227 | { |
237 | 228 | if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".floor($CircleRadius),$this->pChartObject->toHTMLColor($Palette[$Key]["R"],$Palette[$Key]["G"],$Palette[$Key]["B"]),$SerieDescription,$Data["Series"][$WeightSeries[$Key]]["Data"][$iKey]); } |
238 | 229 | |
@@ -240,9 +231,9 @@ discard block |
||
240 | 231 | { |
241 | 232 | $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius+$BorderWidth,$BorderColor); |
242 | 233 | $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color); |
243 | - } |
|
244 | - else |
|
245 | - $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color); |
|
234 | + } else { |
|
235 | + $this->pChartObject->drawFilledCircle($X,$Y,$CircleRadius,$Color); |
|
236 | + } |
|
246 | 237 | } |
247 | 238 | |
248 | 239 | $Y = $Y + $XStep; |
@@ -261,8 +252,9 @@ discard block |
||
261 | 252 | $Data = $this->pDataObject->getData(); |
262 | 253 | $Palette = $this->pDataObject->getPalette(); |
263 | 254 | |
264 | - if ( !isset($Data["Series"][$SerieName]) || !isset($Data["Series"][$SerieWeightName]) ) |
|
265 | - return(0); |
|
255 | + if ( !isset($Data["Series"][$SerieName]) || !isset($Data["Series"][$SerieWeightName]) ) { |
|
256 | + return(0); |
|
257 | + } |
|
266 | 258 | |
267 | 259 | list($XMargin,$XDivs) = $this->pChartObject->scaleGetXSettings(); |
268 | 260 | |
@@ -282,19 +274,21 @@ discard block |
||
282 | 274 | $Value = $Data["Series"][$SerieName]["Data"][$Point]; |
283 | 275 | $PosArray = $this->pChartObject->scaleComputeY($Value,array("AxisID"=>$AxisID)); |
284 | 276 | |
285 | - if ( isset($Data["Abscissa"]) && isset($Data["Series"][$Data["Abscissa"]]["Data"][$Point]) ) |
|
286 | - $Abscissa = $Data["Series"][$Data["Abscissa"]]["Data"][$Point]." : "; |
|
287 | - else |
|
288 | - $Abscissa = ""; |
|
277 | + if ( isset($Data["Abscissa"]) && isset($Data["Series"][$Data["Abscissa"]]["Data"][$Point]) ) { |
|
278 | + $Abscissa = $Data["Series"][$Data["Abscissa"]]["Data"][$Point]." : "; |
|
279 | + } else { |
|
280 | + $Abscissa = ""; |
|
281 | + } |
|
289 | 282 | |
290 | 283 | $Value = $this->pChartObject->scaleFormat($Value,$AxisMode,$AxisFormat,$AxisUnit); |
291 | 284 | $Weight = $Data["Series"][$SerieWeightName]["Data"][$Point]; |
292 | 285 | $Caption = $Abscissa.$Value." / ".$Weight; |
293 | 286 | |
294 | - if ( isset($Data["Series"][$SerieName]["Description"]) ) |
|
295 | - $Description = $Data["Series"][$SerieName]["Description"]; |
|
296 | - else |
|
297 | - $Description = "No description"; |
|
287 | + if ( isset($Data["Series"][$SerieName]["Description"]) ) { |
|
288 | + $Description = $Data["Series"][$SerieName]["Description"]; |
|
289 | + } else { |
|
290 | + $Description = "No description"; |
|
291 | + } |
|
298 | 292 | |
299 | 293 | $Series = ""; |
300 | 294 | $Series[] = array("Format"=>$Color,"Caption"=>$Caption); |
@@ -305,8 +299,7 @@ discard block |
||
305 | 299 | |
306 | 300 | $X = floor($X + $Point * $XStep); |
307 | 301 | $Y = floor($PosArray); |
308 | - } |
|
309 | - else |
|
302 | + } else |
|
310 | 303 | { |
311 | 304 | if ( $XDivs == 0 ) { $YStep = 0; } else { $YStep = ($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1-$XMargin*2)/$XDivs; } |
312 | 305 | |
@@ -314,10 +307,11 @@ discard block |
||
314 | 307 | $Y = floor($Y + $Point * $YStep); |
315 | 308 | } |
316 | 309 | |
317 | - if ( $DrawPoint == LABEL_POINT_CIRCLE ) |
|
318 | - $this->pChartObject->drawFilledCircle($X,$Y,3,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0)); |
|
319 | - elseif ( $DrawPoint == LABEL_POINT_BOX ) |
|
320 | - $this->pChartObject->drawFilledRectangle($X-2,$Y-2,$X+2,$Y+2,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0)); |
|
310 | + if ( $DrawPoint == LABEL_POINT_CIRCLE ) { |
|
311 | + $this->pChartObject->drawFilledCircle($X,$Y,3,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0)); |
|
312 | + } elseif ( $DrawPoint == LABEL_POINT_BOX ) { |
|
313 | + $this->pChartObject->drawFilledRectangle($X-2,$Y-2,$X+2,$Y+2,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0)); |
|
314 | + } |
|
321 | 315 | |
322 | 316 | $this->pChartObject->drawLabelBox($X,$Y-3,$Description,$Series,$Format); |
323 | 317 | } |
@@ -135,8 +135,7 @@ |
||
135 | 135 | { |
136 | 136 | $X3 = $X2 + cos(($Angle+90) * PI / 180) * ($Height+$LegendOffset+$this->pChartObject->FontSize+10); |
137 | 137 | $Y3 = $Y2 + sin(($Angle+90) * PI / 180) * ($Height+$LegendOffset+$this->pChartObject->FontSize+10); |
138 | - } |
|
139 | - else |
|
138 | + } else |
|
140 | 139 | { |
141 | 140 | $X3 = $X2 + cos(($Angle+90) * PI / 180) * ($Height+20); |
142 | 141 | $Y3 = $Y2 + sin(($Angle+90) * PI / 180) * ($Height+20); |
@@ -96,8 +96,7 @@ discard block |
||
96 | 96 | foreach($Data["Axis"] as $AxisID => $AxisSettings) |
97 | 97 | { |
98 | 98 | if ( $AxisSettings["Identity"] == AXIS_X) |
99 | - { $Width = $this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1 - $XMargin*2; } |
|
100 | - else |
|
99 | + { $Width = $this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1 - $XMargin*2; } else |
|
101 | 100 | { $Width = $this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1 - $YMargin*2; } |
102 | 101 | |
103 | 102 | $AxisMin = ABSOLUTE_MAX; $AxisMax = OUT_OF_SIGHT; |
@@ -114,22 +113,20 @@ discard block |
||
114 | 113 | $AutoMargin = (($AxisMax-$AxisMin)/100)*$XReleasePercent; |
115 | 114 | |
116 | 115 | $Data["Axis"][$AxisID]["Min"] = $AxisMin-$AutoMargin; $Data["Axis"][$AxisID]["Max"] = $AxisMax+$AutoMargin; |
117 | - } |
|
118 | - elseif ( $Mode == SCALE_MODE_MANUAL ) |
|
116 | + } elseif ( $Mode == SCALE_MODE_MANUAL ) |
|
119 | 117 | { |
120 | 118 | if ( isset($ManualScale[$AxisID]["Min"]) && isset($ManualScale[$AxisID]["Max"]) ) |
121 | 119 | { |
122 | 120 | $Data["Axis"][$AxisID]["Min"] = $ManualScale[$AxisID]["Min"]; |
123 | 121 | $Data["Axis"][$AxisID]["Max"] = $ManualScale[$AxisID]["Max"]; |
124 | - } |
|
125 | - else |
|
122 | + } else |
|
126 | 123 | { echo "Manual scale boundaries not set."; exit(); } |
127 | 124 | } |
128 | 125 | |
129 | 126 | /* Full manual scale */ |
130 | - if ( isset($ManualScale[$AxisID]["Rows"]) && isset($ManualScale[$AxisID]["RowHeight"]) ) |
|
131 | - $Scale = array("Rows"=>$ManualScale[$AxisID]["Rows"],"RowHeight"=>$ManualScale[$AxisID]["RowHeight"],"XMin"=>$ManualScale[$AxisID]["Min"],"XMax"=>$ManualScale[$AxisID]["Max"]); |
|
132 | - else |
|
127 | + if ( isset($ManualScale[$AxisID]["Rows"]) && isset($ManualScale[$AxisID]["RowHeight"]) ) { |
|
128 | + $Scale = array("Rows"=>$ManualScale[$AxisID]["Rows"],"RowHeight"=>$ManualScale[$AxisID]["RowHeight"],"XMin"=>$ManualScale[$AxisID]["Min"],"XMax"=>$ManualScale[$AxisID]["Max"]); |
|
129 | + } else |
|
133 | 130 | { |
134 | 131 | $MaxDivs = floor($Width/$MinDivHeight); |
135 | 132 | $Scale = $this->pChartObject->computeScale($Data["Axis"][$AxisID]["Min"],$Data["Axis"][$AxisID]["Max"],$MaxDivs,$Factors,$AxisID); |
@@ -161,8 +158,7 @@ discard block |
||
161 | 158 | $AxisR = $AxisSettings["Color"]["R"]; $AxisG = $AxisSettings["Color"]["G"]; $AxisB = $AxisSettings["Color"]["B"]; |
162 | 159 | $TickR = $AxisSettings["Color"]["R"]; $TickG = $AxisSettings["Color"]["G"]; $TickB = $AxisSettings["Color"]["B"]; |
163 | 160 | $this->pChartObject->setFontProperties(array("R"=>$AxisSettings["Color"]["R"],"G"=>$AxisSettings["Color"]["G"],"B"=>$AxisSettings["Color"]["B"])); |
164 | - } |
|
165 | - else |
|
161 | + } else |
|
166 | 162 | { |
167 | 163 | $AxisR = $AxisRo; $AxisG = $AxisGo; $AxisB = $AxisBo; |
168 | 164 | $TickR = $TickRo; $TickG = $TickGo; $TickB = $TickBo; |
@@ -180,8 +176,7 @@ discard block |
||
180 | 176 | if ( $XLabelsRotation > 180 && $XLabelsRotation < 360 ) { $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; } |
181 | 177 | |
182 | 178 | if ( $Floating ) |
183 | - { $FloatingOffset = $YMargin; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$AxisSettings["Margin"],$AxisPos["B"],$this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["B"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
|
184 | - else |
|
179 | + { $FloatingOffset = $YMargin; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$AxisSettings["Margin"],$AxisPos["B"],$this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["B"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } else |
|
185 | 180 | { $FloatingOffset = 0; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1,$AxisPos["B"],$this->pChartObject->GraphAreaX2,$AxisPos["B"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
186 | 181 | |
187 | 182 | if ( $DrawArrows ) { $this->pChartObject->drawArrow($this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["B"],$this->pChartObject->GraphAreaX2+($ArrowSize*2),$AxisPos["B"],array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); } |
@@ -199,8 +194,9 @@ discard block |
||
199 | 194 | if ( $LastX != NULL && $CycleBackground && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); } |
200 | 195 | |
201 | 196 | if ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) ) { $this->pChartObject->drawLine($XPos,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); } |
202 | - if ( $DrawSubTicks && $i != $AxisSettings["Rows"] ) |
|
203 | - $this->pChartObject->drawLine($XPos+$SubTicksSize,$YPos-$InnerSubTickWidth,$XPos+$SubTicksSize,$YPos+$OuterSubTickWidth,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha)); |
|
197 | + if ( $DrawSubTicks && $i != $AxisSettings["Rows"] ) { |
|
198 | + $this->pChartObject->drawLine($XPos+$SubTicksSize,$YPos-$InnerSubTickWidth,$XPos+$SubTicksSize,$YPos+$OuterSubTickWidth,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha)); |
|
199 | + } |
|
204 | 200 | |
205 | 201 | $this->pChartObject->drawLine($XPos,$YPos-$InnerTickWidth,$XPos,$YPos+$OuterTickWidth,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha)); |
206 | 202 | $Bounds = $this->pChartObject->drawText($XPos,$YPos+$OuterTickWidth+$LabelOffset,$Value,array("Angle"=>$XLabelsRotation,"Align"=>$LabelAlign)); |
@@ -221,8 +217,7 @@ discard block |
||
221 | 217 | } |
222 | 218 | |
223 | 219 | $AxisPos["B"] = $MaxBottom + $ScaleSpacing; |
224 | - } |
|
225 | - elseif ( $AxisSettings["Position"] == AXIS_POSITION_TOP ) |
|
220 | + } elseif ( $AxisSettings["Position"] == AXIS_POSITION_TOP ) |
|
226 | 221 | { |
227 | 222 | if ( $XLabelsRotation == 0 ) { $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 2; } |
228 | 223 | if ( $XLabelsRotation > 0 && $XLabelsRotation < 190 ) { $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; } |
@@ -230,8 +225,7 @@ discard block |
||
230 | 225 | if ( $XLabelsRotation > 180 && $SLabelxRotation < 360 ) { $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; } |
231 | 226 | |
232 | 227 | if ( $Floating ) |
233 | - { $FloatingOffset = $YMargin; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$AxisSettings["Margin"],$AxisPos["T"],$this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["T"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
|
234 | - else |
|
228 | + { $FloatingOffset = $YMargin; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$AxisSettings["Margin"],$AxisPos["T"],$this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["T"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } else |
|
235 | 229 | { $FloatingOffset = 0; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1,$AxisPos["T"],$this->pChartObject->GraphAreaX2,$AxisPos["T"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
236 | 230 | |
237 | 231 | if ( $DrawArrows ) { $this->pChartObject->drawArrow($this->pChartObject->GraphAreaX2-$AxisSettings["Margin"],$AxisPos["T"],$this->pChartObject->GraphAreaX2+($ArrowSize*2),$AxisPos["T"],array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); } |
@@ -250,8 +244,9 @@ discard block |
||
250 | 244 | |
251 | 245 | if ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) ) { $this->pChartObject->drawLine($XPos,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); } |
252 | 246 | |
253 | - if ( $DrawSubTicks && $i != $AxisSettings["Rows"] ) |
|
254 | - $this->pChartObject->drawLine($XPos+$SubTicksSize,$YPos-$OuterSubTickWidth,$XPos+$SubTicksSize,$YPos+$InnerSubTickWidth,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha)); |
|
247 | + if ( $DrawSubTicks && $i != $AxisSettings["Rows"] ) { |
|
248 | + $this->pChartObject->drawLine($XPos+$SubTicksSize,$YPos-$OuterSubTickWidth,$XPos+$SubTicksSize,$YPos+$InnerSubTickWidth,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha)); |
|
249 | + } |
|
255 | 250 | |
256 | 251 | $this->pChartObject->drawLine($XPos,$YPos-$OuterTickWidth,$XPos,$YPos+$InnerTickWidth,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha)); |
257 | 252 | $Bounds = $this->pChartObject->drawText($XPos,$YPos-$OuterTickWidth-$LabelOffset,$Value,array("Angle"=>$XLabelsRotation,"Align"=>$LabelAlign)); |
@@ -273,15 +268,13 @@ discard block |
||
273 | 268 | |
274 | 269 | $AxisPos["T"] = $MinTop - $ScaleSpacing; |
275 | 270 | } |
276 | - } |
|
277 | - elseif ( $AxisSettings["Identity"] == AXIS_Y ) |
|
271 | + } elseif ( $AxisSettings["Identity"] == AXIS_Y ) |
|
278 | 272 | { |
279 | 273 | if ( $AxisSettings["Position"] == AXIS_POSITION_LEFT ) |
280 | 274 | { |
281 | 275 | |
282 | 276 | if ( $Floating ) |
283 | - { $FloatingOffset = $XMargin; $this->pChartObject->drawLine($AxisPos["L"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["L"],$this->pChartObject->GraphAreaY2-$AxisSettings["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
|
284 | - else |
|
277 | + { $FloatingOffset = $XMargin; $this->pChartObject->drawLine($AxisPos["L"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["L"],$this->pChartObject->GraphAreaY2-$AxisSettings["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } else |
|
285 | 278 | { $FloatingOffset = 0; $this->pChartObject->drawLine($AxisPos["L"],$this->pChartObject->GraphAreaY1,$AxisPos["L"],$this->pChartObject->GraphAreaY2,array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
286 | 279 | |
287 | 280 | if ( $DrawArrows ) { $this->pChartObject->drawArrow($AxisPos["L"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["L"],$this->pChartObject->GraphAreaY1-($ArrowSize*2),array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); } |
@@ -300,8 +293,9 @@ discard block |
||
300 | 293 | |
301 | 294 | if ( ($YPos != $this->pChartObject->GraphAreaY1 && $YPos != $this->pChartObject->GraphAreaY2) && ($DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$FloatingOffset,$YPos,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); } |
302 | 295 | |
303 | - if ( $DrawSubTicks && $i != $AxisSettings["Rows"] ) |
|
304 | - $this->pChartObject->drawLine($XPos-$OuterSubTickWidth,$YPos-$SubTicksSize,$XPos+$InnerSubTickWidth,$YPos-$SubTicksSize,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha)); |
|
296 | + if ( $DrawSubTicks && $i != $AxisSettings["Rows"] ) { |
|
297 | + $this->pChartObject->drawLine($XPos-$OuterSubTickWidth,$YPos-$SubTicksSize,$XPos+$InnerSubTickWidth,$YPos-$SubTicksSize,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha)); |
|
298 | + } |
|
305 | 299 | |
306 | 300 | $this->pChartObject->drawLine($XPos-$OuterTickWidth,$YPos,$XPos+$InnerTickWidth,$YPos,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha)); |
307 | 301 | $Bounds = $this->pChartObject->drawText($XPos-$OuterTickWidth-2,$YPos,$Value,array("Align"=>TEXT_ALIGN_MIDDLERIGHT)); |
@@ -322,13 +316,11 @@ discard block |
||
322 | 316 | } |
323 | 317 | |
324 | 318 | $AxisPos["L"] = $MinLeft - $ScaleSpacing; |
325 | - } |
|
326 | - elseif ( $AxisSettings["Position"] == AXIS_POSITION_RIGHT ) |
|
319 | + } elseif ( $AxisSettings["Position"] == AXIS_POSITION_RIGHT ) |
|
327 | 320 | { |
328 | 321 | |
329 | 322 | if ( $Floating ) |
330 | - { $FloatingOffset = $XMargin; $this->pChartObject->drawLine($AxisPos["R"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["R"],$this->pChartObject->GraphAreaY2-$AxisSettings["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
|
331 | - else |
|
323 | + { $FloatingOffset = $XMargin; $this->pChartObject->drawLine($AxisPos["R"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["R"],$this->pChartObject->GraphAreaY2-$AxisSettings["Margin"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } else |
|
332 | 324 | { $FloatingOffset = 0; $this->pChartObject->drawLine($AxisPos["R"],$this->pChartObject->GraphAreaY1,$AxisPos["R"],$this->pChartObject->GraphAreaY2,array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); } |
333 | 325 | |
334 | 326 | if ( $DrawArrows ) { $this->pChartObject->drawArrow($AxisPos["R"],$this->pChartObject->GraphAreaY1+$AxisSettings["Margin"],$AxisPos["R"],$this->pChartObject->GraphAreaY1-($ArrowSize*2),array("FillR"=>$AxisR,"FillG"=>$AxisG,"FillB"=>$AxisB,"Size"=>$ArrowSize)); } |
@@ -347,8 +339,9 @@ discard block |
||
347 | 339 | |
348 | 340 | if ( ($YPos != $this->pChartObject->GraphAreaY1 && $YPos != $this->pChartObject->GraphAreaY2) && ($DrawYLines == ALL || in_array($AxisID,$DrawYLines)) ) { $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1+$FloatingOffset,$YPos,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,array("R"=>$GridR,"G"=>$GridG,"B"=>$GridB,"Alpha"=>$GridAlpha,"Ticks"=>$GridTicks)); } |
349 | 341 | |
350 | - if ( $DrawSubTicks && $i != $AxisSettings["Rows"] ) |
|
351 | - $this->pChartObject->drawLine($XPos-$InnerSubTickWidth,$YPos-$SubTicksSize,$XPos+$OuterSubTickWidth,$YPos-$SubTicksSize,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha)); |
|
342 | + if ( $DrawSubTicks && $i != $AxisSettings["Rows"] ) { |
|
343 | + $this->pChartObject->drawLine($XPos-$InnerSubTickWidth,$YPos-$SubTicksSize,$XPos+$OuterSubTickWidth,$YPos-$SubTicksSize,array("R"=>$SubTickR,"G"=>$SubTickG,"B"=>$SubTickB,"Alpha"=>$SubTickAlpha)); |
|
344 | + } |
|
352 | 345 | |
353 | 346 | $this->pChartObject->drawLine($XPos-$InnerTickWidth,$YPos,$XPos+$OuterTickWidth,$YPos,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha)); |
354 | 347 | $Bounds = $this->pChartObject->drawText($XPos+$OuterTickWidth+2,$YPos,$Value,array("Align"=>TEXT_ALIGN_MIDDLELEFT)); |
@@ -406,8 +399,7 @@ discard block |
||
406 | 399 | if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; } |
407 | 400 | |
408 | 401 | if ( isset($Series["Picture"]) && $Series["Picture"] != "" ) |
409 | - { $Picture = $Series["Picture"]; list($PicWidth,$PicHeight,$PicType) = $this->pChartObject->getPicInfo($Picture); } |
|
410 | - else |
|
402 | + { $Picture = $Series["Picture"]; list($PicWidth,$PicHeight,$PicType) = $this->pChartObject->getPicInfo($Picture); } else |
|
411 | 403 | { $Picture = NULL; } |
412 | 404 | |
413 | 405 | $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis); |
@@ -427,13 +419,11 @@ discard block |
||
427 | 419 | if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".floor($PlotSize+$BorderSize),$this->pChartObject->toHTMLColor($Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"]),$Description,$RealValue); } |
428 | 420 | |
429 | 421 | if( isset($Series["Shape"]) ) |
430 | - { $this->pChartObject->drawShape($X,$Y,$Series["Shape"],$PlotSize,$PlotBorder,$BorderSize,$Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"],$Series["Color"]["Alpha"],$BorderR,$BorderG,$BorderB,$BorderAlpha); } |
|
431 | - elseif ( $Picture == NULL ) |
|
422 | + { $this->pChartObject->drawShape($X,$Y,$Series["Shape"],$PlotSize,$PlotBorder,$BorderSize,$Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"],$Series["Color"]["Alpha"],$BorderR,$BorderG,$BorderB,$BorderAlpha); } elseif ( $Picture == NULL ) |
|
432 | 423 | { |
433 | 424 | if ( $PlotBorder ) { $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize+$BorderSize,$BorderColor); } |
434 | 425 | $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize,$Color); |
435 | - } |
|
436 | - else |
|
426 | + } else |
|
437 | 427 | { $this->pChartObject->drawFromPicture($PicType,$Picture,$X-$PicWidth/2,$Y-$PicHeight/2); } |
438 | 428 | } |
439 | 429 | } |
@@ -483,8 +473,9 @@ discard block |
||
483 | 473 | if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("CIRCLE",floor($X).",".floor($Y).",".$ImageMapPlotSize,$this->pChartObject->toHTMLColor($Series["Color"]["R"],$Series["Color"]["G"],$Series["Color"]["B"]),$Description,$RealValue); } |
484 | 474 | } |
485 | 475 | |
486 | - if ( $X != VOID && $Y != VOID && $LastX != VOID && $LastY != VOID) |
|
487 | - $this->pChartObject->drawLine($LastX,$LastY,$X,$Y,$Color); |
|
476 | + if ( $X != VOID && $Y != VOID && $LastX != VOID && $LastY != VOID) { |
|
477 | + $this->pChartObject->drawLine($LastX,$LastY,$X,$Y,$Color); |
|
478 | + } |
|
488 | 479 | |
489 | 480 | $LastX = $X; $LastY = $Y; |
490 | 481 | } |
@@ -564,15 +555,15 @@ discard block |
||
564 | 555 | $Result = ""; |
565 | 556 | foreach($Values as $Key => $Value) |
566 | 557 | { |
567 | - if ( $Value == VOID ) |
|
568 | - $Result[] = VOID; |
|
569 | - else |
|
570 | - $Result[] = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + ($Step * ($Value-$Data["Axis"][$AxisID]["ScaleMin"])); |
|
558 | + if ( $Value == VOID ) { |
|
559 | + $Result[] = VOID; |
|
560 | + } else { |
|
561 | + $Result[] = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + ($Step * ($Value-$Data["Axis"][$AxisID]["ScaleMin"])); |
|
562 | + } |
|
571 | 563 | } |
572 | 564 | |
573 | 565 | if ( count($Result) == 1 ) { return($Result[0]); } else { return($Result); } |
574 | - } |
|
575 | - else |
|
566 | + } else |
|
576 | 567 | { |
577 | 568 | $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $Data["Axis"][$AxisID]["Margin"]*2; |
578 | 569 | $ScaleHeight = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"]; |
@@ -581,10 +572,11 @@ discard block |
||
581 | 572 | $Result = ""; |
582 | 573 | foreach($Values as $Key => $Value) |
583 | 574 | { |
584 | - if ( $Value == VOID ) |
|
585 | - $Result[] = VOID; |
|
586 | - else |
|
587 | - $Result[] = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - ($Step * ($Value-$Data["Axis"][$AxisID]["ScaleMin"])); |
|
575 | + if ( $Value == VOID ) { |
|
576 | + $Result[] = VOID; |
|
577 | + } else { |
|
578 | + $Result[] = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - ($Step * ($Value-$Data["Axis"][$AxisID]["ScaleMin"])); |
|
579 | + } |
|
588 | 580 | } |
589 | 581 | |
590 | 582 | if ( count($Result) == 1 ) { return($Result[0]); } else { return($Result); } |
@@ -650,8 +642,7 @@ discard block |
||
650 | 642 | |
651 | 643 | $Lines = preg_split("/\n/",$Series["Description"]); |
652 | 644 | $vY = $vY + max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5; |
653 | - } |
|
654 | - elseif ( $Mode == LEGEND_HORIZONTAL ) |
|
645 | + } elseif ( $Mode == LEGEND_HORIZONTAL ) |
|
655 | 646 | { |
656 | 647 | $Lines = preg_split("/\n/",$Series["Description"]); |
657 | 648 | $Width = ""; |
@@ -675,10 +666,11 @@ discard block |
||
675 | 666 | $TopOffset = $Y - $Boundaries["T"]; |
676 | 667 | if ( $Boundaries["B"]-($vY+$IconAreaHeight) < $TopOffset ) { $Boundaries["B"] = $vY+$IconAreaHeight+$TopOffset; } |
677 | 668 | |
678 | - if ( $Style == LEGEND_ROUND ) |
|
679 | - $this->pChartObject->drawRoundedFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB)); |
|
680 | - elseif ( $Style == LEGEND_BOX ) |
|
681 | - $this->pChartObject->drawFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB)); |
|
669 | + if ( $Style == LEGEND_ROUND ) { |
|
670 | + $this->pChartObject->drawRoundedFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB)); |
|
671 | + } elseif ( $Style == LEGEND_BOX ) { |
|
672 | + $this->pChartObject->drawFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB)); |
|
673 | + } |
|
682 | 674 | |
683 | 675 | $RestoreShadow = $this->pChartObject->Shadow; $this->Shadow = FALSE; |
684 | 676 | foreach($Data["ScatterSeries"] as $Key => $Series) |
@@ -695,8 +687,7 @@ discard block |
||
695 | 687 | $PicX = $X+$IconAreaWidth/2; $PicY = $Y+$IconAreaHeight/2; |
696 | 688 | |
697 | 689 | $this->pChartObject->drawFromPNG($PicX-$PicWidth/2,$PicY-$PicHeight/2,$Picture); |
698 | - } |
|
699 | - else |
|
690 | + } else |
|
700 | 691 | { |
701 | 692 | if ( $Family == LEGEND_FAMILY_BOX ) |
702 | 693 | { |
@@ -705,13 +696,11 @@ discard block |
||
705 | 696 | |
706 | 697 | $this->pChartObject->drawFilledRectangle($X+1+$XOffset,$Y+1+$YOffset,$X+$BoxWidth+$XOffset+1,$Y+$BoxHeight+1+$YOffset,array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); |
707 | 698 | $this->pChartObject->drawFilledRectangle($X+$XOffset,$Y+$YOffset,$X+$BoxWidth+$XOffset,$Y+$BoxHeight+$YOffset,array("R"=>$R,"G"=>$G,"B"=>$B,"Surrounding"=>20)); |
708 | - } |
|
709 | - elseif ( $Family == LEGEND_FAMILY_CIRCLE ) |
|
699 | + } elseif ( $Family == LEGEND_FAMILY_CIRCLE ) |
|
710 | 700 | { |
711 | 701 | $this->pChartObject->drawFilledCircle($X+1+$IconAreaWidth/2,$Y+1+$IconAreaHeight/2,min($IconAreaHeight/2,$IconAreaWidth/2),array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); |
712 | 702 | $this->pChartObject->drawFilledCircle($X+$IconAreaWidth/2,$Y+$IconAreaHeight/2,min($IconAreaHeight/2,$IconAreaWidth/2),array("R"=>$R,"G"=>$G,"B"=>$B,"Surrounding"=>20)); |
713 | - } |
|
714 | - elseif ( $Family == LEGEND_FAMILY_LINE ) |
|
703 | + } elseif ( $Family == LEGEND_FAMILY_LINE ) |
|
715 | 704 | { |
716 | 705 | $this->pChartObject->drawLine($X+1,$Y+1+$IconAreaHeight/2,$X+1+$IconAreaWidth,$Y+1+$IconAreaHeight/2,array("R"=>0,"G"=>0,"B"=>0,"Alpha"=>20,"Ticks"=>$Ticks,"Weight"=>$Weight)); |
717 | 706 | $this->pChartObject->drawLine($X,$Y+$IconAreaHeight/2,$X+$IconAreaWidth,$Y+$IconAreaHeight/2,array("R"=>$R,"G"=>$G,"B"=>$B,"Ticks"=>$Ticks,"Weight"=>$Weight)); |
@@ -721,12 +710,12 @@ discard block |
||
721 | 710 | if ( $Mode == LEGEND_VERTICAL ) |
722 | 711 | { |
723 | 712 | $Lines = preg_split("/\n/",$Series["Description"]); |
724 | - foreach($Lines as $Key => $Value) |
|
725 | - $this->pChartObject->drawText($X+$IconAreaWidth+4,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$Value,array("R"=>$FontR,"G"=>$FontG,"B"=>$FontB,"Align"=>TEXT_ALIGN_MIDDLELEFT)); |
|
713 | + foreach($Lines as $Key => $Value) { |
|
714 | + $this->pChartObject->drawText($X+$IconAreaWidth+4,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$Value,array("R"=>$FontR,"G"=>$FontG,"B"=>$FontB,"Align"=>TEXT_ALIGN_MIDDLELEFT)); |
|
715 | + } |
|
726 | 716 | |
727 | 717 | $Y=$Y+max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5; |
728 | - } |
|
729 | - elseif ( $Mode == LEGEND_HORIZONTAL ) |
|
718 | + } elseif ( $Mode == LEGEND_HORIZONTAL ) |
|
730 | 719 | { |
731 | 720 | $Lines = preg_split("/\n/",$Series["Description"]); |
732 | 721 | $Width = ""; |
@@ -789,8 +778,7 @@ discard block |
||
789 | 778 | |
790 | 779 | $Lines = preg_split("/\n/",$Series["Description"]); |
791 | 780 | $vY = $vY + max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5; |
792 | - } |
|
793 | - elseif ( $Mode == LEGEND_HORIZONTAL ) |
|
781 | + } elseif ( $Mode == LEGEND_HORIZONTAL ) |
|
794 | 782 | { |
795 | 783 | $Lines = preg_split("/\n/",$Series["Description"]); |
796 | 784 | $Width = ""; |
@@ -859,8 +847,7 @@ discard block |
||
859 | 847 | $X2 = $X1; |
860 | 848 | $Y1 = $this->pChartObject->GraphAreaY1; |
861 | 849 | $Y2 = $this->pChartObject->GraphAreaY2; |
862 | - } |
|
863 | - else |
|
850 | + } else |
|
864 | 851 | { |
865 | 852 | $M = (($n*$Sxy)-($Sx*$Sy)) / (($n*$Sxx)-($Sx*$Sx)); |
866 | 853 | $B = (($Sy)-($M*$Sx))/($n); |
@@ -894,8 +881,9 @@ discard block |
||
894 | 881 | |
895 | 882 | if ( !is_array($Points) ) { $Point = $Points; $Points = ""; $Points[0] = $Point; } |
896 | 883 | |
897 | - if ( !isset($Data["ScatterSeries"][$ScatterSerieID]) ) |
|
898 | - return(0); |
|
884 | + if ( !isset($Data["ScatterSeries"][$ScatterSerieID]) ) { |
|
885 | + return(0); |
|
886 | + } |
|
899 | 887 | |
900 | 888 | $Series = $Data["ScatterSeries"][$ScatterSerieID]; |
901 | 889 | $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"]; |
@@ -913,10 +901,11 @@ discard block |
||
913 | 901 | $X = floor($PosArrayX[$Point]); |
914 | 902 | $Y = floor($PosArrayY[$Point]); |
915 | 903 | |
916 | - if ( $DrawPoint == LABEL_POINT_CIRCLE ) |
|
917 | - $this->pChartObject->drawFilledCircle($X,$Y,3,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0)); |
|
918 | - elseif ( $DrawPoint == LABEL_POINT_BOX ) |
|
919 | - $this->pChartObject->drawFilledRectangle($X-2,$Y-2,$X+2,$Y+2,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0)); |
|
904 | + if ( $DrawPoint == LABEL_POINT_CIRCLE ) { |
|
905 | + $this->pChartObject->drawFilledCircle($X,$Y,3,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0)); |
|
906 | + } elseif ( $DrawPoint == LABEL_POINT_BOX ) { |
|
907 | + $this->pChartObject->drawFilledRectangle($X-2,$Y-2,$X+2,$Y+2,array("R"=>255,"G"=>255,"B"=>255,"BorderR"=>0,"BorderG"=>0,"BorderB"=>0)); |
|
908 | + } |
|
920 | 909 | |
921 | 910 | $Serie = ""; |
922 | 911 | $Serie["R"] = $Series["Color"]["R"]; |
@@ -938,10 +927,11 @@ discard block |
||
938 | 927 | |
939 | 928 | $Caption = $XValue." / ".$YValue; |
940 | 929 | |
941 | - if ( isset($Series["Description"]) ) |
|
942 | - $Description = $Series["Description"]; |
|
943 | - else |
|
944 | - $Description = "No description"; |
|
930 | + if ( isset($Series["Description"]) ) { |
|
931 | + $Description = $Series["Description"]; |
|
932 | + } else { |
|
933 | + $Description = "No description"; |
|
934 | + } |
|
945 | 935 | |
946 | 936 | $Series = ""; |
947 | 937 | $Series[] = array("Format"=>$Serie,"Caption"=>$Caption); |
@@ -1014,16 +1004,14 @@ discard block |
||
1014 | 1004 | if ( $WriteCaption ) |
1015 | 1005 | { |
1016 | 1006 | if ( $CaptionAlign == CAPTION_LEFT_TOP ) |
1017 | - { $X = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLELEFT; } |
|
1018 | - else |
|
1007 | + { $X = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLELEFT; } else |
|
1019 | 1008 | { $X = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"] - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLERIGHT; } |
1020 | 1009 | |
1021 | 1010 | $this->pChartObject->drawText($X,$Y,$Caption,$CaptionSettings); |
1022 | 1011 | } |
1023 | 1012 | |
1024 | 1013 | return(array("Y"=>$Y)); |
1025 | - } |
|
1026 | - elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X ) |
|
1014 | + } elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X ) |
|
1027 | 1015 | { |
1028 | 1016 | $X = $this->getPosArray($Value,$AxisID); |
1029 | 1017 | $Y1 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"]; |
@@ -1040,8 +1028,7 @@ discard block |
||
1040 | 1028 | if ( $WriteCaption ) |
1041 | 1029 | { |
1042 | 1030 | if ( $CaptionAlign == CAPTION_LEFT_TOP ) |
1043 | - { $Y = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE; } |
|
1044 | - else |
|
1031 | + { $Y = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE; } else |
|
1045 | 1032 | { $Y = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_BOTTOMMIDDLE; } |
1046 | 1033 | |
1047 | 1034 | $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE; |
@@ -1121,8 +1108,7 @@ discard block |
||
1121 | 1108 | |
1122 | 1109 | $this->pChartObject->Shadow = $RestoreShadow; |
1123 | 1110 | return(array("X1"=>$X1,"X2"=>$X2)); |
1124 | - } |
|
1125 | - elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y ) |
|
1111 | + } elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y ) |
|
1126 | 1112 | { |
1127 | 1113 | $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"]; |
1128 | 1114 | $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"]; |
@@ -56,10 +56,11 @@ discard block |
||
56 | 56 | $DataSerieCount = count($Data["Series"][$DataSerie]["Data"]); |
57 | 57 | |
58 | 58 | /* Scale Processing */ |
59 | - if ( $TextPos == TEXT_POS_RIGHT ) |
|
60 | - $YScale = (($Y2-$Y1) - (($DataSerieCount+1)*$Spacing)) / $DataSerieSum; |
|
61 | - else |
|
62 | - $YScale = (($Y2-$Y1) - ($DataSerieCount*$Spacing)) / $DataSerieSum; |
|
59 | + if ( $TextPos == TEXT_POS_RIGHT ) { |
|
60 | + $YScale = (($Y2-$Y1) - (($DataSerieCount+1)*$Spacing)) / $DataSerieSum; |
|
61 | + } else { |
|
62 | + $YScale = (($Y2-$Y1) - ($DataSerieCount*$Spacing)) / $DataSerieSum; |
|
63 | + } |
|
63 | 64 | $LeftHeight = $DataSerieSum * $YScale; |
64 | 65 | |
65 | 66 | /* Re-compute graph width depending of the text mode choosen */ |
@@ -81,10 +82,11 @@ discard block |
||
81 | 82 | |
82 | 83 | foreach($Data["Series"][$DataSerie]["Data"] as $Key => $Value) |
83 | 84 | { |
84 | - if ( isset($Data["Series"][$LabelSerie]["Data"][$Key]) ) |
|
85 | - $Label = $Data["Series"][$LabelSerie]["Data"][$Key]; |
|
86 | - else |
|
87 | - $Label = "-"; |
|
85 | + if ( isset($Data["Series"][$LabelSerie]["Data"][$Key]) ) { |
|
86 | + $Label = $Data["Series"][$LabelSerie]["Data"][$Key]; |
|
87 | + } else { |
|
88 | + $Label = "-"; |
|
89 | + } |
|
88 | 90 | |
89 | 91 | $LeftY1 = $LeftY; |
90 | 92 | $LeftY2 = $LeftY + $Value * $YScale; |
@@ -118,10 +120,11 @@ discard block |
||
118 | 120 | |
119 | 121 | $Object->drawPolygon($PolyGon,$Settings); |
120 | 122 | |
121 | - if ( $TextPos == TEXT_POS_RIGHT ) |
|
122 | - $Object->drawText($X2+$TextPadding,($RightY2-$RightY1)/2+$RightY1,$Label,array("Align"=>TEXT_ALIGN_MIDDLELEFT)); |
|
123 | - else |
|
124 | - $Object->drawText($X2,$RightY1-$TextPadding,$Label,array("Align"=>TEXT_ALIGN_BOTTOMRIGHT)); |
|
123 | + if ( $TextPos == TEXT_POS_RIGHT ) { |
|
124 | + $Object->drawText($X2+$TextPadding,($RightY2-$RightY1)/2+$RightY1,$Label,array("Align"=>TEXT_ALIGN_MIDDLELEFT)); |
|
125 | + } else { |
|
126 | + $Object->drawText($X2,$RightY1-$TextPadding,$Label,array("Align"=>TEXT_ALIGN_BOTTOMRIGHT)); |
|
127 | + } |
|
125 | 128 | |
126 | 129 | $LeftY = $LeftY2; |
127 | 130 | $RightY = $RightY2; |
@@ -98,8 +98,7 @@ discard block |
||
98 | 98 | imagefilledrectangle($this->Picture, 0,0,$XSize, $YSize, imagecolorallocatealpha($this->Picture, 255, 255, 255, 127)); |
99 | 99 | imagealphablending($this->Picture,TRUE); |
100 | 100 | imagesavealpha($this->Picture,true); |
101 | - } |
|
102 | - else |
|
101 | + } else |
|
103 | 102 | { |
104 | 103 | $C_White = $this->AllocateColor($this->Picture,255,255,255); |
105 | 104 | imagefilledrectangle($this->Picture,0,0,$XSize,$YSize,$C_White); |
@@ -170,10 +169,11 @@ discard block |
||
170 | 169 | /* Automatic output method based on the calling interface */ |
171 | 170 | function autoOutput($FileName="output.png") |
172 | 171 | { |
173 | - if (php_sapi_name() == "cli") |
|
174 | - $this->Render($FileName); |
|
175 | - else |
|
176 | - $this->Stroke(); |
|
172 | + if (php_sapi_name() == "cli") { |
|
173 | + $this->Render($FileName); |
|
174 | + } else { |
|
175 | + $this->Stroke(); |
|
176 | + } |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | /* Return the length between two points */ |
@@ -245,11 +245,13 @@ discard block |
||
245 | 245 | if ( $B != -1) { $this->FontColorB = $B; } |
246 | 246 | if ( $Alpha != NULL) { $this->FontColorA = $Alpha; } |
247 | 247 | |
248 | - if ( $FontName != NULL ) |
|
249 | - $this->FontName = $FontName; |
|
248 | + if ( $FontName != NULL ) { |
|
249 | + $this->FontName = $FontName; |
|
250 | + } |
|
250 | 251 | |
251 | - if ( $FontSize != NULL ) |
|
252 | - $this->FontSize = $FontSize; |
|
252 | + if ( $FontSize != NULL ) { |
|
253 | + $this->FontSize = $FontSize; |
|
254 | + } |
|
253 | 255 | } |
254 | 256 | |
255 | 257 | /* Returns the 1st decimal values (used to correct AA bugs) */ |
@@ -277,8 +279,7 @@ discard block |
||
277 | 279 | { |
278 | 280 | if(!isset($_SESSION)) { session_start(); } |
279 | 281 | $_SESSION[$this->ImageMapIndex] = NULL; |
280 | - } |
|
281 | - elseif($StorageMode == IMAGE_MAP_STORAGE_FILE) |
|
282 | + } elseif($StorageMode == IMAGE_MAP_STORAGE_FILE) |
|
282 | 283 | { |
283 | 284 | $this->ImageMapFileName = $UniqueID; |
284 | 285 | $this->ImageMapStorageFolder = $StorageFolder; |
@@ -306,8 +307,7 @@ discard block |
||
306 | 307 | { |
307 | 308 | if(!isset($_SESSION)) { $this->initialiseImageMap(); } |
308 | 309 | $_SESSION[$this->ImageMapIndex][] = array($Type,$Plots,$Color,$Title,$Message); |
309 | - } |
|
310 | - elseif($this->ImageMapStorageMode == IMAGE_MAP_STORAGE_FILE) |
|
310 | + } elseif($this->ImageMapStorageMode == IMAGE_MAP_STORAGE_FILE) |
|
311 | 311 | { |
312 | 312 | $Handle = fopen($this->ImageMapStorageFolder."/".$this->ImageMapFileName.".map", 'a'); |
313 | 313 | fwrite($Handle, $Type.IMAGE_MAP_DELIMITER.$Plots.IMAGE_MAP_DELIMITER.$Color.IMAGE_MAP_DELIMITER.$Title.IMAGE_MAP_DELIMITER.$Message."\r\n"); |
@@ -337,11 +337,9 @@ discard block |
||
337 | 337 | { |
338 | 338 | if(!isset($_SESSION)) { return(-1); } |
339 | 339 | if ( is_array($NewTitle) ) |
340 | - { $ID = 0; foreach($_SESSION[$this->ImageMapIndex] as $Key => $Settings) { if ( $Settings[3] == $OldTitle && isset($NewTitle[$ID])) { $_SESSION[$this->ImageMapIndex][$Key][3] = $NewTitle[$ID]; $ID++; } } } |
|
341 | - else |
|
340 | + { $ID = 0; foreach($_SESSION[$this->ImageMapIndex] as $Key => $Settings) { if ( $Settings[3] == $OldTitle && isset($NewTitle[$ID])) { $_SESSION[$this->ImageMapIndex][$Key][3] = $NewTitle[$ID]; $ID++; } } } else |
|
342 | 341 | { foreach($_SESSION[$this->ImageMapIndex] as $Key => $Settings) { if ( $Settings[3] == $OldTitle ) { $_SESSION[$this->ImageMapIndex][$Key][3] = $NewTitle; } } } |
343 | - } |
|
344 | - elseif( $this->ImageMapStorageMode == IMAGE_MAP_STORAGE_FILE ) |
|
342 | + } elseif( $this->ImageMapStorageMode == IMAGE_MAP_STORAGE_FILE ) |
|
345 | 343 | { |
346 | 344 | $TempArray = ""; |
347 | 345 | $Handle = @fopen($this->ImageMapStorageFolder."/".$this->ImageMapFileName.".map", "r"); |
@@ -355,8 +353,7 @@ discard block |
||
355 | 353 | fclose($Handle); |
356 | 354 | |
357 | 355 | if ( is_array($NewTitle) ) |
358 | - { $ID = 0; foreach($TempArray as $Key => $Settings) { if ( $Settings[3] == $OldTitle && isset($NewTitle[$ID]) ) { $TempArray[$Key][3] = $NewTitle[$ID]; $ID++; } } } |
|
359 | - else |
|
356 | + { $ID = 0; foreach($TempArray as $Key => $Settings) { if ( $Settings[3] == $OldTitle && isset($NewTitle[$ID]) ) { $TempArray[$Key][3] = $NewTitle[$ID]; $ID++; } } } else |
|
360 | 357 | { foreach($TempArray as $Key => $Settings) { if ( $Settings[3] == $OldTitle ) { $TempArray[$Key][3] = $NewTitle; } } } |
361 | 358 | |
362 | 359 | $Handle = fopen($this->ImageMapStorageFolder."/".$this->ImageMapFileName.".map", 'w'); |
@@ -378,8 +375,7 @@ discard block |
||
378 | 375 | { |
379 | 376 | if(!isset($_SESSION)) { return(-1); } |
380 | 377 | foreach($_SESSION[$this->ImageMapIndex] as $Key => $Settings) { if ( $Settings[3] == $Title ) { if ( isset($Values[$ID]) ) { $_SESSION[$this->ImageMapIndex][$Key][4] = $Values[$ID]; } $ID++; } } |
381 | - } |
|
382 | - elseif( $this->ImageMapStorageMode == IMAGE_MAP_STORAGE_FILE ) |
|
378 | + } elseif( $this->ImageMapStorageMode == IMAGE_MAP_STORAGE_FILE ) |
|
383 | 379 | { |
384 | 380 | $TempArray = ""; |
385 | 381 | $Handle = @fopen($this->ImageMapStorageFolder."/".$this->ImageMapFileName.".map", "r"); |
@@ -416,8 +412,7 @@ discard block |
||
416 | 412 | foreach($_SESSION[$Name] as $Key => $Params) |
417 | 413 | { echo $Params[0].IMAGE_MAP_DELIMITER.$Params[1].IMAGE_MAP_DELIMITER.$Params[2].IMAGE_MAP_DELIMITER.$Params[3].IMAGE_MAP_DELIMITER.$Params[4]."\r\n"; } |
418 | 414 | } |
419 | - } |
|
420 | - elseif( $this->ImageMapStorageMode == IMAGE_MAP_STORAGE_FILE ) |
|
415 | + } elseif( $this->ImageMapStorageMode == IMAGE_MAP_STORAGE_FILE ) |
|
421 | 416 | { |
422 | 417 | if (file_exists($StorageFolder."/".$UniqueID.".map")) |
423 | 418 | { |
@@ -124,9 +124,9 @@ discard block |
||
124 | 124 | $Offset = 0; $ID = 0; |
125 | 125 | foreach($Values as $Key => $Value) |
126 | 126 | { |
127 | - if ( $Shadow ) |
|
128 | - $Settings = array("R"=>$this->pChartObject->ShadowR,"G"=>$this->pChartObject->ShadowG,"B"=>$this->pChartObject->ShadowB,"Alpha"=>$this->pChartObject->Shadowa); |
|
129 | - else |
|
127 | + if ( $Shadow ) { |
|
128 | + $Settings = array("R"=>$this->pChartObject->ShadowR,"G"=>$this->pChartObject->ShadowG,"B"=>$this->pChartObject->ShadowB,"Alpha"=>$this->pChartObject->Shadowa); |
|
129 | + } else |
|
130 | 130 | { |
131 | 131 | if ( !isset($Palette[$ID]["R"]) ) { $Color = $this->pChartObject->getRandomColor(); $Palette[$ID] = $Color; $this->pDataObject->savePalette($ID,$Color); } |
132 | 132 | $Settings = array("R"=>$Palette[$ID]["R"],"G"=>$Palette[$ID]["G"],"B"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]); |
@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | |
135 | 135 | if ( !$SecondPass && !$Shadow ) |
136 | 136 | { |
137 | - if ( !$Border ) |
|
138 | - $Settings["Surrounding"] = 10; |
|
139 | - else |
|
137 | + if ( !$Border ) { |
|
138 | + $Settings["Surrounding"] = 10; |
|
139 | + } else |
|
140 | 140 | { $Settings["BorderR"] = $BorderR; $Settings["BorderG"] = $BorderG; $Settings["BorderB"] = $BorderB; } |
141 | 141 | } |
142 | 142 | |
@@ -145,8 +145,7 @@ discard block |
||
145 | 145 | |
146 | 146 | $Angle = ($EndAngle - $Offset)/2 + $Offset; |
147 | 147 | if ($DataGapAngle == 0) |
148 | - { $X0 = $X; $Y0 = $Y; } |
|
149 | - else |
|
148 | + { $X0 = $X; $Y0 = $Y; } else |
|
150 | 149 | { |
151 | 150 | $X0 = cos(($Angle-90)*PI/180) * $DataGapRadius + $X; |
152 | 151 | $Y0 = sin(($Angle-90)*PI/180) * $DataGapRadius + $Y; |
@@ -173,8 +172,7 @@ discard block |
||
173 | 172 | if ( $DrawLabels && !$Shadow && !$SecondPass ) |
174 | 173 | { |
175 | 174 | if ( $LabelColor == PIE_LABEL_COLOR_AUTO ) |
176 | - { $Settings = array("FillR"=>$Palette[$ID]["R"],"FillG"=>$Palette[$ID]["G"],"FillB"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]);} |
|
177 | - else |
|
175 | + { $Settings = array("FillR"=>$Palette[$ID]["R"],"FillG"=>$Palette[$ID]["G"],"FillB"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]);} else |
|
178 | 176 | { $Settings = array("FillR"=>$LabelR,"FillG"=>$LabelG,"FillB"=>$LabelB,"Alpha"=>$LabelAlpha); } |
179 | 177 | |
180 | 178 | $Angle = ($EndAngle - $Offset)/2 + $Offset; |
@@ -183,10 +181,11 @@ discard block |
||
183 | 181 | |
184 | 182 | $Label = $Data["Series"][$Data["Abscissa"]]["Data"][$Key]; |
185 | 183 | |
186 | - if ( $LabelStacked ) |
|
187 | - $this->writePieLabel($Xc,$Yc,$Label,$Angle,$Settings,TRUE,$X,$Y,$Radius); |
|
188 | - else |
|
189 | - $this->writePieLabel($Xc,$Yc,$Label,$Angle,$Settings,FALSE); |
|
184 | + if ( $LabelStacked ) { |
|
185 | + $this->writePieLabel($Xc,$Yc,$Label,$Angle,$Settings,TRUE,$X,$Y,$Radius); |
|
186 | + } else { |
|
187 | + $this->writePieLabel($Xc,$Yc,$Label,$Angle,$Settings,FALSE); |
|
188 | + } |
|
190 | 189 | } |
191 | 190 | |
192 | 191 | $Offset = $i + $DataGapAngle; $ID++; |
@@ -200,21 +199,21 @@ discard block |
||
200 | 199 | foreach($Values as $Key => $Value) |
201 | 200 | { |
202 | 201 | $FirstPoint = TRUE; |
203 | - if ( $Shadow ) |
|
204 | - $Settings = array("R"=>$this->pChartObject->ShadowR,"G"=>$this->pChartObject->ShadowG,"B"=>$this->pChartObject->ShadowB,"Alpha"=>$this->pChartObject->Shadowa); |
|
205 | - else |
|
202 | + if ( $Shadow ) { |
|
203 | + $Settings = array("R"=>$this->pChartObject->ShadowR,"G"=>$this->pChartObject->ShadowG,"B"=>$this->pChartObject->ShadowB,"Alpha"=>$this->pChartObject->Shadowa); |
|
204 | + } else |
|
206 | 205 | { |
207 | - if ( $Border ) |
|
208 | - $Settings = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB); |
|
209 | - else |
|
210 | - $Settings = array("R"=>$Palette[$ID]["R"],"G"=>$Palette[$ID]["G"],"B"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]); |
|
206 | + if ( $Border ) { |
|
207 | + $Settings = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB); |
|
208 | + } else { |
|
209 | + $Settings = array("R"=>$Palette[$ID]["R"],"G"=>$Palette[$ID]["G"],"B"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]); |
|
210 | + } |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | $EndAngle = $Offset+($Value*$ScaleFactor); if ( $EndAngle > 360 ) { $EndAngle = 360; } |
214 | 214 | |
215 | 215 | if ($DataGapAngle == 0) |
216 | - { $X0 = $X; $Y0 = $Y; } |
|
217 | - else |
|
216 | + { $X0 = $X; $Y0 = $Y; } else |
|
218 | 217 | { |
219 | 218 | $Angle = ($EndAngle - $Offset)/2 + $Offset; |
220 | 219 | $X0 = cos(($Angle-90)*PI/180) * $DataGapRadius + $X; |
@@ -236,8 +235,7 @@ discard block |
||
236 | 235 | if ( $DrawLabels && !$Shadow ) |
237 | 236 | { |
238 | 237 | if ( $LabelColor == PIE_LABEL_COLOR_AUTO ) |
239 | - { $Settings = array("FillR"=>$Palette[$ID]["R"],"FillG"=>$Palette[$ID]["G"],"FillB"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]);} |
|
240 | - else |
|
238 | + { $Settings = array("FillR"=>$Palette[$ID]["R"],"FillG"=>$Palette[$ID]["G"],"FillB"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]);} else |
|
241 | 239 | { $Settings = array("FillR"=>$LabelR,"FillG"=>$LabelG,"FillB"=>$LabelB,"Alpha"=>$LabelAlpha); } |
242 | 240 | |
243 | 241 | $Angle = ($EndAngle - $Offset)/2 + $Offset; |
@@ -246,10 +244,11 @@ discard block |
||
246 | 244 | |
247 | 245 | $Label = $Data["Series"][$Data["Abscissa"]]["Data"][$Key]; |
248 | 246 | |
249 | - if ( $LabelStacked ) |
|
250 | - $this->writePieLabel($Xc,$Yc,$Label,$Angle,$Settings,TRUE,$X,$Y,$Radius); |
|
251 | - else |
|
252 | - $this->writePieLabel($Xc,$Yc,$Label,$Angle,$Settings,FALSE); |
|
247 | + if ( $LabelStacked ) { |
|
248 | + $this->writePieLabel($Xc,$Yc,$Label,$Angle,$Settings,TRUE,$X,$Y,$Radius); |
|
249 | + } else { |
|
250 | + $this->writePieLabel($Xc,$Yc,$Label,$Angle,$Settings,FALSE); |
|
251 | + } |
|
253 | 252 | } |
254 | 253 | |
255 | 254 | $Offset = $i + $DataGapAngle; $ID++; |
@@ -270,17 +269,17 @@ discard block |
||
270 | 269 | { |
271 | 270 | $Xc = cos(($Angle-90)*PI/180) * ($Radius+$ValuePadding) + $X; |
272 | 271 | $Yc = sin(($Angle-90)*PI/180) * ($Radius+$ValuePadding) + $Y; |
273 | - } |
|
274 | - else |
|
272 | + } else |
|
275 | 273 | { |
276 | 274 | $Xc = cos(($Angle-90)*PI/180) * ($Radius)/2 + $X; |
277 | 275 | $Yc = sin(($Angle-90)*PI/180) * ($Radius)/2 + $Y; |
278 | 276 | } |
279 | 277 | |
280 | - if ( $WriteValues == PIE_VALUE_PERCENTAGE ) |
|
281 | - $Display = round(( 100 / $SerieSum ) * $Value,$Precision)."%"; |
|
282 | - elseif ( $WriteValues == PIE_VALUE_NATURAL ) |
|
283 | - $Display = $Value.$ValueSuffix; |
|
278 | + if ( $WriteValues == PIE_VALUE_PERCENTAGE ) { |
|
279 | + $Display = round(( 100 / $SerieSum ) * $Value,$Precision)."%"; |
|
280 | + } elseif ( $WriteValues == PIE_VALUE_NATURAL ) { |
|
281 | + $Display = $Value.$ValueSuffix; |
|
282 | + } |
|
284 | 283 | |
285 | 284 | $this->pChartObject->drawText($Xc,$Yc,$Display,$Settings); |
286 | 285 | |
@@ -385,8 +384,7 @@ discard block |
||
385 | 384 | if ( $EndAngle < 180 ) { $Visible[$Slice]["End"] = FALSE; } else { $Visible[$Slice]["End"] = TRUE; } |
386 | 385 | |
387 | 386 | if ($DataGapAngle == 0) |
388 | - { $X0 = $X; $Y0 = $Y; } |
|
389 | - else |
|
387 | + { $X0 = $X; $Y0 = $Y; } else |
|
390 | 388 | { |
391 | 389 | $Angle = ($EndAngle - $Offset)/2 + $Offset; |
392 | 390 | $X0 = cos(($Angle-90)*PI/180) * $DataGapRadius + $X; |
@@ -453,9 +451,11 @@ discard block |
||
453 | 451 | if ( $Border ) |
454 | 452 | { $Settings["R"]+= 30; $Settings["G"]+= 30; $Settings["B"]+= 30;; } |
455 | 453 | |
456 | - if ( isset($SliceAngle[$SliceID][1]) ) /* Empty error handling */ |
|
454 | + if ( isset($SliceAngle[$SliceID][1]) ) { |
|
455 | + /* Empty error handling */ |
|
457 | 456 | { |
458 | 457 | $Angle = $SliceAngle[$SliceID][1]; |
458 | + } |
|
459 | 459 | $Xc = cos(($Angle-90)*PI/180) * $Radius + $X; |
460 | 460 | $Yc = sin(($Angle-90)*PI/180) * $Radius*$SkewFactor + $Y; |
461 | 461 | $this->pChartObject->drawLine($Plots[0],$Plots[1],$Xc,$Yc,$Settings); |
@@ -476,9 +476,11 @@ discard block |
||
476 | 476 | $Settings = $SliceColors[$SliceID]; |
477 | 477 | $Settings["R"]+= 10; $Settings["G"]+= 10; $Settings["B"]+= 10; $Settings["NoBorder"] = TRUE; |
478 | 478 | |
479 | - if ( $Visible[$SliceID]["Start"] && isset($Plots[2])) /* Empty error handling */ |
|
479 | + if ( $Visible[$SliceID]["Start"] && isset($Plots[2])) { |
|
480 | + /* Empty error handling */ |
|
480 | 481 | { |
481 | 482 | $this->pChartObject->drawLine($Plots[2],$Plots[3],$Plots[2],$Plots[3]- $SliceHeight,array("R"=>$Settings["R"],"G"=>$Settings["G"],"B"=>$Settings["B"])); |
483 | + } |
|
482 | 484 | $Border = ""; |
483 | 485 | $Border[] = $Plots[0]; $Border[] = $Plots[1]; $Border[] = $Plots[0]; $Border[] = $Plots[1] - $SliceHeight; |
484 | 486 | $Border[] = $Plots[2]; $Border[] = $Plots[3] - $SliceHeight; $Border[] = $Plots[2]; $Border[] = $Plots[3]; |
@@ -529,9 +531,11 @@ discard block |
||
529 | 531 | if ( $Border ) |
530 | 532 | { $Settings["R"]+= 30; $Settings["G"]+= 30; $Settings["B"]+= 30; } |
531 | 533 | |
532 | - if ( isset($SliceAngle[$SliceID][1]) ) /* Empty error handling */ |
|
534 | + if ( isset($SliceAngle[$SliceID][1]) ) { |
|
535 | + /* Empty error handling */ |
|
533 | 536 | { |
534 | 537 | $Angle = $SliceAngle[$SliceID][1]; |
538 | + } |
|
535 | 539 | if ( $Angle < 270 && $Angle > 90 ) |
536 | 540 | { |
537 | 541 | $Xc = cos(($Angle-90)*PI/180) * $Radius + $X; |
@@ -587,21 +591,20 @@ discard block |
||
587 | 591 | foreach($Values as $Key => $Value) |
588 | 592 | { |
589 | 593 | $FirstPoint = TRUE; |
590 | - if ( $Shadow ) |
|
591 | - $Settings = array("R"=>$this->pChartObject->ShadowR,"G"=>$this->pChartObject->ShadowG,"B"=>$this->pChartObject->ShadowB,"Alpha"=>$this->pChartObject->Shadowa); |
|
592 | - else |
|
594 | + if ( $Shadow ) { |
|
595 | + $Settings = array("R"=>$this->pChartObject->ShadowR,"G"=>$this->pChartObject->ShadowG,"B"=>$this->pChartObject->ShadowB,"Alpha"=>$this->pChartObject->Shadowa); |
|
596 | + } else |
|
593 | 597 | { |
594 | 598 | if ( $Border ) |
595 | - { $Settings = array("R"=>$Palette[$ID]["R"]+30,"G"=>$Palette[$ID]["G"]+30,"B"=>$Palette[$ID]["B"]+30,"Alpha"=>$Palette[$ID]["Alpha"]); } |
|
596 | - else |
|
597 | - $Settings = array("R"=>$Palette[$ID]["R"],"G"=>$Palette[$ID]["G"],"B"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]); |
|
599 | + { $Settings = array("R"=>$Palette[$ID]["R"]+30,"G"=>$Palette[$ID]["G"]+30,"B"=>$Palette[$ID]["B"]+30,"Alpha"=>$Palette[$ID]["Alpha"]); } else { |
|
600 | + $Settings = array("R"=>$Palette[$ID]["R"],"G"=>$Palette[$ID]["G"],"B"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]); |
|
601 | + } |
|
598 | 602 | } |
599 | 603 | |
600 | 604 | $EndAngle = $Offset-($Value*$ScaleFactor); if ( $EndAngle < 0 ) { $EndAngle = 0; } |
601 | 605 | |
602 | 606 | if ($DataGapAngle == 0) |
603 | - { $X0 = $X; $Y0 = $Y- $SliceHeight; } |
|
604 | - else |
|
607 | + { $X0 = $X; $Y0 = $Y- $SliceHeight; } else |
|
605 | 608 | { |
606 | 609 | $Angle = ($EndAngle - $Offset)/2 + $Offset; |
607 | 610 | $X0 = cos(($Angle-90)*PI/180) * $DataGapRadius + $X; |
@@ -640,17 +643,17 @@ discard block |
||
640 | 643 | { |
641 | 644 | $Xc = cos(($Angle-90)*PI/180) * ($Radius+$ValuePadding) + $X; |
642 | 645 | $Yc = sin(($Angle-90)*PI/180) * (($Radius*$SkewFactor)+$ValuePadding) + $Y - $SliceHeight; |
643 | - } |
|
644 | - else |
|
646 | + } else |
|
645 | 647 | { |
646 | 648 | $Xc = cos(($Angle-90)*PI/180) * ($Radius)/2 + $X; |
647 | 649 | $Yc = sin(($Angle-90)*PI/180) * ($Radius*$SkewFactor)/2 + $Y - $SliceHeight; |
648 | 650 | } |
649 | 651 | |
650 | - if ( $WriteValues == PIE_VALUE_PERCENTAGE ) |
|
651 | - $Display = round(( 100 / $SerieSum ) * $Value,$Precision)."%"; |
|
652 | - elseif ( $WriteValues == PIE_VALUE_NATURAL ) |
|
653 | - $Display = $Value.$ValueSuffix; |
|
652 | + if ( $WriteValues == PIE_VALUE_PERCENTAGE ) { |
|
653 | + $Display = round(( 100 / $SerieSum ) * $Value,$Precision)."%"; |
|
654 | + } elseif ( $WriteValues == PIE_VALUE_NATURAL ) { |
|
655 | + $Display = $Value.$ValueSuffix; |
|
656 | + } |
|
654 | 657 | |
655 | 658 | $this->pChartObject->drawText($Xc,$Yc,$Display,$Settings); |
656 | 659 | |
@@ -665,8 +668,7 @@ discard block |
||
665 | 668 | foreach($Values as $Key => $Value) |
666 | 669 | { |
667 | 670 | if ( $LabelColor == PIE_LABEL_COLOR_AUTO ) |
668 | - { $Settings = array("FillR"=>$Palette[$ID]["R"],"FillG"=>$Palette[$ID]["G"],"FillB"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]);} |
|
669 | - else |
|
671 | + { $Settings = array("FillR"=>$Palette[$ID]["R"],"FillG"=>$Palette[$ID]["G"],"FillB"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]);} else |
|
670 | 672 | { $Settings = array("FillR"=>$LabelR,"FillG"=>$LabelG,"FillB"=>$LabelB,"Alpha"=>$LabelAlpha); } |
671 | 673 | |
672 | 674 | $EndAngle = $Offset-($Value*$ScaleFactor); if ( $EndAngle < 0 ) { $EndAngle = 0; } |
@@ -679,10 +681,11 @@ discard block |
||
679 | 681 | { |
680 | 682 | $Label = $Data["Series"][$Data["Abscissa"]]["Data"][$ID]; |
681 | 683 | |
682 | - if ( $LabelStacked ) |
|
683 | - $this->writePieLabel($Xc,$Yc,$Label,$Angle,$Settings,TRUE,$X,$Y,$Radius,TRUE); |
|
684 | - else |
|
685 | - $this->writePieLabel($Xc,$Yc,$Label,$Angle,$Settings,FALSE); |
|
684 | + if ( $LabelStacked ) { |
|
685 | + $this->writePieLabel($Xc,$Yc,$Label,$Angle,$Settings,TRUE,$X,$Y,$Radius,TRUE); |
|
686 | + } else { |
|
687 | + $this->writePieLabel($Xc,$Yc,$Label,$Angle,$Settings,FALSE); |
|
688 | + } |
|
686 | 689 | } |
687 | 690 | |
688 | 691 | $Offset = $EndAngle - $DataGapAngle; $ID--; |
@@ -740,8 +743,7 @@ discard block |
||
740 | 743 | if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; } |
741 | 744 | if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$BoxSize/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$BoxSize/2; } |
742 | 745 | $vY=$vY+$YStep; |
743 | - } |
|
744 | - elseif ( $Mode == LEGEND_HORIZONTAL ) |
|
746 | + } elseif ( $Mode == LEGEND_HORIZONTAL ) |
|
745 | 747 | { |
746 | 748 | if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$BoxSize/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$BoxSize/2; } |
747 | 749 | if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; } |
@@ -754,10 +756,11 @@ discard block |
||
754 | 756 | $TopOffset = $Y - $Boundaries["T"]; |
755 | 757 | if ( $Boundaries["B"]-($vY+$BoxSize) < $TopOffset ) { $Boundaries["B"] = $vY+$BoxSize+$TopOffset; } |
756 | 758 | |
757 | - if ( $Style == LEGEND_ROUND ) |
|
758 | - $this->pChartObject->drawRoundedFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB)); |
|
759 | - elseif ( $Style == LEGEND_BOX ) |
|
760 | - $this->pChartObject->drawFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB)); |
|
759 | + if ( $Style == LEGEND_ROUND ) { |
|
760 | + $this->pChartObject->drawRoundedFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB)); |
|
761 | + } elseif ( $Style == LEGEND_BOX ) { |
|
762 | + $this->pChartObject->drawFilledRectangle($Boundaries["L"]-$Margin,$Boundaries["T"]-$Margin,$Boundaries["R"]+$Margin,$Boundaries["B"]+$Margin,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"BorderR"=>$BorderR,"BorderG"=>$BorderG,"BorderB"=>$BorderB)); |
|
763 | + } |
|
761 | 764 | |
762 | 765 | $RestoreShadow = $this->pChartObject->Shadow; $this->pChartObject->Shadow = FALSE; |
763 | 766 | foreach($Data["Series"][$Data["Abscissa"]]["Data"] as $Key => $Value) |
@@ -770,8 +773,7 @@ discard block |
||
770 | 773 | { |
771 | 774 | $this->pChartObject->drawText($X+$BoxSize+4,$Y+$BoxSize/2,$Value,array("R"=>$FontR,"G"=>$FontG,"B"=>$FontB,"Align"=>TEXT_ALIGN_MIDDLELEFT,"FontName"=>$FontName,"FontSize"=>$FontSize)); |
772 | 775 | $Y=$Y+$YStep; |
773 | - } |
|
774 | - elseif ( $Mode == LEGEND_HORIZONTAL ) |
|
776 | + } elseif ( $Mode == LEGEND_HORIZONTAL ) |
|
775 | 777 | { |
776 | 778 | $BoxArray = $this->pChartObject->drawText($X+$BoxSize+4,$Y+$BoxSize/2,$Value,array("R"=>$FontR,"G"=>$FontG,"B"=>$FontB,"Align"=>TEXT_ALIGN_MIDDLELEFT,"FontName"=>$FontName,"FontSize"=>$FontSize)); |
777 | 779 | $X=$BoxArray[1]["X"]+2+$XStep; |
@@ -809,8 +811,7 @@ discard block |
||
809 | 811 | $Settings["Size"] = 8; |
810 | 812 | |
811 | 813 | $this->pChartObject->drawArrowLabel($X,$Y," ".$Label." ",$Settings); |
812 | - } |
|
813 | - else |
|
814 | + } else |
|
814 | 815 | { |
815 | 816 | $X2 = cos(deg2rad($Angle-90))*20+$X; |
816 | 817 | $Y2 = sin(deg2rad($Angle-90))*20+$Y; |
@@ -873,8 +874,7 @@ discard block |
||
873 | 874 | { |
874 | 875 | $this->pChartObject->drawLine($X2,$Y2,$X3,$Y2); |
875 | 876 | $this->pChartObject->drawText($X3+2,$Y2,$Label,array("Align"=>TEXT_ALIGN_MIDDLELEFT)); |
876 | - } |
|
877 | - else |
|
877 | + } else |
|
878 | 878 | { |
879 | 879 | $this->pChartObject->drawLine($X2,$Y2,$X3,$Y2); |
880 | 880 | $this->pChartObject->drawText($X3-2,$Y2,$Label,array("Align"=>TEXT_ALIGN_MIDDLERIGHT)); |
@@ -964,16 +964,16 @@ discard block |
||
964 | 964 | { |
965 | 965 | $Settings = array("R"=>$this->pChartObject->ShadowR,"G"=>$this->pChartObject->ShadowG,"B"=>$this->pChartObject->ShadowB,"Alpha"=>$this->pChartObject->Shadowa); |
966 | 966 | $BorderColor = $Settings; |
967 | - } |
|
968 | - else |
|
967 | + } else |
|
969 | 968 | { |
970 | 969 | if ( !isset($Palette[$ID]["R"]) ) { $Color = $this->pChartObject->getRandomColor(); $Palette[$ID] = $Color; $this->pDataObject->savePalette($ID,$Color); } |
971 | 970 | $Settings = array("R"=>$Palette[$ID]["R"],"G"=>$Palette[$ID]["G"],"B"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]); |
972 | 971 | |
973 | - if ( $Border ) |
|
974 | - $BorderColor = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha); |
|
975 | - else |
|
976 | - $BorderColor = $Settings; |
|
972 | + if ( $Border ) { |
|
973 | + $BorderColor = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha); |
|
974 | + } else { |
|
975 | + $BorderColor = $Settings; |
|
976 | + } |
|
977 | 977 | } |
978 | 978 | |
979 | 979 | $Plots = ""; $Boundaries = ""; $AAPixels = ""; |
@@ -1026,8 +1026,7 @@ discard block |
||
1026 | 1026 | if ( $DrawLabels && !$Shadow ) |
1027 | 1027 | { |
1028 | 1028 | if ( $LabelColor == PIE_LABEL_COLOR_AUTO ) |
1029 | - { $Settings = array("FillR"=>$Palette[$ID]["R"],"FillG"=>$Palette[$ID]["G"],"FillB"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]);} |
|
1030 | - else |
|
1029 | + { $Settings = array("FillR"=>$Palette[$ID]["R"],"FillG"=>$Palette[$ID]["G"],"FillB"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]);} else |
|
1031 | 1030 | { $Settings = array("FillR"=>$LabelR,"FillG"=>$LabelG,"FillB"=>$LabelB,"Alpha"=>$LabelAlpha); } |
1032 | 1031 | |
1033 | 1032 | $Angle = ($EndAngle - $Offset)/2 + $Offset; |
@@ -1036,10 +1035,11 @@ discard block |
||
1036 | 1035 | |
1037 | 1036 | $Label = $Data["Series"][$Data["Abscissa"]]["Data"][$Key]; |
1038 | 1037 | |
1039 | - if ( $LabelStacked ) |
|
1040 | - $this->writePieLabel($Xc,$Yc,$Label,$Angle,$Settings,TRUE,$X,$Y,$OuterRadius); |
|
1041 | - else |
|
1042 | - $this->writePieLabel($Xc,$Yc,$Label,$Angle,$Settings,FALSE); |
|
1038 | + if ( $LabelStacked ) { |
|
1039 | + $this->writePieLabel($Xc,$Yc,$Label,$Angle,$Settings,TRUE,$X,$Y,$OuterRadius); |
|
1040 | + } else { |
|
1041 | + $this->writePieLabel($Xc,$Yc,$Label,$Angle,$Settings,FALSE); |
|
1042 | + } |
|
1043 | 1043 | } |
1044 | 1044 | |
1045 | 1045 | $Offset = $Lasti; $ID++; |
@@ -1065,20 +1065,20 @@ discard block |
||
1065 | 1065 | if ( $Angle > 90 && $Angle <= 180 ) { $Align = TEXT_ALIGN_TOPLEFT; } |
1066 | 1066 | if ( $Angle > 180 && $Angle <= 270 ) { $Align = TEXT_ALIGN_TOPRIGHT; } |
1067 | 1067 | if ( $Angle > 270 ) { $Align = TEXT_ALIGN_BOTTOMRIGHT; } |
1068 | - } |
|
1069 | - else |
|
1068 | + } else |
|
1070 | 1069 | { |
1071 | 1070 | $Xc = cos(($Angle-90)*PI/180) * (($OuterRadius-$InnerRadius)/2+$InnerRadius) + $X; |
1072 | 1071 | $Yc = sin(($Angle-90)*PI/180) * (($OuterRadius-$InnerRadius)/2+$InnerRadius) + $Y; |
1073 | 1072 | $Align = TEXT_ALIGN_MIDDLEMIDDLE; |
1074 | 1073 | } |
1075 | 1074 | |
1076 | - if ( $WriteValues == PIE_VALUE_PERCENTAGE ) |
|
1077 | - $Display = round(( 100 / $SerieSum ) * $Value,$Precision)."%"; |
|
1078 | - elseif ( $WriteValues == PIE_VALUE_NATURAL ) |
|
1079 | - $Display = $Value.$ValueSuffix; |
|
1080 | - else |
|
1081 | - $Label = ""; |
|
1075 | + if ( $WriteValues == PIE_VALUE_PERCENTAGE ) { |
|
1076 | + $Display = round(( 100 / $SerieSum ) * $Value,$Precision)."%"; |
|
1077 | + } elseif ( $WriteValues == PIE_VALUE_NATURAL ) { |
|
1078 | + $Display = $Value.$ValueSuffix; |
|
1079 | + } else { |
|
1080 | + $Label = ""; |
|
1081 | + } |
|
1082 | 1082 | |
1083 | 1083 | $this->pChartObject->drawText($Xc,$Yc,$Display,array("Align"=>$Align,"R"=>$ValueR,"G"=>$ValueG,"B"=>$ValueB)); |
1084 | 1084 | $Offset = $EndAngle; |
@@ -1249,8 +1249,9 @@ discard block |
||
1249 | 1249 | $Settings = $SliceColors[$SliceID]; $Settings["NoBorder"] = TRUE; |
1250 | 1250 | $this->pChartObject->drawPolygon($Plots["BottomPoly"],$Settings); |
1251 | 1251 | |
1252 | - foreach($Plots["AA"] as $Key => $Pos) |
|
1253 | - $this->pChartObject->drawAntialiasPixel($Pos[0],$Pos[1],$Settings); |
|
1252 | + foreach($Plots["AA"] as $Key => $Pos) { |
|
1253 | + $this->pChartObject->drawAntialiasPixel($Pos[0],$Pos[1],$Settings); |
|
1254 | + } |
|
1254 | 1255 | |
1255 | 1256 | $this->pChartObject->drawLine($Plots["InX1"],$Plots["InY1"],$Plots["OutX2"],$Plots["OutY2"],$Settings); |
1256 | 1257 | $this->pChartObject->drawLine($Plots["InX2"],$Plots["InY2"],$Plots["OutX1"],$Plots["OutY1"],$Settings); |
@@ -1268,10 +1269,12 @@ discard block |
||
1268 | 1269 | $StartAngle = $Plots["Angle"][0]; |
1269 | 1270 | foreach($Plots["Angle"] as $Key =>$Angle) { if ($Angle == VOID) { $EndAngle = $Plots["Angle"][$Key-1]; } } |
1270 | 1271 | |
1271 | - if ( $StartAngle >= 270 || $StartAngle <= 90 ) |
|
1272 | - $this->pChartObject->drawLine($Plots["OutX1"],$Plots["OutY1"],$Plots["OutX1"],$Plots["OutY1"]-$SliceHeight,$Settings); |
|
1273 | - if ( $StartAngle >= 270 || $StartAngle <= 90 ) |
|
1274 | - $this->pChartObject->drawLine($Plots["OutX2"],$Plots["OutY2"],$Plots["OutX2"],$Plots["OutY2"]-$SliceHeight,$Settings); |
|
1272 | + if ( $StartAngle >= 270 || $StartAngle <= 90 ) { |
|
1273 | + $this->pChartObject->drawLine($Plots["OutX1"],$Plots["OutY1"],$Plots["OutX1"],$Plots["OutY1"]-$SliceHeight,$Settings); |
|
1274 | + } |
|
1275 | + if ( $StartAngle >= 270 || $StartAngle <= 90 ) { |
|
1276 | + $this->pChartObject->drawLine($Plots["OutX2"],$Plots["OutY2"],$Plots["OutX2"],$Plots["OutY2"]-$SliceHeight,$Settings); |
|
1277 | + } |
|
1275 | 1278 | |
1276 | 1279 | $this->pChartObject->drawLine($Plots["InX1"],$Plots["InY1"],$Plots["InX1"],$Plots["InY1"]-$SliceHeight,$Settings); |
1277 | 1280 | $this->pChartObject->drawLine($Plots["InX2"],$Plots["InY2"],$Plots["InX2"],$Plots["InY2"]-$SliceHeight,$Settings); |
@@ -1288,8 +1291,7 @@ discard block |
||
1288 | 1291 | foreach($Plots["Angle"] as $ID => $Angle) |
1289 | 1292 | { |
1290 | 1293 | if ( $Angle == VOID ) |
1291 | - { $Outer = FALSE; $Inner = TRUE; } |
|
1292 | - elseif( $Inner ) |
|
1294 | + { $Outer = FALSE; $Inner = TRUE; } elseif( $Inner ) |
|
1293 | 1295 | { |
1294 | 1296 | if (( $Angle < 90 || $Angle > 270 ) && isset($Plots["BottomPoly"][$ID*2]) ) |
1295 | 1297 | { |
@@ -1356,10 +1358,12 @@ discard block |
||
1356 | 1358 | $StartAngle = $Plots["Angle"][0]; |
1357 | 1359 | foreach($Plots["Angle"] as $Key =>$Angle) { if ($Angle == VOID) { $EndAngle = $Plots["Angle"][$Key-1]; } } |
1358 | 1360 | |
1359 | - if ( $StartAngle <= 270 && $StartAngle >= 90 ) |
|
1360 | - $this->pChartObject->drawLine($Plots["OutX1"],$Plots["OutY1"],$Plots["OutX1"],$Plots["OutY1"]-$SliceHeight,$Settings); |
|
1361 | - if ( $EndAngle <= 270 && $EndAngle >= 90 ) |
|
1362 | - $this->pChartObject->drawLine($Plots["OutX2"],$Plots["OutY2"],$Plots["OutX2"],$Plots["OutY2"]-$SliceHeight,$Settings); |
|
1361 | + if ( $StartAngle <= 270 && $StartAngle >= 90 ) { |
|
1362 | + $this->pChartObject->drawLine($Plots["OutX1"],$Plots["OutY1"],$Plots["OutX1"],$Plots["OutY1"]-$SliceHeight,$Settings); |
|
1363 | + } |
|
1364 | + if ( $EndAngle <= 270 && $EndAngle >= 90 ) { |
|
1365 | + $this->pChartObject->drawLine($Plots["OutX2"],$Plots["OutY2"],$Plots["OutX2"],$Plots["OutY2"]-$SliceHeight,$Settings); |
|
1366 | + } |
|
1363 | 1367 | } |
1364 | 1368 | |
1365 | 1369 | |
@@ -1374,8 +1378,7 @@ discard block |
||
1374 | 1378 | foreach($Plots["Angle"] as $ID => $Angle) |
1375 | 1379 | { |
1376 | 1380 | if ( $Angle == VOID ) |
1377 | - { $Outer = FALSE; $Inner = TRUE; } |
|
1378 | - elseif( $Outer ) |
|
1381 | + { $Outer = FALSE; $Inner = TRUE; } elseif( $Outer ) |
|
1379 | 1382 | { |
1380 | 1383 | if ( ( $Angle > 90 && $Angle < 270 ) && isset($Plots["BottomPoly"][$ID*2]) ) |
1381 | 1384 | { |
@@ -1405,8 +1408,9 @@ discard block |
||
1405 | 1408 | |
1406 | 1409 | if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("POLY",$this->arraySerialize($Plots["TopPoly"]),$this->pChartObject->toHTMLColor($Settings["R"],$Settings["G"],$Settings["B"]),$Data["Series"][$Data["Abscissa"]]["Data"][$SliceID],$Data["Series"][$DataSerie]["Data"][count($Slices)-$SliceID-1]); } |
1407 | 1410 | |
1408 | - foreach($Plots["AA"] as $Key => $Pos) |
|
1409 | - $this->pChartObject->drawAntialiasPixel($Pos[0],$Pos[1]-$SliceHeight,$Settings); |
|
1411 | + foreach($Plots["AA"] as $Key => $Pos) { |
|
1412 | + $this->pChartObject->drawAntialiasPixel($Pos[0],$Pos[1]-$SliceHeight,$Settings); |
|
1413 | + } |
|
1410 | 1414 | |
1411 | 1415 | $this->pChartObject->drawLine($Plots["InX1"],$Plots["InY1"]-$SliceHeight,$Plots["OutX2"],$Plots["OutY2"]-$SliceHeight,$Settings); |
1412 | 1416 | $this->pChartObject->drawLine($Plots["InX2"],$Plots["InY2"]-$SliceHeight,$Plots["OutX1"],$Plots["OutY1"]-$SliceHeight,$Settings); |
@@ -1421,25 +1425,26 @@ discard block |
||
1421 | 1425 | $EndAngle = $Offset-($Value*$ScaleFactor); if ( $EndAngle < 0 ) { $EndAngle = 0; } |
1422 | 1426 | |
1423 | 1427 | if ( $LabelColor == PIE_LABEL_COLOR_AUTO ) |
1424 | - { $Settings = array("FillR"=>$Palette[$ID]["R"],"FillG"=>$Palette[$ID]["G"],"FillB"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]);} |
|
1425 | - else |
|
1428 | + { $Settings = array("FillR"=>$Palette[$ID]["R"],"FillG"=>$Palette[$ID]["G"],"FillB"=>$Palette[$ID]["B"],"Alpha"=>$Palette[$ID]["Alpha"]);} else |
|
1426 | 1429 | { $Settings = array("FillR"=>$LabelR,"FillG"=>$LabelG,"FillB"=>$LabelB,"Alpha"=>$LabelAlpha); } |
1427 | 1430 | |
1428 | 1431 | $Angle = ($EndAngle - $Offset)/2 + $Offset; |
1429 | 1432 | $Xc = cos(($Angle-90)*PI/180) * ($OuterRadius+$DataGapRadius) + $X; |
1430 | 1433 | $Yc = sin(($Angle-90)*PI/180) * ($OuterRadius+$DataGapRadius)*$SkewFactor + $Y; |
1431 | 1434 | |
1432 | - if ( $WriteValues == PIE_VALUE_PERCENTAGE ) |
|
1433 | - $Label = $Display = round(( 100 / $SerieSum ) * $Value,$Precision)."%"; |
|
1434 | - elseif ( $WriteValues == PIE_VALUE_NATURAL ) |
|
1435 | - $Label = $Data["Series"][$Data["Abscissa"]]["Data"][$Key]; |
|
1436 | - else |
|
1437 | - $Label = ""; |
|
1438 | - |
|
1439 | - if ( $LabelStacked ) |
|
1440 | - $this->writePieLabel($Xc,$Yc-$SliceHeight,$Label,$Angle,$Settings,TRUE,$X,$Y,$OuterRadius); |
|
1441 | - else |
|
1442 | - $this->writePieLabel($Xc,$Yc-$SliceHeight,$Label,$Angle,$Settings,FALSE); |
|
1435 | + if ( $WriteValues == PIE_VALUE_PERCENTAGE ) { |
|
1436 | + $Label = $Display = round(( 100 / $SerieSum ) * $Value,$Precision)."%"; |
|
1437 | + } elseif ( $WriteValues == PIE_VALUE_NATURAL ) { |
|
1438 | + $Label = $Data["Series"][$Data["Abscissa"]]["Data"][$Key]; |
|
1439 | + } else { |
|
1440 | + $Label = ""; |
|
1441 | + } |
|
1442 | + |
|
1443 | + if ( $LabelStacked ) { |
|
1444 | + $this->writePieLabel($Xc,$Yc-$SliceHeight,$Label,$Angle,$Settings,TRUE,$X,$Y,$OuterRadius); |
|
1445 | + } else { |
|
1446 | + $this->writePieLabel($Xc,$Yc-$SliceHeight,$Label,$Angle,$Settings,FALSE); |
|
1447 | + } |
|
1443 | 1448 | |
1444 | 1449 | $Offset = $EndAngle - $DataGapAngle; $ID--; $Slice++; |
1445 | 1450 | } |