Browse Source

Fixed graphs

Sergei Solovev 1 year ago
parent
commit
eaf8a97bed
2 changed files with 6 additions and 2 deletions
  1. 2 2
      system/library/games/graph/pData.php
  2. 4 0
      system/library/games/graph/pDraw.php

+ 2 - 2
system/library/games/graph/pData.php

@@ -43,7 +43,7 @@ class pData
 
     function pData()
     {
-        $this->Data = '';
+        $this->Data = array();
         $this->Data['XAxisDisplay'] = AXIS_FORMAT_DEFAULT;
         $this->Data['XAxisFormat'] = NULL;
         $this->Data['XAxisName'] = NULL;
@@ -937,7 +937,7 @@ class pData
 
     function convertToArray($Value)
     {
-        $Values = '';
+        $Values = array();
         $Values[] = $Value;
         return ($Values);
     }

+ 4 - 0
system/library/games/graph/pDraw.php

@@ -2134,6 +2134,7 @@ class pDraw
                             $Boundaries["B"] = $BoxArray[1]["Y"] + 2 + $IconAreaHeight / 2;
                         }
 
+                        $Width = array();
                         $Width[] = $BoxArray[1]["X"];
                     }
 
@@ -2206,6 +2207,7 @@ class pDraw
                     $Width = "";
                     foreach ($Lines as $Key => $Value) {
                         $BoxArray = $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));
+                        $Width = array();
                         $Width[] = $BoxArray[1]["X"];
                     }
                     $X = max($Width) + 2 + $XStep;
@@ -3902,6 +3904,7 @@ class pDraw
                     }
                 }
             } else {
+                $Result = array();
                 foreach ($Values as $Key => $Value) {
                     if ($Value == VOID) {
                         $Result[] = VOID;
@@ -4481,6 +4484,7 @@ class pDraw
                             $this->drawLine($LastGoodX, $LastGoodY, $X, $Y, $BreakSettings);
                         }
 
+                        $WayPoints = array();
                         if ($Y != VOID)
                             $WayPoints[] = array($X, $Y);