Completed
Pull Request — master (#1795)
by Christian
09:16
created
default/boinc/modules/boincstats/includes/pchart/class/pScatter.class.php 4 patches
Indentation   +866 added lines, -866 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
- /*
2
+    /*
3 3
      pScatter - class to draw scatter charts
4 4
 
5 5
      Version     : 2.1.3
@@ -13,1146 +13,1146 @@  discard block
 block discarded – undo
13 13
      You can find the whole class documentation on the pChart web site.
14 14
  */
15 15
 
16
- define("SCATTER_MISSING_X_SERIE"	, 190001);
17
- define("SCATTER_MISSING_Y_SERIE"	, 190002);
16
+    define("SCATTER_MISSING_X_SERIE"	, 190001);
17
+    define("SCATTER_MISSING_Y_SERIE"	, 190002);
18 18
 
19
- /* pScatter class definition */
20
- class pScatter
21
-  {
22
-   var $pChartObject;
23
-   var $pDataObject;
19
+    /* pScatter class definition */
20
+    class pScatter
21
+    {
22
+    var $pChartObject;
23
+    var $pDataObject;
24 24
 
25
-   /* Class creator */
26
-   function pScatter($pChartObject,$pDataObject)
25
+    /* Class creator */
26
+    function pScatter($pChartObject,$pDataObject)
27 27
     {
28
-     $this->pChartObject = $pChartObject;
29
-     $this->pDataObject  = $pDataObject;
28
+        $this->pChartObject = $pChartObject;
29
+        $this->pDataObject  = $pDataObject;
30 30
     }
31 31
 
32
-   /* Prepare the scale */
33
-   function drawScatterScale($Format="")
32
+    /* Prepare the scale */
33
+    function drawScatterScale($Format="")
34 34
     {
35
-     $Mode		= isset($Format["Mode"]) ? $Format["Mode"] : SCALE_MODE_FLOATING;
36
-     $Floating		= isset($Format["Floating"]) ? $Format["Floating"] : FALSE;
37
-     $XLabelsRotation	= isset($Format["XLabelsRotation"]) ? $Format["XLabelsRotation"] : 90;
38
-     $MinDivHeight	= isset($Format["MinDivHeight"]) ? $Format["MinDivHeight"] : 20;
39
-     $Factors		= isset($Format["Factors"]) ? $Format["Factors"] : array(1,2,5);
40
-     $ManualScale	= isset($Format["ManualScale"]) ? $Format["ManualScale"] : array("0"=>array("Min"=>-100,"Max"=>100));
41
-     $XMargin		= isset($Format["XMargin"]) ? $Format["XMargin"] : 0;
42
-     $YMargin		= isset($Format["YMargin"]) ? $Format["YMargin"] : 0;
43
-     $ScaleSpacing	= isset($Format["ScaleSpacing"]) ? $Format["ScaleSpacing"] : 15;
44
-     $InnerTickWidth	= isset($Format["InnerTickWidth"]) ? $Format["InnerTickWidth"] : 2;
45
-     $OuterTickWidth	= isset($Format["OuterTickWidth"]) ? $Format["OuterTickWidth"] : 2;
46
-     $DrawXLines	= isset($Format["DrawXLines"]) ? $Format["DrawXLines"] : ALL;
47
-     $DrawYLines	= isset($Format["DrawYLines"]) ? $Format["DrawYLines"] : ALL;
48
-     $GridTicks		= isset($Format["GridTicks"]) ? $Format["GridTicks"] : 4;
49
-     $GridR		= isset($Format["GridR"]) ? $Format["GridR"] : 255;
50
-     $GridG		= isset($Format["GridG"]) ? $Format["GridG"] : 255;
51
-     $GridB		= isset($Format["GridB"]) ? $Format["GridB"] : 255;
52
-     $GridAlpha		= isset($Format["GridAlpha"]) ? $Format["GridAlpha"] : 40;
53
-     $AxisRo		= isset($Format["AxisR"]) ? $Format["AxisR"] : 0;
54
-     $AxisGo		= isset($Format["AxisG"]) ? $Format["AxisG"] : 0;
55
-     $AxisBo		= isset($Format["AxisB"]) ? $Format["AxisB"] : 0;
56
-     $AxisAlpha		= isset($Format["AxisAlpha"]) ? $Format["AxisAlpha"] : 100;
57
-     $TickRo		= isset($Format["TickR"]) ? $Format["TickR"] : 0;
58
-     $TickGo		= isset($Format["TickG"]) ? $Format["TickG"] : 0;
59
-     $TickBo		= isset($Format["TickB"]) ? $Format["TickB"] : 0;
60
-     $TickAlpha		= isset($Format["TickAlpha"]) ? $Format["TickAlpha"] : 100;
61
-     $DrawSubTicks	= isset($Format["DrawSubTicks"]) ? $Format["DrawSubTicks"] : FALSE;
62
-     $InnerSubTickWidth	= isset($Format["InnerSubTickWidth"]) ? $Format["InnerSubTickWidth"] : 0;
63
-     $OuterSubTickWidth	= isset($Format["OuterSubTickWidth"]) ? $Format["OuterSubTickWidth"] : 2;
64
-     $SubTickR		= isset($Format["SubTickR"]) ? $Format["SubTickR"] : 255;
65
-     $SubTickG		= isset($Format["SubTickG"]) ? $Format["SubTickG"] : 0;
66
-     $SubTickB		= isset($Format["SubTickB"]) ? $Format["SubTickB"] : 0;
67
-     $SubTickAlpha	= isset($Format["SubTickAlpha"]) ? $Format["SubTickAlpha"] : 100;
68
-     $XReleasePercent	= isset($Format["XReleasePercent"]) ? $Format["XReleasePercent"] : 1;
69
-     $DrawArrows	= isset($Format["DrawArrows"]) ? $Format["DrawArrows"] : FALSE;
70
-     $ArrowSize         = isset($Format["ArrowSize"]) ? $Format["ArrowSize"] : 8;
71
-     $CycleBackground	= isset($Format["CycleBackground"]) ? $Format["CycleBackground"] : FALSE;
72
-     $BackgroundR1	= isset($Format["BackgroundR1"]) ? $Format["BackgroundR1"] : 255;
73
-     $BackgroundG1	= isset($Format["BackgroundG1"]) ? $Format["BackgroundG1"] : 255;
74
-     $BackgroundB1	= isset($Format["BackgroundB1"]) ? $Format["BackgroundB1"] : 255;
75
-     $BackgroundAlpha1	= isset($Format["BackgroundAlpha1"]) ? $Format["BackgroundAlpha1"] : 10;
76
-     $BackgroundR2	= isset($Format["BackgroundR2"]) ? $Format["BackgroundR2"] : 230;
77
-     $BackgroundG2	= isset($Format["BackgroundG2"]) ? $Format["BackgroundG2"] : 230;
78
-     $BackgroundB2	= isset($Format["BackgroundB2"]) ? $Format["BackgroundB2"] : 230;
79
-     $BackgroundAlpha2	= isset($Format["BackgroundAlpha2"]) ? $Format["BackgroundAlpha2"] : 10;
80
-
81
-     /* Check if we have at least both one X and Y axis */
82
-     $GotXAxis = FALSE; $GotYAxis = FALSE;
83
-     foreach($this->pDataObject->Data["Axis"] as $AxisID => $AxisSettings)
84
-      {
85
-       if ( $AxisSettings["Identity"] == AXIS_X ) { $GotXAxis = TRUE; }
86
-       if ( $AxisSettings["Identity"] == AXIS_Y ) { $GotYAxis = TRUE; }
87
-      }
88
-     if ( !$GotXAxis ) { return(SCATTER_MISSING_X_SERIE); }
89
-     if ( !$GotYAxis ) { return(SCATTER_MISSING_Y_SERIE); }
90
-
91
-     /* Skip a NOTICE event in case of an empty array */
92
-     if ( $DrawYLines == NONE ) { $DrawYLines = array("zarma"=>"31"); }
93
-
94
-     $Data = $this->pDataObject->getData();
95
-
96
-     foreach($Data["Axis"] as $AxisID => $AxisSettings)
97
-      {
98
-       if ( $AxisSettings["Identity"] == AXIS_X)
35
+        $Mode		= isset($Format["Mode"]) ? $Format["Mode"] : SCALE_MODE_FLOATING;
36
+        $Floating		= isset($Format["Floating"]) ? $Format["Floating"] : FALSE;
37
+        $XLabelsRotation	= isset($Format["XLabelsRotation"]) ? $Format["XLabelsRotation"] : 90;
38
+        $MinDivHeight	= isset($Format["MinDivHeight"]) ? $Format["MinDivHeight"] : 20;
39
+        $Factors		= isset($Format["Factors"]) ? $Format["Factors"] : array(1,2,5);
40
+        $ManualScale	= isset($Format["ManualScale"]) ? $Format["ManualScale"] : array("0"=>array("Min"=>-100,"Max"=>100));
41
+        $XMargin		= isset($Format["XMargin"]) ? $Format["XMargin"] : 0;
42
+        $YMargin		= isset($Format["YMargin"]) ? $Format["YMargin"] : 0;
43
+        $ScaleSpacing	= isset($Format["ScaleSpacing"]) ? $Format["ScaleSpacing"] : 15;
44
+        $InnerTickWidth	= isset($Format["InnerTickWidth"]) ? $Format["InnerTickWidth"] : 2;
45
+        $OuterTickWidth	= isset($Format["OuterTickWidth"]) ? $Format["OuterTickWidth"] : 2;
46
+        $DrawXLines	= isset($Format["DrawXLines"]) ? $Format["DrawXLines"] : ALL;
47
+        $DrawYLines	= isset($Format["DrawYLines"]) ? $Format["DrawYLines"] : ALL;
48
+        $GridTicks		= isset($Format["GridTicks"]) ? $Format["GridTicks"] : 4;
49
+        $GridR		= isset($Format["GridR"]) ? $Format["GridR"] : 255;
50
+        $GridG		= isset($Format["GridG"]) ? $Format["GridG"] : 255;
51
+        $GridB		= isset($Format["GridB"]) ? $Format["GridB"] : 255;
52
+        $GridAlpha		= isset($Format["GridAlpha"]) ? $Format["GridAlpha"] : 40;
53
+        $AxisRo		= isset($Format["AxisR"]) ? $Format["AxisR"] : 0;
54
+        $AxisGo		= isset($Format["AxisG"]) ? $Format["AxisG"] : 0;
55
+        $AxisBo		= isset($Format["AxisB"]) ? $Format["AxisB"] : 0;
56
+        $AxisAlpha		= isset($Format["AxisAlpha"]) ? $Format["AxisAlpha"] : 100;
57
+        $TickRo		= isset($Format["TickR"]) ? $Format["TickR"] : 0;
58
+        $TickGo		= isset($Format["TickG"]) ? $Format["TickG"] : 0;
59
+        $TickBo		= isset($Format["TickB"]) ? $Format["TickB"] : 0;
60
+        $TickAlpha		= isset($Format["TickAlpha"]) ? $Format["TickAlpha"] : 100;
61
+        $DrawSubTicks	= isset($Format["DrawSubTicks"]) ? $Format["DrawSubTicks"] : FALSE;
62
+        $InnerSubTickWidth	= isset($Format["InnerSubTickWidth"]) ? $Format["InnerSubTickWidth"] : 0;
63
+        $OuterSubTickWidth	= isset($Format["OuterSubTickWidth"]) ? $Format["OuterSubTickWidth"] : 2;
64
+        $SubTickR		= isset($Format["SubTickR"]) ? $Format["SubTickR"] : 255;
65
+        $SubTickG		= isset($Format["SubTickG"]) ? $Format["SubTickG"] : 0;
66
+        $SubTickB		= isset($Format["SubTickB"]) ? $Format["SubTickB"] : 0;
67
+        $SubTickAlpha	= isset($Format["SubTickAlpha"]) ? $Format["SubTickAlpha"] : 100;
68
+        $XReleasePercent	= isset($Format["XReleasePercent"]) ? $Format["XReleasePercent"] : 1;
69
+        $DrawArrows	= isset($Format["DrawArrows"]) ? $Format["DrawArrows"] : FALSE;
70
+        $ArrowSize         = isset($Format["ArrowSize"]) ? $Format["ArrowSize"] : 8;
71
+        $CycleBackground	= isset($Format["CycleBackground"]) ? $Format["CycleBackground"] : FALSE;
72
+        $BackgroundR1	= isset($Format["BackgroundR1"]) ? $Format["BackgroundR1"] : 255;
73
+        $BackgroundG1	= isset($Format["BackgroundG1"]) ? $Format["BackgroundG1"] : 255;
74
+        $BackgroundB1	= isset($Format["BackgroundB1"]) ? $Format["BackgroundB1"] : 255;
75
+        $BackgroundAlpha1	= isset($Format["BackgroundAlpha1"]) ? $Format["BackgroundAlpha1"] : 10;
76
+        $BackgroundR2	= isset($Format["BackgroundR2"]) ? $Format["BackgroundR2"] : 230;
77
+        $BackgroundG2	= isset($Format["BackgroundG2"]) ? $Format["BackgroundG2"] : 230;
78
+        $BackgroundB2	= isset($Format["BackgroundB2"]) ? $Format["BackgroundB2"] : 230;
79
+        $BackgroundAlpha2	= isset($Format["BackgroundAlpha2"]) ? $Format["BackgroundAlpha2"] : 10;
80
+
81
+        /* Check if we have at least both one X and Y axis */
82
+        $GotXAxis = FALSE; $GotYAxis = FALSE;
83
+        foreach($this->pDataObject->Data["Axis"] as $AxisID => $AxisSettings)
84
+        {
85
+        if ( $AxisSettings["Identity"] == AXIS_X ) { $GotXAxis = TRUE; }
86
+        if ( $AxisSettings["Identity"] == AXIS_Y ) { $GotYAxis = TRUE; }
87
+        }
88
+        if ( !$GotXAxis ) { return(SCATTER_MISSING_X_SERIE); }
89
+        if ( !$GotYAxis ) { return(SCATTER_MISSING_Y_SERIE); }
90
+
91
+        /* Skip a NOTICE event in case of an empty array */
92
+        if ( $DrawYLines == NONE ) { $DrawYLines = array("zarma"=>"31"); }
93
+
94
+        $Data = $this->pDataObject->getData();
95
+
96
+        foreach($Data["Axis"] as $AxisID => $AxisSettings)
97
+        {
98
+        if ( $AxisSettings["Identity"] == AXIS_X)
99 99
         { $Width = $this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1 - $XMargin*2; }
100
-       else
100
+        else
101 101
         { $Width = $this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1 - $YMargin*2; }
102 102
 
103
-       $AxisMin = ABSOLUTE_MAX; $AxisMax = OUT_OF_SIGHT;
104
-       if ( $Mode == SCALE_MODE_FLOATING )
103
+        $AxisMin = ABSOLUTE_MAX; $AxisMax = OUT_OF_SIGHT;
104
+        if ( $Mode == SCALE_MODE_FLOATING )
105 105
         {
106
-         foreach($Data["Series"] as $SerieID => $SerieParameter)
107
-          {
108
-           if ( $SerieParameter["Axis"] == $AxisID && $Data["Series"][$SerieID]["isDrawable"] )
106
+            foreach($Data["Series"] as $SerieID => $SerieParameter)
109 107
             {
110
-             $AxisMax = max($AxisMax,$Data["Series"][$SerieID]["Max"]);
111
-             $AxisMin = min($AxisMin,$Data["Series"][$SerieID]["Min"]);
108
+            if ( $SerieParameter["Axis"] == $AxisID && $Data["Series"][$SerieID]["isDrawable"] )
109
+            {
110
+                $AxisMax = max($AxisMax,$Data["Series"][$SerieID]["Max"]);
111
+                $AxisMin = min($AxisMin,$Data["Series"][$SerieID]["Min"]);
112
+            }
112 113
             }
113
-          }
114
-         $AutoMargin = (($AxisMax-$AxisMin)/100)*$XReleasePercent;
114
+            $AutoMargin = (($AxisMax-$AxisMin)/100)*$XReleasePercent;
115 115
 
116
-         $Data["Axis"][$AxisID]["Min"] = $AxisMin-$AutoMargin; $Data["Axis"][$AxisID]["Max"] = $AxisMax+$AutoMargin;
116
+            $Data["Axis"][$AxisID]["Min"] = $AxisMin-$AutoMargin; $Data["Axis"][$AxisID]["Max"] = $AxisMax+$AutoMargin;
117 117
         }
118
-       elseif ( $Mode == SCALE_MODE_MANUAL )
118
+        elseif ( $Mode == SCALE_MODE_MANUAL )
119 119
         {
120
-         if ( isset($ManualScale[$AxisID]["Min"]) && isset($ManualScale[$AxisID]["Max"]) )
121
-          {
122
-           $Data["Axis"][$AxisID]["Min"] = $ManualScale[$AxisID]["Min"];
123
-           $Data["Axis"][$AxisID]["Max"] = $ManualScale[$AxisID]["Max"];
124
-          }
125
-         else
126
-          { echo "Manual scale boundaries not set."; exit(); }
120
+            if ( isset($ManualScale[$AxisID]["Min"]) && isset($ManualScale[$AxisID]["Max"]) )
121
+            {
122
+            $Data["Axis"][$AxisID]["Min"] = $ManualScale[$AxisID]["Min"];
123
+            $Data["Axis"][$AxisID]["Max"] = $ManualScale[$AxisID]["Max"];
124
+            }
125
+            else
126
+            { echo "Manual scale boundaries not set."; exit(); }
127 127
         }
128 128
 
129
-       /* Full manual scale */
130
-       if ( isset($ManualScale[$AxisID]["Rows"]) && isset($ManualScale[$AxisID]["RowHeight"]) )
129
+        /* Full manual scale */
130
+        if ( isset($ManualScale[$AxisID]["Rows"]) && isset($ManualScale[$AxisID]["RowHeight"]) )
131 131
         $Scale = array("Rows"=>$ManualScale[$AxisID]["Rows"],"RowHeight"=>$ManualScale[$AxisID]["RowHeight"],"XMin"=>$ManualScale[$AxisID]["Min"],"XMax"=>$ManualScale[$AxisID]["Max"]);
132
-       else
132
+        else
133 133
         {
134
-         $MaxDivs = floor($Width/$MinDivHeight);
135
-         $Scale   = $this->pChartObject->computeScale($Data["Axis"][$AxisID]["Min"],$Data["Axis"][$AxisID]["Max"],$MaxDivs,$Factors,$AxisID);
134
+            $MaxDivs = floor($Width/$MinDivHeight);
135
+            $Scale   = $this->pChartObject->computeScale($Data["Axis"][$AxisID]["Min"],$Data["Axis"][$AxisID]["Max"],$MaxDivs,$Factors,$AxisID);
136 136
         }
137 137
 
138
-       $Data["Axis"][$AxisID]["Margin"]    = $AxisSettings["Identity"] == AXIS_X ? $XMargin : $YMargin;
139
-       $Data["Axis"][$AxisID]["ScaleMin"]  = $Scale["XMin"];
140
-       $Data["Axis"][$AxisID]["ScaleMax"]  = $Scale["XMax"];
141
-       $Data["Axis"][$AxisID]["Rows"]      = $Scale["Rows"];
142
-       $Data["Axis"][$AxisID]["RowHeight"] = $Scale["RowHeight"];
138
+        $Data["Axis"][$AxisID]["Margin"]    = $AxisSettings["Identity"] == AXIS_X ? $XMargin : $YMargin;
139
+        $Data["Axis"][$AxisID]["ScaleMin"]  = $Scale["XMin"];
140
+        $Data["Axis"][$AxisID]["ScaleMax"]  = $Scale["XMax"];
141
+        $Data["Axis"][$AxisID]["Rows"]      = $Scale["Rows"];
142
+        $Data["Axis"][$AxisID]["RowHeight"] = $Scale["RowHeight"];
143 143
 
144
-       if ( isset($Scale["Format"]) ) { $Data["Axis"][$AxisID]["Format"] = $Scale["Format"]; }
144
+        if ( isset($Scale["Format"]) ) { $Data["Axis"][$AxisID]["Format"] = $Scale["Format"]; }
145 145
 
146
-       if ( !isset($Data["Axis"][$AxisID]["Display"]) ) { $Data["Axis"][$AxisID]["Display"] = NULL; }
147
-       if ( !isset($Data["Axis"][$AxisID]["Format"]) )  { $Data["Axis"][$AxisID]["Format"] = NULL; }
148
-       if ( !isset($Data["Axis"][$AxisID]["Unit"]) )    { $Data["Axis"][$AxisID]["Unit"] = NULL; }
149
-      }
146
+        if ( !isset($Data["Axis"][$AxisID]["Display"]) ) { $Data["Axis"][$AxisID]["Display"] = NULL; }
147
+        if ( !isset($Data["Axis"][$AxisID]["Format"]) )  { $Data["Axis"][$AxisID]["Format"] = NULL; }
148
+        if ( !isset($Data["Axis"][$AxisID]["Unit"]) )    { $Data["Axis"][$AxisID]["Unit"] = NULL; }
149
+        }
150 150
 
151
-     /* Get the default font color */
152
-     $FontColorRo = $this->pChartObject->FontColorR; $FontColorGo = $this->pChartObject->FontColorG; $FontColorBo = $this->pChartObject->FontColorB;
151
+        /* Get the default font color */
152
+        $FontColorRo = $this->pChartObject->FontColorR; $FontColorGo = $this->pChartObject->FontColorG; $FontColorBo = $this->pChartObject->FontColorB;
153 153
 
154
-     /* Set the original boundaries */
155
-     $AxisPos["L"] = $this->pChartObject->GraphAreaX1; $AxisPos["R"] = $this->pChartObject->GraphAreaX2; $AxisPos["T"] = $this->pChartObject->GraphAreaY1; $AxisPos["B"] = $this->pChartObject->GraphAreaY2;
154
+        /* Set the original boundaries */
155
+        $AxisPos["L"] = $this->pChartObject->GraphAreaX1; $AxisPos["R"] = $this->pChartObject->GraphAreaX2; $AxisPos["T"] = $this->pChartObject->GraphAreaY1; $AxisPos["B"] = $this->pChartObject->GraphAreaY2;
156 156
 
157
-     foreach($Data["Axis"] as $AxisID => $AxisSettings)
158
-      {
159
-       if ( isset($AxisSettings["Color"]) )
157
+        foreach($Data["Axis"] as $AxisID => $AxisSettings)
158
+        {
159
+        if ( isset($AxisSettings["Color"]) )
160 160
         {
161
-         $AxisR = $AxisSettings["Color"]["R"]; $AxisG = $AxisSettings["Color"]["G"]; $AxisB = $AxisSettings["Color"]["B"];
162
-         $TickR = $AxisSettings["Color"]["R"]; $TickG = $AxisSettings["Color"]["G"]; $TickB = $AxisSettings["Color"]["B"];
163
-         $this->pChartObject->setFontProperties(array("R"=>$AxisSettings["Color"]["R"],"G"=>$AxisSettings["Color"]["G"],"B"=>$AxisSettings["Color"]["B"]));
161
+            $AxisR = $AxisSettings["Color"]["R"]; $AxisG = $AxisSettings["Color"]["G"]; $AxisB = $AxisSettings["Color"]["B"];
162
+            $TickR = $AxisSettings["Color"]["R"]; $TickG = $AxisSettings["Color"]["G"]; $TickB = $AxisSettings["Color"]["B"];
163
+            $this->pChartObject->setFontProperties(array("R"=>$AxisSettings["Color"]["R"],"G"=>$AxisSettings["Color"]["G"],"B"=>$AxisSettings["Color"]["B"]));
164 164
         }
165
-       else
165
+        else
166 166
         {
167
-         $AxisR = $AxisRo; $AxisG = $AxisGo; $AxisB = $AxisBo;
168
-         $TickR = $TickRo; $TickG = $TickGo; $TickB = $TickBo;
169
-         $this->pChartObject->setFontProperties(array("R"=>$FontColorRo,"G"=>$FontColorGo,"B"=>$FontColorBo));
167
+            $AxisR = $AxisRo; $AxisG = $AxisGo; $AxisB = $AxisBo;
168
+            $TickR = $TickRo; $TickG = $TickGo; $TickB = $TickBo;
169
+            $this->pChartObject->setFontProperties(array("R"=>$FontColorRo,"G"=>$FontColorGo,"B"=>$FontColorBo));
170 170
         }
171 171
 
172
-       $LastValue = "w00t"; $ID = 1;
173
-       if ( $AxisSettings["Identity"] == AXIS_X )
172
+        $LastValue = "w00t"; $ID = 1;
173
+        if ( $AxisSettings["Identity"] == AXIS_X )
174 174
         {
175
-         if ( $AxisSettings["Position"] == AXIS_POSITION_BOTTOM )
176
-          {
177
-           if ( $XLabelsRotation == 0 )				   { $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 2; }
178
-           if ( $XLabelsRotation > 0 && $XLabelsRotation < 190 )   { $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
179
-           if ( $XLabelsRotation == 180 )			   { $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 5; }
180
-           if ( $XLabelsRotation > 180 && $XLabelsRotation < 360 ) { $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
181
-
182
-           if ( $Floating )
175
+            if ( $AxisSettings["Position"] == AXIS_POSITION_BOTTOM )
176
+            {
177
+            if ( $XLabelsRotation == 0 )				   { $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 2; }
178
+            if ( $XLabelsRotation > 0 && $XLabelsRotation < 190 )   { $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
179
+            if ( $XLabelsRotation == 180 )			   { $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 5; }
180
+            if ( $XLabelsRotation > 180 && $XLabelsRotation < 360 ) { $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
181
+
182
+            if ( $Floating )
183 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
184
+            else
185 185
             { $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 186
 
187
-           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)); }
187
+            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)); }
188 188
 
189
-           $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
190
-           $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxBottom = $AxisPos["B"];
191
-           $LastX  = NULL;
192
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
189
+            $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
190
+            $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxBottom = $AxisPos["B"];
191
+            $LastX  = NULL;
192
+            for($i=0;$i<=$AxisSettings["Rows"];$i++)
193 193
             {
194
-             $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
195
-             $YPos  = $AxisPos["B"];
196
-             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
194
+                $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
195
+                $YPos  = $AxisPos["B"];
196
+                $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
197 197
 
198
-             if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
199
-             if ( $LastX != NULL && $CycleBackground  && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); }
198
+                if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
199
+                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 200
 
201
-             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));
201
+                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));
204 204
 
205
-             $this->pChartObject->drawLine($XPos,$YPos-$InnerTickWidth,$XPos,$YPos+$OuterTickWidth,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
206
-             $Bounds    = $this->pChartObject->drawText($XPos,$YPos+$OuterTickWidth+$LabelOffset,$Value,array("Angle"=>$XLabelsRotation,"Align"=>$LabelAlign));
207
-             $TxtBottom = $YPos+2+$OuterTickWidth+2+($Bounds[0]["Y"]-$Bounds[2]["Y"]);
208
-             $MaxBottom = max($MaxBottom,$TxtBottom);
205
+                $this->pChartObject->drawLine($XPos,$YPos-$InnerTickWidth,$XPos,$YPos+$OuterTickWidth,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
206
+                $Bounds    = $this->pChartObject->drawText($XPos,$YPos+$OuterTickWidth+$LabelOffset,$Value,array("Angle"=>$XLabelsRotation,"Align"=>$LabelAlign));
207
+                $TxtBottom = $YPos+2+$OuterTickWidth+2+($Bounds[0]["Y"]-$Bounds[2]["Y"]);
208
+                $MaxBottom = max($MaxBottom,$TxtBottom);
209 209
 
210
-             $LastX = $XPos;
210
+                $LastX = $XPos;
211 211
             }
212 212
 
213
-           if ( isset($AxisSettings["Name"]) )
213
+            if ( isset($AxisSettings["Name"]) )
214 214
             {
215
-             $YPos   = $MaxBottom+2;
216
-             $XPos   = $this->pChartObject->GraphAreaX1+($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1)/2;
217
-             $Bounds = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_TOPMIDDLE));
218
-             $MaxBottom = $Bounds[0]["Y"];
215
+                $YPos   = $MaxBottom+2;
216
+                $XPos   = $this->pChartObject->GraphAreaX1+($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1)/2;
217
+                $Bounds = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_TOPMIDDLE));
218
+                $MaxBottom = $Bounds[0]["Y"];
219 219
 
220
-             $this->pDataObject->Data["GraphArea"]["Y2"] = $MaxBottom + $this->pChartObject->FontSize;
220
+                $this->pDataObject->Data["GraphArea"]["Y2"] = $MaxBottom + $this->pChartObject->FontSize;
221 221
             }
222 222
 
223
-           $AxisPos["B"] = $MaxBottom + $ScaleSpacing;
224
-          }
225
-         elseif ( $AxisSettings["Position"] == AXIS_POSITION_TOP )
226
-          {
227
-           if ( $XLabelsRotation == 0 )					{ $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 2; }
228
-           if ( $XLabelsRotation > 0 && $XLabelsRotation < 190 )	{ $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
229
-           if ( $XLabelsRotation == 180 )				{ $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 5; }
230
-           if ( $XLabelsRotation > 180 && $SLabelxRotation < 360 )	{ $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
223
+            $AxisPos["B"] = $MaxBottom + $ScaleSpacing;
224
+            }
225
+            elseif ( $AxisSettings["Position"] == AXIS_POSITION_TOP )
226
+            {
227
+            if ( $XLabelsRotation == 0 )					{ $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 2; }
228
+            if ( $XLabelsRotation > 0 && $XLabelsRotation < 190 )	{ $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
229
+            if ( $XLabelsRotation == 180 )				{ $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 5; }
230
+            if ( $XLabelsRotation > 180 && $SLabelxRotation < 360 )	{ $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
231 231
 
232
-           if ( $Floating )
232
+            if ( $Floating )
233 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
234
+            else
235 235
             { $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 236
 
237
-           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)); }
237
+            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)); }
238 238
 
239
-           $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
240
-           $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinTop = $AxisPos["T"];
241
-           $LastX  = NULL;
242
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
239
+            $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
240
+            $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinTop = $AxisPos["T"];
241
+            $LastX  = NULL;
242
+            for($i=0;$i<=$AxisSettings["Rows"];$i++)
243 243
             {
244
-             $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
245
-             $YPos  = $AxisPos["T"];
246
-             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
244
+                $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
245
+                $YPos  = $AxisPos["T"];
246
+                $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
247 247
 
248
-             if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
249
-             if ( $LastX != NULL && $CycleBackground  && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); }
248
+                if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
249
+                if ( $LastX != NULL && $CycleBackground  && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); }
250 250
 
251
-             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)); }
251
+                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 252
 
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));
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));
255 255
 
256
-             $this->pChartObject->drawLine($XPos,$YPos-$OuterTickWidth,$XPos,$YPos+$InnerTickWidth,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
257
-             $Bounds = $this->pChartObject->drawText($XPos,$YPos-$OuterTickWidth-$LabelOffset,$Value,array("Angle"=>$XLabelsRotation,"Align"=>$LabelAlign));
258
-             $TxtBox = $YPos-$OuterTickWidth-4-($Bounds[0]["Y"]-$Bounds[2]["Y"]);
259
-             $MinTop = min($MinTop,$TxtBox);
256
+                $this->pChartObject->drawLine($XPos,$YPos-$OuterTickWidth,$XPos,$YPos+$InnerTickWidth,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
257
+                $Bounds = $this->pChartObject->drawText($XPos,$YPos-$OuterTickWidth-$LabelOffset,$Value,array("Angle"=>$XLabelsRotation,"Align"=>$LabelAlign));
258
+                $TxtBox = $YPos-$OuterTickWidth-4-($Bounds[0]["Y"]-$Bounds[2]["Y"]);
259
+                $MinTop = min($MinTop,$TxtBox);
260 260
 
261
-             $LastX = $XPos;
261
+                $LastX = $XPos;
262 262
             }
263 263
 
264
-           if ( isset($AxisSettings["Name"]) )
264
+            if ( isset($AxisSettings["Name"]) )
265 265
             {
266
-             $YPos   = $MinTop-2;
267
-             $XPos   = $this->pChartObject->GraphAreaX1+($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1)/2;
268
-             $Bounds = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE));
269
-             $MinTop = $Bounds[2]["Y"];
266
+                $YPos   = $MinTop-2;
267
+                $XPos   = $this->pChartObject->GraphAreaX1+($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1)/2;
268
+                $Bounds = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE));
269
+                $MinTop = $Bounds[2]["Y"];
270 270
 
271
-             $this->pDataObject->Data["GraphArea"]["Y1"] = $MinTop;
271
+                $this->pDataObject->Data["GraphArea"]["Y1"] = $MinTop;
272 272
             }
273 273
 
274
-           $AxisPos["T"] = $MinTop - $ScaleSpacing;
275
-          }
274
+            $AxisPos["T"] = $MinTop - $ScaleSpacing;
275
+            }
276 276
         }
277
-       elseif ( $AxisSettings["Identity"] == AXIS_Y )
277
+        elseif ( $AxisSettings["Identity"] == AXIS_Y )
278 278
         {
279
-         if ( $AxisSettings["Position"] == AXIS_POSITION_LEFT )
280
-          {
279
+            if ( $AxisSettings["Position"] == AXIS_POSITION_LEFT )
280
+            {
281 281
 
282
-           if ( $Floating )
282
+            if ( $Floating )
283 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
284
+            else
285 285
             { $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 286
 
287
-           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)); }
287
+            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)); }
288 288
 
289
-           $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
290
-           $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinLeft = $AxisPos["L"];
291
-           $LastY  = NULL;
292
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
289
+            $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
290
+            $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinLeft = $AxisPos["L"];
291
+            $LastY  = NULL;
292
+            for($i=0;$i<=$AxisSettings["Rows"];$i++)
293 293
             {
294
-             $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
295
-             $XPos  = $AxisPos["L"];
296
-             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
294
+                $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
295
+                $XPos  = $AxisPos["L"];
296
+                $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
297 297
 
298
-             if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
299
-             if ( $LastY != NULL && $CycleBackground && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
298
+                if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
299
+                if ( $LastY != NULL && $CycleBackground && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
300 300
 
301
-             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)); }
301
+                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 302
 
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));
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));
305 305
 
306
-             $this->pChartObject->drawLine($XPos-$OuterTickWidth,$YPos,$XPos+$InnerTickWidth,$YPos,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
307
-             $Bounds  = $this->pChartObject->drawText($XPos-$OuterTickWidth-2,$YPos,$Value,array("Align"=>TEXT_ALIGN_MIDDLERIGHT));
308
-             $TxtLeft = $XPos-$OuterTickWidth-2-($Bounds[1]["X"]-$Bounds[0]["X"]);
309
-             $MinLeft = min($MinLeft,$TxtLeft);
306
+                $this->pChartObject->drawLine($XPos-$OuterTickWidth,$YPos,$XPos+$InnerTickWidth,$YPos,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
307
+                $Bounds  = $this->pChartObject->drawText($XPos-$OuterTickWidth-2,$YPos,$Value,array("Align"=>TEXT_ALIGN_MIDDLERIGHT));
308
+                $TxtLeft = $XPos-$OuterTickWidth-2-($Bounds[1]["X"]-$Bounds[0]["X"]);
309
+                $MinLeft = min($MinLeft,$TxtLeft);
310 310
 
311
-             $LastY = $YPos;
311
+                $LastY = $YPos;
312 312
             }
313 313
 
314
-           if ( isset($AxisSettings["Name"]) )
314
+            if ( isset($AxisSettings["Name"]) )
315 315
             {
316
-             $XPos    = $MinLeft-2;
317
-             $YPos    = $this->pChartObject->GraphAreaY1+($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1)/2;
318
-             $Bounds  = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE,"Angle"=>90));
319
-             $MinLeft = $Bounds[2]["X"];
316
+                $XPos    = $MinLeft-2;
317
+                $YPos    = $this->pChartObject->GraphAreaY1+($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1)/2;
318
+                $Bounds  = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE,"Angle"=>90));
319
+                $MinLeft = $Bounds[2]["X"];
320 320
 
321
-             $this->pDataObject->Data["GraphArea"]["X1"] = $MinLeft;
321
+                $this->pDataObject->Data["GraphArea"]["X1"] = $MinLeft;
322 322
             }
323 323
 
324
-           $AxisPos["L"] = $MinLeft - $ScaleSpacing;
325
-          }
326
-         elseif ( $AxisSettings["Position"] == AXIS_POSITION_RIGHT )
327
-          {
324
+            $AxisPos["L"] = $MinLeft - $ScaleSpacing;
325
+            }
326
+            elseif ( $AxisSettings["Position"] == AXIS_POSITION_RIGHT )
327
+            {
328 328
 
329
-           if ( $Floating )
329
+            if ( $Floating )
330 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
331
+            else
332 332
             { $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 333
 
334
-           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)); }
334
+            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)); }
335 335
 
336
-           $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
337
-           $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxLeft = $AxisPos["R"];
338
-           $LastY  = NULL;
339
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
336
+            $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
337
+            $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxLeft = $AxisPos["R"];
338
+            $LastY  = NULL;
339
+            for($i=0;$i<=$AxisSettings["Rows"];$i++)
340 340
             {
341
-             $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
342
-             $XPos  = $AxisPos["R"];
343
-             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
341
+                $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
342
+                $XPos  = $AxisPos["R"];
343
+                $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
344 344
 
345
-             if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
346
-             if ( $LastY != NULL && $CycleBackground  && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
345
+                if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
346
+                if ( $LastY != NULL && $CycleBackground  && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
347 347
 
348
-             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)); }
348
+                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 349
 
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));
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));
352 352
 
353
-             $this->pChartObject->drawLine($XPos-$InnerTickWidth,$YPos,$XPos+$OuterTickWidth,$YPos,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
354
-             $Bounds  = $this->pChartObject->drawText($XPos+$OuterTickWidth+2,$YPos,$Value,array("Align"=>TEXT_ALIGN_MIDDLELEFT));
355
-             $TxtLeft = $XPos+$OuterTickWidth+2+($Bounds[1]["X"]-$Bounds[0]["X"]);
356
-             $MaxLeft = max($MaxLeft,$TxtLeft);
353
+                $this->pChartObject->drawLine($XPos-$InnerTickWidth,$YPos,$XPos+$OuterTickWidth,$YPos,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
354
+                $Bounds  = $this->pChartObject->drawText($XPos+$OuterTickWidth+2,$YPos,$Value,array("Align"=>TEXT_ALIGN_MIDDLELEFT));
355
+                $TxtLeft = $XPos+$OuterTickWidth+2+($Bounds[1]["X"]-$Bounds[0]["X"]);
356
+                $MaxLeft = max($MaxLeft,$TxtLeft);
357 357
 
358
-             $LastY = $YPos;
358
+                $LastY = $YPos;
359 359
             }
360 360
 
361
-           if ( isset($AxisSettings["Name"]) )
361
+            if ( isset($AxisSettings["Name"]) )
362 362
             {
363
-             $XPos    = $MaxLeft+6;
364
-             $YPos    = $this->pChartObject->GraphAreaY1+($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1)/2;
365
-             $Bounds  = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE,"Angle"=>270));
366
-             $MaxLeft = $Bounds[2]["X"];
363
+                $XPos    = $MaxLeft+6;
364
+                $YPos    = $this->pChartObject->GraphAreaY1+($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1)/2;
365
+                $Bounds  = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE,"Angle"=>270));
366
+                $MaxLeft = $Bounds[2]["X"];
367 367
 
368
-             $this->pDataObject->Data["GraphArea"]["X2"] = $MaxLeft + $this->pChartObject->FontSize;
368
+                $this->pDataObject->Data["GraphArea"]["X2"] = $MaxLeft + $this->pChartObject->FontSize;
369 369
             }
370 370
 
371
-           $AxisPos["R"] = $MaxLeft + $ScaleSpacing;
372
-          }
371
+            $AxisPos["R"] = $MaxLeft + $ScaleSpacing;
372
+            }
373
+        }
373 374
         }
374
-      }
375 375
 
376
-     $this->pDataObject->saveAxisConfig($Data["Axis"]);
376
+        $this->pDataObject->saveAxisConfig($Data["Axis"]);
377 377
     }
378 378
 
379
-   /* Draw a scatter plot chart */
380
-   function drawScatterPlotChart($Format=NULL)
379
+    /* Draw a scatter plot chart */
380
+    function drawScatterPlotChart($Format=NULL)
381 381
     {
382
-     $PlotSize		= isset($Format["PlotSize"]) ? $Format["PlotSize"] : 3;
383
-     $PlotBorder	= isset($Format["PlotBorder"]) ? $Format["PlotBorder"] : FALSE;
384
-     $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 250;
385
-     $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 250;
386
-     $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 250;
387
-     $BorderAlpha	= isset($Format["BorderAlpha"]) ? $Format["BorderAlpha"] : 30;
388
-     $BorderSize	= isset($Format["BorderSize"]) ? $Format["BorderSize"] : 1;
389
-     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
390
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
391
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
392
-     $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
393
-
394
-     $Data    = $this->pDataObject->getData();
395
-     $Palette = $this->pDataObject->getPalette();
396
-
397
-     $BorderColor = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha);
398
-
399
-     foreach($Data["ScatterSeries"] as $Key => $Series)
400
-      {
401
-       if ( $Series["isDrawable"] == TRUE )
382
+        $PlotSize		= isset($Format["PlotSize"]) ? $Format["PlotSize"] : 3;
383
+        $PlotBorder	= isset($Format["PlotBorder"]) ? $Format["PlotBorder"] : FALSE;
384
+        $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 250;
385
+        $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 250;
386
+        $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 250;
387
+        $BorderAlpha	= isset($Format["BorderAlpha"]) ? $Format["BorderAlpha"] : 30;
388
+        $BorderSize	= isset($Format["BorderSize"]) ? $Format["BorderSize"] : 1;
389
+        $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
390
+        $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
391
+        $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
392
+        $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
393
+
394
+        $Data    = $this->pDataObject->getData();
395
+        $Palette = $this->pDataObject->getPalette();
396
+
397
+        $BorderColor = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha);
398
+
399
+        foreach($Data["ScatterSeries"] as $Key => $Series)
402 400
         {
403
-         $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
404
-         $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
401
+        if ( $Series["isDrawable"] == TRUE )
402
+        {
403
+            $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
404
+            $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
405 405
 
406
-         if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
406
+            if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
407 407
          
408
-         if ( isset($Series["Picture"]) && $Series["Picture"] != "" )
409
-          { $Picture = $Series["Picture"]; list($PicWidth,$PicHeight,$PicType) = $this->pChartObject->getPicInfo($Picture); }
410
-         else
411
-          { $Picture = NULL; }
408
+            if ( isset($Series["Picture"]) && $Series["Picture"] != "" )
409
+            { $Picture = $Series["Picture"]; list($PicWidth,$PicHeight,$PicType) = $this->pChartObject->getPicInfo($Picture); }
410
+            else
411
+            { $Picture = NULL; }
412 412
 
413
-         $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
414
-         if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
415
-         $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
416
-         if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
413
+            $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
414
+            if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
415
+            $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
416
+            if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
417 417
 
418
-         $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
418
+            $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
419 419
 
420
-         foreach($PosArrayX as $Key => $Value)
421
-          {
422
-           $X = $Value; $Y = $PosArrayY[$Key];
420
+            foreach($PosArrayX as $Key => $Value)
421
+            {
422
+            $X = $Value; $Y = $PosArrayY[$Key];
423 423
 
424
-           if ( $X != VOID && $Y != VOID )
424
+            if ( $X != VOID && $Y != VOID )
425 425
             {
426
-             $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
427
-             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
-
429
-             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 )
432
-              {
433
-               if ( $PlotBorder ) { $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize+$BorderSize,$BorderColor); }
434
-               $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize,$Color);
435
-              }
436
-             else
437
-              { $this->pChartObject->drawFromPicture($PicType,$Picture,$X-$PicWidth/2,$Y-$PicHeight/2); }
426
+                $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
427
+                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
+
429
+                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 )
432
+                {
433
+                if ( $PlotBorder ) { $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize+$BorderSize,$BorderColor); }
434
+                $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize,$Color);
435
+                }
436
+                else
437
+                { $this->pChartObject->drawFromPicture($PicType,$Picture,$X-$PicWidth/2,$Y-$PicHeight/2); }
438
+            }
438 439
             }
439
-          }
440 440
         }
441
-      }
441
+        }
442 442
     }
443 443
 
444
-   /* Draw a scatter line chart */
445
-   function drawScatterLineChart($Format=NULL)
444
+    /* Draw a scatter line chart */
445
+    function drawScatterLineChart($Format=NULL)
446 446
     {
447
-     $Data		= $this->pDataObject->getData();
448
-     $Palette		= $this->pDataObject->getPalette();
449
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
450
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
451
-     $ImageMapPlotSize	= isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
452
-     $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
453
-
454
-     /* Parse all the series to draw */
455
-     foreach($Data["ScatterSeries"] as $Key => $Series)
456
-      {
457
-       if ( $Series["isDrawable"] == TRUE )
447
+        $Data		= $this->pDataObject->getData();
448
+        $Palette		= $this->pDataObject->getPalette();
449
+        $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
450
+        $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
451
+        $ImageMapPlotSize	= isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
452
+        $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
453
+
454
+        /* Parse all the series to draw */
455
+        foreach($Data["ScatterSeries"] as $Key => $Series)
456
+        {
457
+        if ( $Series["isDrawable"] == TRUE )
458 458
         {
459
-         $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
460
-         $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
461
-         $Ticks  = $Series["Ticks"];
462
-         $Weight = $Series["Weight"];
459
+            $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
460
+            $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
461
+            $Ticks  = $Series["Ticks"];
462
+            $Weight = $Series["Weight"];
463 463
 
464
-         if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
464
+            if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
465 465
 
466
-         $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
467
-         if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
468
-         $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
469
-         if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
466
+            $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
467
+            if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
468
+            $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
469
+            if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
470 470
 
471
-         $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
472
-         if ( $Ticks != 0 )  { $Color["Ticks"]  = $Ticks; }
473
-         if ( $Weight != 0 ) { $Color["Weight"] = $Weight; }
471
+            $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
472
+            if ( $Ticks != 0 )  { $Color["Ticks"]  = $Ticks; }
473
+            if ( $Weight != 0 ) { $Color["Weight"] = $Weight; }
474 474
 
475
-         $LastX = VOID; $LastY = VOID;
476
-         foreach($PosArrayX as $Key => $Value)
477
-          {
478
-           $X = $Value; $Y = $PosArrayY[$Key];
475
+            $LastX = VOID; $LastY = VOID;
476
+            foreach($PosArrayX as $Key => $Value)
477
+            {
478
+            $X = $Value; $Y = $PosArrayY[$Key];
479 479
 
480
-           if ( $X != VOID && $Y != VOID )
480
+            if ( $X != VOID && $Y != VOID )
481 481
             {
482
-             $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
483
-             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); }
482
+                $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
483
+                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 484
             }
485 485
 
486
-           if ( $X != VOID && $Y != VOID && $LastX != VOID && $LastY != VOID)
486
+            if ( $X != VOID && $Y != VOID && $LastX != VOID && $LastY != VOID)
487 487
             $this->pChartObject->drawLine($LastX,$LastY,$X,$Y,$Color);
488 488
 
489
-           $LastX = $X; $LastY = $Y;
490
-          }
489
+            $LastX = $X; $LastY = $Y;
490
+            }
491
+        }
491 492
         }
492
-      }
493 493
     }
494 494
 
495
-   /* Draw a scatter spline chart */
496
-   function drawScatterSplineChart($Format=NULL)
495
+    /* Draw a scatter spline chart */
496
+    function drawScatterSplineChart($Format=NULL)
497 497
     {
498
-     $Data		= $this->pDataObject->getData();
499
-     $Palette		= $this->pDataObject->getPalette();
500
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
501
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
502
-     $ImageMapPlotSize	= isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
503
-     $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
504
-
505
-     foreach($Data["ScatterSeries"] as $Key => $Series)
506
-      {
507
-       if ( $Series["isDrawable"] == TRUE )
498
+        $Data		= $this->pDataObject->getData();
499
+        $Palette		= $this->pDataObject->getPalette();
500
+        $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
501
+        $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
502
+        $ImageMapPlotSize	= isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
503
+        $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
504
+
505
+        foreach($Data["ScatterSeries"] as $Key => $Series)
506
+        {
507
+        if ( $Series["isDrawable"] == TRUE )
508 508
         {
509
-         $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
510
-         $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
511
-         $Ticks  = $Series["Ticks"];
512
-         $Weight = $Series["Weight"];
509
+            $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
510
+            $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
511
+            $Ticks  = $Series["Ticks"];
512
+            $Weight = $Series["Weight"];
513 513
 
514
-         if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
514
+            if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
515 515
 
516
-         $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
517
-         if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
518
-         $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
519
-         if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
516
+            $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
517
+            if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
518
+            $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
519
+            if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
520 520
 
521
-         $SplineSettings = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
522
-         if ( $Ticks != 0 )  { $SplineSettings["Ticks"]  = $Ticks; }
523
-         if ( $Weight != 0 ) { $SplineSettings["Weight"] = $Weight; }
521
+            $SplineSettings = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
522
+            if ( $Ticks != 0 )  { $SplineSettings["Ticks"]  = $Ticks; }
523
+            if ( $Weight != 0 ) { $SplineSettings["Weight"] = $Weight; }
524 524
 
525
-         $LastX = VOID; $LastY = VOID; $WayPoints = ""; $Forces = "";
526
-         foreach($PosArrayX as $Key => $Value)
527
-          {
528
-           $X = $Value; $Y = $PosArrayY[$Key];
529
-           $Force = $this->pChartObject->getLength($LastX,$LastY,$X,$Y)/5;
525
+            $LastX = VOID; $LastY = VOID; $WayPoints = ""; $Forces = "";
526
+            foreach($PosArrayX as $Key => $Value)
527
+            {
528
+            $X = $Value; $Y = $PosArrayY[$Key];
529
+            $Force = $this->pChartObject->getLength($LastX,$LastY,$X,$Y)/5;
530 530
 
531
-           if ( $X != VOID && $Y != VOID )
531
+            if ( $X != VOID && $Y != VOID )
532 532
             {
533
-             $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
534
-             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); }
533
+                $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
534
+                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); }
535 535
             }
536 536
 
537
-           if ( $X != VOID && $Y != VOID )
537
+            if ( $X != VOID && $Y != VOID )
538 538
             { $WayPoints[] = array($X,$Y); $Forces[] = $Force; }
539 539
 
540
-           if ( $Y == VOID || $X == VOID )
540
+            if ( $Y == VOID || $X == VOID )
541 541
             { $SplineSettings["Forces"] = $Forces; $this->pChartObject->drawSpline($WayPoints,$SplineSettings); $WayPoints = ""; $Forces = "";}
542 542
 
543
-           $LastX = $X; $LastY = $Y;
544
-          }
545
-         $SplineSettings["Forces"] = $Forces; 
546
-         $this->pChartObject->drawSpline($WayPoints,$SplineSettings);
543
+            $LastX = $X; $LastY = $Y;
544
+            }
545
+            $SplineSettings["Forces"] = $Forces; 
546
+            $this->pChartObject->drawSpline($WayPoints,$SplineSettings);
547
+        }
547 548
         }
548
-      }
549 549
     }
550 550
 
551
-   /* Return the scaled plot position */
552
-   function getPosArray($Values,$AxisID)
551
+    /* Return the scaled plot position */
552
+    function getPosArray($Values,$AxisID)
553 553
     {
554
-     $Data = $this->pDataObject->getData();
554
+        $Data = $this->pDataObject->getData();
555 555
 
556
-     if ( !is_array($Values) ) { $Values = array($Values); }
556
+        if ( !is_array($Values) ) { $Values = array($Values); }
557 557
 
558
-     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
559
-      {
560
-       $Height      = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $Data["Axis"][$AxisID]["Margin"]*2;
561
-       $ScaleHeight = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"];
562
-       $Step        = $Height / $ScaleHeight;
558
+        if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
559
+        {
560
+        $Height      = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $Data["Axis"][$AxisID]["Margin"]*2;
561
+        $ScaleHeight = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"];
562
+        $Step        = $Height / $ScaleHeight;
563 563
 
564
-       $Result = "";
565
-       foreach($Values as $Key => $Value)
564
+        $Result = "";
565
+        foreach($Values as $Key => $Value)
566 566
         {
567
-         if ( $Value == VOID ) 
568
-          $Result[] = VOID;
569
-         else
570
-          $Result[] = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + ($Step * ($Value-$Data["Axis"][$AxisID]["ScaleMin"]));
567
+            if ( $Value == VOID ) 
568
+            $Result[] = VOID;
569
+            else
570
+            $Result[] = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + ($Step * ($Value-$Data["Axis"][$AxisID]["ScaleMin"]));
571 571
         }
572 572
 
573
-       if ( count($Result) == 1 ) { return($Result[0]); } else { return($Result); }
574
-      }
575
-     else
576
-      {
577
-       $Height      = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $Data["Axis"][$AxisID]["Margin"]*2;
578
-       $ScaleHeight = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"];
579
-       $Step        = $Height / $ScaleHeight;
573
+        if ( count($Result) == 1 ) { return($Result[0]); } else { return($Result); }
574
+        }
575
+        else
576
+        {
577
+        $Height      = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $Data["Axis"][$AxisID]["Margin"]*2;
578
+        $ScaleHeight = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"];
579
+        $Step        = $Height / $ScaleHeight;
580 580
 
581
-       $Result = "";
582
-       foreach($Values as $Key => $Value)
581
+        $Result = "";
582
+        foreach($Values as $Key => $Value)
583 583
         {
584
-         if ( $Value == VOID ) 
585
-          $Result[] = VOID;
586
-         else
587
-          $Result[] = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - ($Step * ($Value-$Data["Axis"][$AxisID]["ScaleMin"]));
584
+            if ( $Value == VOID ) 
585
+            $Result[] = VOID;
586
+            else
587
+            $Result[] = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - ($Step * ($Value-$Data["Axis"][$AxisID]["ScaleMin"]));
588 588
         }
589 589
 
590
-       if ( count($Result) == 1 ) { return($Result[0]); } else { return($Result); }
591
-      }
590
+        if ( count($Result) == 1 ) { return($Result[0]); } else { return($Result); }
591
+        }
592 592
     }
593 593
 
594
-   /* Draw the legend of the active series */
595
-   function drawScatterLegend($X,$Y,$Format="")
594
+    /* Draw the legend of the active series */
595
+    function drawScatterLegend($X,$Y,$Format="")
596 596
     {
597
-     $Family		= isset($Format["Family"]) ? $Format["Family"] : LEGEND_FAMILY_BOX;
598
-     $FontName		= isset($Format["FontName"]) ? $Format["FontName"] : $this->pChartObject->FontName;
599
-     $FontSize		= isset($Format["FontSize"]) ? $Format["FontSize"] : $this->pChartObject->FontSize;
600
-     $FontR		= isset($Format["FontR"]) ? $Format["FontR"] : $this->pChartObject->FontColorR;
601
-     $FontG		= isset($Format["FontG"]) ? $Format["FontG"] : $this->pChartObject->FontColorG;
602
-     $FontB		= isset($Format["FontB"]) ? $Format["FontB"] : $this->pChartObject->FontColorB;
603
-     $BoxWidth		= isset($Format["BoxWidth"]) ? $Format["BoxWidth"] : 5;
604
-     $BoxHeight		= isset($Format["BoxHeight"]) ? $Format["BoxHeight"] : 5;
605
-     $IconAreaWidth	= isset($Format["IconAreaWidth"]) ? $Format["IconAreaWidth"] : $BoxWidth;
606
-     $IconAreaHeight	= isset($Format["IconAreaHeight"]) ? $Format["IconAreaHeight"] : $BoxHeight;
607
-     $XSpacing		= isset($Format["XSpacing"]) ? $Format["XSpacing"] : 5;
608
-     $Margin		= isset($Format["Margin"]) ? $Format["Margin"] : 5;
609
-     $R			= isset($Format["R"]) ? $Format["R"] : 200;
610
-     $G			= isset($Format["G"]) ? $Format["G"] : 200;
611
-     $B			= isset($Format["B"]) ? $Format["B"] : 200;
612
-     $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : 100;
613
-     $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 255;
614
-     $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 255;
615
-     $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 255;
616
-     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
617
-     $Style		= isset($Format["Style"]) ? $Format["Style"] : LEGEND_ROUND;
618
-     $Mode		= isset($Format["Mode"]) ? $Format["Mode"] : LEGEND_VERTICAL;
619
-
620
-     if ( $Surrounding != NULL ) { $BorderR = $R + $Surrounding; $BorderG = $G + $Surrounding; $BorderB = $B + $Surrounding; }
621
-
622
-     $Data = $this->pDataObject->getData();
623
-
624
-     foreach($Data["ScatterSeries"] as $Key => $Series)
625
-      {
626
-       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
597
+        $Family		= isset($Format["Family"]) ? $Format["Family"] : LEGEND_FAMILY_BOX;
598
+        $FontName		= isset($Format["FontName"]) ? $Format["FontName"] : $this->pChartObject->FontName;
599
+        $FontSize		= isset($Format["FontSize"]) ? $Format["FontSize"] : $this->pChartObject->FontSize;
600
+        $FontR		= isset($Format["FontR"]) ? $Format["FontR"] : $this->pChartObject->FontColorR;
601
+        $FontG		= isset($Format["FontG"]) ? $Format["FontG"] : $this->pChartObject->FontColorG;
602
+        $FontB		= isset($Format["FontB"]) ? $Format["FontB"] : $this->pChartObject->FontColorB;
603
+        $BoxWidth		= isset($Format["BoxWidth"]) ? $Format["BoxWidth"] : 5;
604
+        $BoxHeight		= isset($Format["BoxHeight"]) ? $Format["BoxHeight"] : 5;
605
+        $IconAreaWidth	= isset($Format["IconAreaWidth"]) ? $Format["IconAreaWidth"] : $BoxWidth;
606
+        $IconAreaHeight	= isset($Format["IconAreaHeight"]) ? $Format["IconAreaHeight"] : $BoxHeight;
607
+        $XSpacing		= isset($Format["XSpacing"]) ? $Format["XSpacing"] : 5;
608
+        $Margin		= isset($Format["Margin"]) ? $Format["Margin"] : 5;
609
+        $R			= isset($Format["R"]) ? $Format["R"] : 200;
610
+        $G			= isset($Format["G"]) ? $Format["G"] : 200;
611
+        $B			= isset($Format["B"]) ? $Format["B"] : 200;
612
+        $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : 100;
613
+        $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 255;
614
+        $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 255;
615
+        $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 255;
616
+        $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
617
+        $Style		= isset($Format["Style"]) ? $Format["Style"] : LEGEND_ROUND;
618
+        $Mode		= isset($Format["Mode"]) ? $Format["Mode"] : LEGEND_VERTICAL;
619
+
620
+        if ( $Surrounding != NULL ) { $BorderR = $R + $Surrounding; $BorderG = $G + $Surrounding; $BorderB = $B + $Surrounding; }
621
+
622
+        $Data = $this->pDataObject->getData();
623
+
624
+        foreach($Data["ScatterSeries"] as $Key => $Series)
627 625
         {
628
-         list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
629
-         if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
630
-         if ( $IconAreaHeight < $PicHeight ) { $IconAreaHeight = $PicHeight; }
626
+        if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
627
+        {
628
+            list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
629
+            if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
630
+            if ( $IconAreaHeight < $PicHeight ) { $IconAreaHeight = $PicHeight; }
631
+        }
631 632
         }
632
-      }
633 633
 
634
-     $YStep = max($this->pChartObject->FontSize,$IconAreaHeight) + 5;
635
-     $XStep = $IconAreaWidth + 5;
636
-     $XStep = $XSpacing;
634
+        $YStep = max($this->pChartObject->FontSize,$IconAreaHeight) + 5;
635
+        $XStep = $IconAreaWidth + 5;
636
+        $XStep = $XSpacing;
637 637
 
638
-     $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
639
-     foreach($Data["ScatterSeries"] as $Key => $Series)
640
-      {
641
-       if ( $Series["isDrawable"] == TRUE )
638
+        $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
639
+        foreach($Data["ScatterSeries"] as $Key => $Series)
642 640
         {
643
-         if ( $Mode == LEGEND_VERTICAL )
644
-          {
645
-           $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+4,$vY+$IconAreaHeight/2,$FontName,$FontSize,0,$Series["Description"]);
646
-
647
-           if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
648
-           if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
649
-           if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
650
-
651
-           $Lines = preg_split("/\n/",$Series["Description"]);
652
-           $vY = $vY + max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
653
-          }
654
-         elseif ( $Mode == LEGEND_HORIZONTAL )
655
-          {
656
-           $Lines = preg_split("/\n/",$Series["Description"]);
657
-           $Width = "";
658
-           foreach($Lines as $Key => $Value)
641
+        if ( $Series["isDrawable"] == TRUE )
642
+        {
643
+            if ( $Mode == LEGEND_VERTICAL )
659 644
             {
660
-             $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+6,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$FontName,$FontSize,0,$Value);
645
+            $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+4,$vY+$IconAreaHeight/2,$FontName,$FontSize,0,$Series["Description"]);
661 646
 
662
-             if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
663
-             if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
664
-             if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
647
+            if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
648
+            if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
649
+            if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
665 650
 
666
-             $Width[] = $BoxArray[1]["X"];
651
+            $Lines = preg_split("/\n/",$Series["Description"]);
652
+            $vY = $vY + max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
667 653
             }
654
+            elseif ( $Mode == LEGEND_HORIZONTAL )
655
+            {
656
+            $Lines = preg_split("/\n/",$Series["Description"]);
657
+            $Width = "";
658
+            foreach($Lines as $Key => $Value)
659
+            {
660
+                $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+6,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$FontName,$FontSize,0,$Value);
661
+
662
+                if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
663
+                if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
664
+                if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
668 665
 
669
-           $vX=max($Width)+$XStep;
670
-          }
666
+                $Width[] = $BoxArray[1]["X"];
667
+            }
668
+
669
+            $vX=max($Width)+$XStep;
670
+            }
671
+        }
671 672
         }
672
-      }
673
-     $vY=$vY-$YStep; $vX=$vX-$XStep;
673
+        $vY=$vY-$YStep; $vX=$vX-$XStep;
674 674
 
675
-     $TopOffset  = $Y - $Boundaries["T"];
676
-     if ( $Boundaries["B"]-($vY+$IconAreaHeight) < $TopOffset ) { $Boundaries["B"] = $vY+$IconAreaHeight+$TopOffset; }
675
+        $TopOffset  = $Y - $Boundaries["T"];
676
+        if ( $Boundaries["B"]-($vY+$IconAreaHeight) < $TopOffset ) { $Boundaries["B"] = $vY+$IconAreaHeight+$TopOffset; }
677 677
 
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));
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));
682 682
 
683
-     $RestoreShadow = $this->pChartObject->Shadow; $this->Shadow = FALSE;
684
-     foreach($Data["ScatterSeries"] as $Key => $Series)
685
-      {
686
-       if ( $Series["isDrawable"] == TRUE )
683
+        $RestoreShadow = $this->pChartObject->Shadow; $this->Shadow = FALSE;
684
+        foreach($Data["ScatterSeries"] as $Key => $Series)
687 685
         {
688
-         $R = $Series["Color"]["R"]; $G = $Series["Color"]["G"]; $B = $Series["Color"]["B"];
689
-         $Ticks = $Series["Ticks"]; $Weight = $Series["Weight"];
690
-
691
-         if ( isset($Series["Picture"]) )
692
-          {
693
-           $Picture = $Series["Picture"];
694
-           list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Picture);
695
-           $PicX = $X+$IconAreaWidth/2; $PicY = $Y+$IconAreaHeight/2; 
696
-
697
-           $this->pChartObject->drawFromPNG($PicX-$PicWidth/2,$PicY-$PicHeight/2,$Picture);
698
-          }
699
-         else
700
-          {
701
-           if ( $Family == LEGEND_FAMILY_BOX )
686
+        if ( $Series["isDrawable"] == TRUE )
687
+        {
688
+            $R = $Series["Color"]["R"]; $G = $Series["Color"]["G"]; $B = $Series["Color"]["B"];
689
+            $Ticks = $Series["Ticks"]; $Weight = $Series["Weight"];
690
+
691
+            if ( isset($Series["Picture"]) )
702 692
             {
703
-             if ( $BoxWidth != $IconAreaWidth ) { $XOffset = floor(($IconAreaWidth-$BoxWidth)/2); } else { $XOffset = 0; }
704
-             if ( $BoxHeight != $IconAreaHeight ) { $YOffset = floor(($IconAreaHeight-$BoxHeight)/2); } else { $YOffset = 0; }
693
+            $Picture = $Series["Picture"];
694
+            list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Picture);
695
+            $PicX = $X+$IconAreaWidth/2; $PicY = $Y+$IconAreaHeight/2; 
705 696
 
706
-             $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
-             $this->pChartObject->drawFilledRectangle($X+$XOffset,$Y+$YOffset,$X+$BoxWidth+$XOffset,$Y+$BoxHeight+$YOffset,array("R"=>$R,"G"=>$G,"B"=>$B,"Surrounding"=>20));
697
+            $this->pChartObject->drawFromPNG($PicX-$PicWidth/2,$PicY-$PicHeight/2,$Picture);
708 698
             }
709
-           elseif ( $Family == LEGEND_FAMILY_CIRCLE )
699
+            else
700
+            {
701
+            if ( $Family == LEGEND_FAMILY_BOX )
710 702
             {
711
-             $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
-             $this->pChartObject->drawFilledCircle($X+$IconAreaWidth/2,$Y+$IconAreaHeight/2,min($IconAreaHeight/2,$IconAreaWidth/2),array("R"=>$R,"G"=>$G,"B"=>$B,"Surrounding"=>20));
703
+                if ( $BoxWidth != $IconAreaWidth ) { $XOffset = floor(($IconAreaWidth-$BoxWidth)/2); } else { $XOffset = 0; }
704
+                if ( $BoxHeight != $IconAreaHeight ) { $YOffset = floor(($IconAreaHeight-$BoxHeight)/2); } else { $YOffset = 0; }
705
+
706
+                $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
+                $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 )
710
+            {
711
+                $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
+                $this->pChartObject->drawFilledCircle($X+$IconAreaWidth/2,$Y+$IconAreaHeight/2,min($IconAreaHeight/2,$IconAreaWidth/2),array("R"=>$R,"G"=>$G,"B"=>$B,"Surrounding"=>20));
713 713
             }
714
-           elseif ( $Family == LEGEND_FAMILY_LINE )
714
+            elseif ( $Family == LEGEND_FAMILY_LINE )
715 715
             {
716
-             $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
-             $this->pChartObject->drawLine($X,$Y+$IconAreaHeight/2,$X+$IconAreaWidth,$Y+$IconAreaHeight/2,array("R"=>$R,"G"=>$G,"B"=>$B,"Ticks"=>$Ticks,"Weight"=>$Weight));
716
+                $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
+                $this->pChartObject->drawLine($X,$Y+$IconAreaHeight/2,$X+$IconAreaWidth,$Y+$IconAreaHeight/2,array("R"=>$R,"G"=>$G,"B"=>$B,"Ticks"=>$Ticks,"Weight"=>$Weight));
718
+            }
718 719
             }
719
-          }
720 720
 
721
-         if ( $Mode == LEGEND_VERTICAL )
722
-          {
723
-           $Lines = preg_split("/\n/",$Series["Description"]);
724
-           foreach($Lines as $Key => $Value)
721
+            if ( $Mode == LEGEND_VERTICAL )
722
+            {
723
+            $Lines = preg_split("/\n/",$Series["Description"]);
724
+            foreach($Lines as $Key => $Value)
725 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));
726 726
 
727
-           $Y=$Y+max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
728
-          }
729
-         elseif ( $Mode == LEGEND_HORIZONTAL )
730
-          {
731
-           $Lines = preg_split("/\n/",$Series["Description"]);
732
-           $Width = "";
733
-           foreach($Lines as $Key => $Value)
727
+            $Y=$Y+max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
728
+            }
729
+            elseif ( $Mode == LEGEND_HORIZONTAL )
730
+            {
731
+            $Lines = preg_split("/\n/",$Series["Description"]);
732
+            $Width = "";
733
+            foreach($Lines as $Key => $Value)
734 734
             {
735
-             $BoxArray = $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));
736
-             $Width[] = $BoxArray[1]["X"];
735
+                $BoxArray = $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));
736
+                $Width[] = $BoxArray[1]["X"];
737 737
             }
738
-           $X=max($Width)+2+$XStep;
739
-          }
738
+            $X=max($Width)+2+$XStep;
739
+            }
740
+        }
740 741
         }
741
-      }
742 742
 
743
-     $this->Shadow = $RestoreShadow;
743
+        $this->Shadow = $RestoreShadow;
744 744
     }
745 745
 
746
-   /* Get the legend box size */
747
-   function getScatterLegendSize($Format="")
746
+    /* Get the legend box size */
747
+    function getScatterLegendSize($Format="")
748 748
     {
749
-     $FontName	= isset($Format["FontName"]) ? $Format["FontName"] : $this->pChartObject->FontName;
750
-     $FontSize	= isset($Format["FontSize"]) ? $Format["FontSize"] : $this->pChartObject->FontSize;
751
-     $BoxSize	= isset($Format["BoxSize"]) ? $Format["BoxSize"] : 5;
752
-     $Margin	= isset($Format["Margin"]) ? $Format["Margin"] : 5;
753
-     $Style	= isset($Format["Style"]) ? $Format["Style"] : LEGEND_ROUND;
754
-     $Mode	= isset($Format["Mode"]) ? $Format["Mode"] : LEGEND_VERTICAL;
749
+        $FontName	= isset($Format["FontName"]) ? $Format["FontName"] : $this->pChartObject->FontName;
750
+        $FontSize	= isset($Format["FontSize"]) ? $Format["FontSize"] : $this->pChartObject->FontSize;
751
+        $BoxSize	= isset($Format["BoxSize"]) ? $Format["BoxSize"] : 5;
752
+        $Margin	= isset($Format["Margin"]) ? $Format["Margin"] : 5;
753
+        $Style	= isset($Format["Style"]) ? $Format["Style"] : LEGEND_ROUND;
754
+        $Mode	= isset($Format["Mode"]) ? $Format["Mode"] : LEGEND_VERTICAL;
755 755
 
756
-     $YStep = max($this->pChartObject->FontSize,$BoxSize) + 5;
757
-     $XStep = $BoxSize + 5;
756
+        $YStep = max($this->pChartObject->FontSize,$BoxSize) + 5;
757
+        $XStep = $BoxSize + 5;
758 758
 
759
-     $X=100; $Y=100;
759
+        $X=100; $Y=100;
760 760
 
761
-     $Data = $this->pDataObject->getData();
761
+        $Data = $this->pDataObject->getData();
762 762
 
763
-     foreach($Data["ScatterSeries"] as $Key => $Series)
764
-      {
765
-       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
763
+        foreach($Data["ScatterSeries"] as $Key => $Series)
764
+        {
765
+        if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
766 766
         {
767
-         list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
768
-         if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
769
-         if ( $IconAreaHeight < $PicHeight ) { $IconAreaHeight = $PicHeight; }
767
+            list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
768
+            if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
769
+            if ( $IconAreaHeight < $PicHeight ) { $IconAreaHeight = $PicHeight; }
770
+        }
770 771
         }
771
-      }
772 772
 
773
-     $YStep = max($this->pChartObject->FontSize,$IconAreaHeight) + 5;
774
-     $XStep = $IconAreaWidth + 5;
775
-     $XStep = $XSpacing;
773
+        $YStep = max($this->pChartObject->FontSize,$IconAreaHeight) + 5;
774
+        $XStep = $IconAreaWidth + 5;
775
+        $XStep = $XSpacing;
776 776
 
777
-     $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
778
-     foreach($Data["ScatterSeries"] as $Key => $Series)
779
-      {
780
-       if ( $Series["isDrawable"] == TRUE )
777
+        $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
778
+        foreach($Data["ScatterSeries"] as $Key => $Series)
779
+        {
780
+        if ( $Series["isDrawable"] == TRUE )
781 781
         {
782
-         if ( $Mode == LEGEND_VERTICAL )
783
-          {
784
-           $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+4,$vY+$IconAreaHeight/2,$FontName,$FontSize,0,$Series["Description"]);
785
-
786
-           if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
787
-           if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
788
-           if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
789
-
790
-           $Lines = preg_split("/\n/",$Series["Description"]);
791
-           $vY = $vY + max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
792
-          }
793
-         elseif ( $Mode == LEGEND_HORIZONTAL )
794
-          {
795
-           $Lines = preg_split("/\n/",$Series["Description"]);
796
-           $Width = "";
797
-           foreach($Lines as $Key => $Value)
782
+            if ( $Mode == LEGEND_VERTICAL )
783
+            {
784
+            $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+4,$vY+$IconAreaHeight/2,$FontName,$FontSize,0,$Series["Description"]);
785
+
786
+            if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
787
+            if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
788
+            if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
789
+
790
+            $Lines = preg_split("/\n/",$Series["Description"]);
791
+            $vY = $vY + max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
792
+            }
793
+            elseif ( $Mode == LEGEND_HORIZONTAL )
794
+            {
795
+            $Lines = preg_split("/\n/",$Series["Description"]);
796
+            $Width = "";
797
+            foreach($Lines as $Key => $Value)
798 798
             {
799
-             $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+6,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$FontName,$FontSize,0,$Value);
799
+                $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+6,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$FontName,$FontSize,0,$Value);
800 800
 
801
-             if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
802
-             if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
803
-             if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
801
+                if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
802
+                if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
803
+                if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
804 804
 
805
-             $Width[] = $BoxArray[1]["X"];
805
+                $Width[] = $BoxArray[1]["X"];
806 806
             }
807 807
 
808
-           $vX=max($Width)+$XStep;
809
-          }
808
+            $vX=max($Width)+$XStep;
809
+            }
810
+        }
810 811
         }
811
-      }
812
-     $vY=$vY-$YStep; $vX=$vX-$XStep;
812
+        $vY=$vY-$YStep; $vX=$vX-$XStep;
813 813
 
814
-     $TopOffset  = $Y - $Boundaries["T"];
815
-     if ( $Boundaries["B"]-($vY+$BoxSize) < $TopOffset ) { $Boundaries["B"] = $vY+$BoxSize+$TopOffset; }
814
+        $TopOffset  = $Y - $Boundaries["T"];
815
+        if ( $Boundaries["B"]-($vY+$BoxSize) < $TopOffset ) { $Boundaries["B"] = $vY+$BoxSize+$TopOffset; }
816 816
 
817
-     $Width  = ($Boundaries["R"]+$Margin) - ($Boundaries["L"]-$Margin);
818
-     $Height = ($Boundaries["B"]+$Margin) - ($Boundaries["T"]-$Margin);
817
+        $Width  = ($Boundaries["R"]+$Margin) - ($Boundaries["L"]-$Margin);
818
+        $Height = ($Boundaries["B"]+$Margin) - ($Boundaries["T"]-$Margin);
819 819
 
820
-     return(array("Width"=>$Width,"Height"=>$Height));
820
+        return(array("Width"=>$Width,"Height"=>$Height));
821 821
     }
822 822
 
823
-   /* Draw the line of best fit */
824
-   function drawScatterBestFit($Format="")
823
+    /* Draw the line of best fit */
824
+    function drawScatterBestFit($Format="")
825 825
     {
826
-     $Ticks	= isset($Format["Ticks"]) ? $Format["Ticks"] : 0;
826
+        $Ticks	= isset($Format["Ticks"]) ? $Format["Ticks"] : 0;
827 827
 
828
-     $Data    = $this->pDataObject->getData();
828
+        $Data    = $this->pDataObject->getData();
829 829
 
830
-     foreach($Data["ScatterSeries"] as $Key => $Series)
831
-      {
832
-       if ( $Series["isDrawable"] == TRUE )
830
+        foreach($Data["ScatterSeries"] as $Key => $Series)
831
+        {
832
+        if ( $Series["isDrawable"] == TRUE )
833 833
         {
834
-         $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
835
-         $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
836
-
837
-         $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
838
-         $Color["Ticks"] = $Ticks;
839
-
840
-         $PosArrayX = $Data["Series"][$Series["X"]]["Data"];
841
-         $PosArrayY = $Data["Series"][$Series["Y"]]["Data"];
842
-
843
-         $Sxy = 0; $Sx = 0; $Sy = 0; $Sxx = 0;
844
-         foreach($PosArrayX as $Key => $Value)
845
-          {
846
-           $X = $Value; $Y = $PosArrayY[$Key];
847
-
848
-           $Sxy = $Sxy + $X*$Y;
849
-           $Sx  = $Sx + $X;
850
-           $Sy  = $Sy + $Y;
851
-           $Sxx = $Sxx + $X*$X;
852
-          }
853
-
854
-         $n = count($PosArrayX);
855
-
856
-         if ((($n*$Sxx) == ($Sx*$Sx)))
857
-          {
858
-           $X1 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMin"],$SerieXAxis);
859
-           $X2 = $X1;
860
-           $Y1 = $this->pChartObject->GraphAreaY1;
861
-           $Y2 = $this->pChartObject->GraphAreaY2;
862
-          }
863
-         else
864
-          {
865
-           $M = (($n*$Sxy)-($Sx*$Sy)) / (($n*$Sxx)-($Sx*$Sx));
866
-           $B = (($Sy)-($M*$Sx))/($n);
867
-
868
-           $X1 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMin"],$SerieXAxis);
869
-           $Y1 = $this->getPosArray($M * $Data["Axis"][$SerieXAxis]["ScaleMin"] + $B,$SerieYAxis);
870
-           $X2 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMax"],$SerieXAxis);
871
-           $Y2 = $this->getPosArray($M * $Data["Axis"][$SerieXAxis]["ScaleMax"] + $B,$SerieYAxis);
872
-
873
-           $RealM = -($Y2-$Y1)/($X2-$X1);
874
-
875
-           if ( $Y1 < $this->pChartObject->GraphAreaY1 ) { $X1 = $X1 + ($this->pChartObject->GraphAreaY1-$Y1/$RealM); $Y1 = $this->pChartObject->GraphAreaY1; }
876
-           if ( $Y1 > $this->pChartObject->GraphAreaY2 ) { $X1 = $X1 + ($Y1-$this->pChartObject->GraphAreaY2)/$RealM; $Y1 = $this->pChartObject->GraphAreaY2; }
877
-           if ( $Y2 < $this->pChartObject->GraphAreaY1 ) { $X2 = $X2 - ($this->pChartObject->GraphAreaY1-$Y2)/$RealM; $Y2 = $this->pChartObject->GraphAreaY1; }
878
-           if ( $Y2 > $this->pChartObject->GraphAreaY2 ) { $X2 = $X2 - ($Y2-$this->pChartObject->GraphAreaY2)/$RealM; $Y2 = $this->pChartObject->GraphAreaY2; }
879
-          }
880
-
881
-         $this->pChartObject->drawLine($X1,$Y1,$X2,$Y2,$Color);
834
+            $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
835
+            $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
836
+
837
+            $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
838
+            $Color["Ticks"] = $Ticks;
839
+
840
+            $PosArrayX = $Data["Series"][$Series["X"]]["Data"];
841
+            $PosArrayY = $Data["Series"][$Series["Y"]]["Data"];
842
+
843
+            $Sxy = 0; $Sx = 0; $Sy = 0; $Sxx = 0;
844
+            foreach($PosArrayX as $Key => $Value)
845
+            {
846
+            $X = $Value; $Y = $PosArrayY[$Key];
847
+
848
+            $Sxy = $Sxy + $X*$Y;
849
+            $Sx  = $Sx + $X;
850
+            $Sy  = $Sy + $Y;
851
+            $Sxx = $Sxx + $X*$X;
852
+            }
853
+
854
+            $n = count($PosArrayX);
855
+
856
+            if ((($n*$Sxx) == ($Sx*$Sx)))
857
+            {
858
+            $X1 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMin"],$SerieXAxis);
859
+            $X2 = $X1;
860
+            $Y1 = $this->pChartObject->GraphAreaY1;
861
+            $Y2 = $this->pChartObject->GraphAreaY2;
862
+            }
863
+            else
864
+            {
865
+            $M = (($n*$Sxy)-($Sx*$Sy)) / (($n*$Sxx)-($Sx*$Sx));
866
+            $B = (($Sy)-($M*$Sx))/($n);
867
+
868
+            $X1 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMin"],$SerieXAxis);
869
+            $Y1 = $this->getPosArray($M * $Data["Axis"][$SerieXAxis]["ScaleMin"] + $B,$SerieYAxis);
870
+            $X2 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMax"],$SerieXAxis);
871
+            $Y2 = $this->getPosArray($M * $Data["Axis"][$SerieXAxis]["ScaleMax"] + $B,$SerieYAxis);
872
+
873
+            $RealM = -($Y2-$Y1)/($X2-$X1);
874
+
875
+            if ( $Y1 < $this->pChartObject->GraphAreaY1 ) { $X1 = $X1 + ($this->pChartObject->GraphAreaY1-$Y1/$RealM); $Y1 = $this->pChartObject->GraphAreaY1; }
876
+            if ( $Y1 > $this->pChartObject->GraphAreaY2 ) { $X1 = $X1 + ($Y1-$this->pChartObject->GraphAreaY2)/$RealM; $Y1 = $this->pChartObject->GraphAreaY2; }
877
+            if ( $Y2 < $this->pChartObject->GraphAreaY1 ) { $X2 = $X2 - ($this->pChartObject->GraphAreaY1-$Y2)/$RealM; $Y2 = $this->pChartObject->GraphAreaY1; }
878
+            if ( $Y2 > $this->pChartObject->GraphAreaY2 ) { $X2 = $X2 - ($Y2-$this->pChartObject->GraphAreaY2)/$RealM; $Y2 = $this->pChartObject->GraphAreaY2; }
879
+            }
880
+
881
+            $this->pChartObject->drawLine($X1,$Y1,$X2,$Y2,$Color);
882
+        }
882 883
         }
883
-      }
884 884
     }
885 885
 
886
-   function writeScatterLabel($ScatterSerieID,$Points,$Format="")
886
+    function writeScatterLabel($ScatterSerieID,$Points,$Format="")
887 887
     {
888
-     $OverrideTitle	= isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : NULL;
889
-     $DrawPoint		= isset($Format["DrawPoint"]) ? $Format["DrawPoint"] : LABEL_POINT_BOX;
890
-     $Decimals		= isset($Format["Decimals"]) ? $Format["Decimals"] : NULL;
888
+        $OverrideTitle	= isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : NULL;
889
+        $DrawPoint		= isset($Format["DrawPoint"]) ? $Format["DrawPoint"] : LABEL_POINT_BOX;
890
+        $Decimals		= isset($Format["Decimals"]) ? $Format["Decimals"] : NULL;
891 891
 
892
-     $Data    = $this->pDataObject->getData();
893
-     $Palette = $this->pDataObject->getPalette();
892
+        $Data    = $this->pDataObject->getData();
893
+        $Palette = $this->pDataObject->getPalette();
894 894
 
895
-     if ( !is_array($Points) ) { $Point = $Points; $Points = ""; $Points[0] = $Point; }
895
+        if ( !is_array($Points) ) { $Point = $Points; $Points = ""; $Points[0] = $Point; }
896 896
 
897
-     if ( !isset($Data["ScatterSeries"][$ScatterSerieID]) ) 
898
-      return(0);
897
+        if ( !isset($Data["ScatterSeries"][$ScatterSerieID]) ) 
898
+        return(0);
899 899
 
900
-     $Series = $Data["ScatterSeries"][$ScatterSerieID];
901
-     $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
902
-     $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
900
+        $Series = $Data["ScatterSeries"][$ScatterSerieID];
901
+        $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
902
+        $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
903 903
 
904
-     $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
905
-     if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
906
-     $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
907
-     if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
904
+        $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
905
+        if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
906
+        $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
907
+        if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
908 908
 
909
-     foreach($Points as $Key => $Point)
910
-      {
911
-       if ( isset($PosArrayX[$Point]) && isset($PosArrayY[$Point]) )
909
+        foreach($Points as $Key => $Point)
910
+        {
911
+        if ( isset($PosArrayX[$Point]) && isset($PosArrayY[$Point]) )
912 912
         {
913
-         $X = floor($PosArrayX[$Point]);
914
-         $Y = floor($PosArrayY[$Point]);
915
-
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));
920
-
921
-         $Serie = "";
922
-         $Serie["R"] = $Series["Color"]["R"];
923
-         $Serie["G"] = $Series["Color"]["G"];
924
-         $Serie["B"] = $Series["Color"]["B"];
925
-         $Serie["Alpha"] = $Series["Color"]["Alpha"];
926
-
927
-         $XAxisMode   = $Data["Axis"][$SerieXAxis]["Display"];
928
-         $XAxisFormat = $Data["Axis"][$SerieXAxis]["Format"];
929
-         $XAxisUnit   = $Data["Axis"][$SerieXAxis]["Unit"];
930
-         if ( $Decimals == NULL ) { $XValue = $SerieValuesX[$Point]; } else { $XValue = round($SerieValuesX[$Point],$Decimals); }
931
-         $XValue      = $this->pChartObject->scaleFormat($XValue,$XAxisMode,$XAxisFormat,$XAxisUnit);
932
-
933
-         $YAxisMode   = $Data["Axis"][$SerieYAxis]["Display"];
934
-         $YAxisFormat = $Data["Axis"][$SerieYAxis]["Format"];
935
-         $YAxisUnit   = $Data["Axis"][$SerieYAxis]["Unit"];
936
-         if ( $Decimals == NULL ) { $YValue = $SerieValuesY[$Point]; } else { $YValue = round($SerieValuesY[$Point],$Decimals); }
937
-         $YValue      = $this->pChartObject->scaleFormat($YValue,$YAxisMode,$YAxisFormat,$YAxisUnit);
938
-
939
-         $Caption = $XValue." / ".$YValue;
940
-
941
-         if ( isset($Series["Description"]) )
942
-          $Description = $Series["Description"];
943
-         else
944
-          $Description = "No description";
945
-
946
-         $Series = "";
947
-         $Series[] = array("Format"=>$Serie,"Caption"=>$Caption);
948
-
949
-         $this->pChartObject->drawLabelBox($X,$Y-3,$Description,$Series,$Format);
913
+            $X = floor($PosArrayX[$Point]);
914
+            $Y = floor($PosArrayY[$Point]);
915
+
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));
920
+
921
+            $Serie = "";
922
+            $Serie["R"] = $Series["Color"]["R"];
923
+            $Serie["G"] = $Series["Color"]["G"];
924
+            $Serie["B"] = $Series["Color"]["B"];
925
+            $Serie["Alpha"] = $Series["Color"]["Alpha"];
926
+
927
+            $XAxisMode   = $Data["Axis"][$SerieXAxis]["Display"];
928
+            $XAxisFormat = $Data["Axis"][$SerieXAxis]["Format"];
929
+            $XAxisUnit   = $Data["Axis"][$SerieXAxis]["Unit"];
930
+            if ( $Decimals == NULL ) { $XValue = $SerieValuesX[$Point]; } else { $XValue = round($SerieValuesX[$Point],$Decimals); }
931
+            $XValue      = $this->pChartObject->scaleFormat($XValue,$XAxisMode,$XAxisFormat,$XAxisUnit);
932
+
933
+            $YAxisMode   = $Data["Axis"][$SerieYAxis]["Display"];
934
+            $YAxisFormat = $Data["Axis"][$SerieYAxis]["Format"];
935
+            $YAxisUnit   = $Data["Axis"][$SerieYAxis]["Unit"];
936
+            if ( $Decimals == NULL ) { $YValue = $SerieValuesY[$Point]; } else { $YValue = round($SerieValuesY[$Point],$Decimals); }
937
+            $YValue      = $this->pChartObject->scaleFormat($YValue,$YAxisMode,$YAxisFormat,$YAxisUnit);
938
+
939
+            $Caption = $XValue." / ".$YValue;
940
+
941
+            if ( isset($Series["Description"]) )
942
+            $Description = $Series["Description"];
943
+            else
944
+            $Description = "No description";
945
+
946
+            $Series = "";
947
+            $Series[] = array("Format"=>$Serie,"Caption"=>$Caption);
948
+
949
+            $this->pChartObject->drawLabelBox($X,$Y-3,$Description,$Series,$Format);
950
+        }
950 951
         }
951
-      }
952 952
     }
953 953
 
954
-   /* Draw a Scatter threshold */
955
-   function drawScatterThreshold($Value,$Format="")
954
+    /* Draw a Scatter threshold */
955
+    function drawScatterThreshold($Value,$Format="")
956 956
     {
957
-     $AxisID		= isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
958
-     $R			= isset($Format["R"]) ? $Format["R"] : 255;
959
-     $G			= isset($Format["G"]) ? $Format["G"] : 0;
960
-     $B			= isset($Format["B"]) ? $Format["B"] : 0;
961
-     $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : 50;
962
-     $Weight		= isset($Format["Weight"]) ? $Format["Weight"] : NULL;
963
-     $Ticks		= isset($Format["Ticks"]) ? $Format["Ticks"] : 3;
964
-     $Wide		= isset($Format["Wide"]) ? $Format["Wide"] : FALSE;
965
-     $WideFactor	= isset($Format["WideFactor"]) ? $Format["WideFactor"] : 5;
966
-     $WriteCaption	= isset($Format["WriteCaption"]) ? $Format["WriteCaption"] : FALSE;
967
-     $Caption		= isset($Format["Caption"]) ? $Format["Caption"] : NULL;
968
-     $CaptionAlign	= isset($Format["CaptionAlign"]) ? $Format["CaptionAlign"] : CAPTION_LEFT_TOP;
969
-     $CaptionOffset     = isset($Format["CaptionOffset"]) ? $Format["CaptionOffset"] : 10;
970
-     $CaptionR		= isset($Format["CaptionR"]) ? $Format["CaptionR"] : 255;
971
-     $CaptionG		= isset($Format["CaptionG"]) ? $Format["CaptionG"] : 255;
972
-     $CaptionB		= isset($Format["CaptionB"]) ? $Format["CaptionB"] : 255;
973
-     $CaptionAlpha	= isset($Format["CaptionAlpha"]) ? $Format["CaptionAlpha"] : 100;
974
-     $DrawBox		= isset($Format["DrawBox"]) ? $Format["DrawBox"] : TRUE;
975
-     $DrawBoxBorder	= isset($Format["DrawBoxBorder"]) ? $Format["DrawBoxBorder"] : FALSE;
976
-     $BorderOffset	= isset($Format["BorderOffset"]) ? $Format["BorderOffset"] : 5;
977
-     $BoxRounded	= isset($Format["BoxRounded"]) ? $Format["BoxRounded"] : TRUE;
978
-     $RoundedRadius	= isset($Format["RoundedRadius"]) ? $Format["RoundedRadius"] : 3;
979
-     $BoxR		= isset($Format["BoxR"]) ? $Format["BoxR"] : 0;
980
-     $BoxG		= isset($Format["BoxG"]) ? $Format["BoxG"] : 0;
981
-     $BoxB		= isset($Format["BoxB"]) ? $Format["BoxB"] : 0;
982
-     $BoxAlpha		= isset($Format["BoxAlpha"]) ? $Format["BoxAlpha"] : 20;
983
-     $BoxSurrounding	= isset($Format["BoxSurrounding"]) ? $Format["BoxSurrounding"] : "";
984
-     $BoxBorderR	= isset($Format["BoxBorderR"]) ? $Format["BoxBorderR"] : 255;
985
-     $BoxBorderG	= isset($Format["BoxBorderG"]) ? $Format["BoxBorderG"] : 255;
986
-     $BoxBorderB	= isset($Format["BoxBorderB"]) ? $Format["BoxBorderB"] : 255;
987
-     $BoxBorderAlpha	= isset($Format["BoxBorderAlpha"]) ? $Format["BoxBorderAlpha"] : 100;
988
-
989
-     $CaptionSettings = array("DrawBox"=>$DrawBox,"DrawBoxBorder"=>$DrawBoxBorder,"BorderOffset"=>$BorderOffset,"BoxRounded"=>$BoxRounded,"RoundedRadius"=>$RoundedRadius,
990
-                              "BoxR"=>$BoxR,"BoxG"=>$BoxG,"BoxB"=>$BoxB,"BoxAlpha"=>$BoxAlpha,"BoxSurrounding"=>$BoxSurrounding,
991
-                              "BoxBorderR"=>$BoxBorderR,"BoxBorderG"=>$BoxBorderG,"BoxBorderB"=>$BoxBorderB,"BoxBorderAlpha"=>$BoxBorderAlpha,
992
-                              "R"=>$CaptionR,"G"=>$CaptionG,"B"=>$CaptionB,"Alpha"=>$CaptionAlpha);
993
-
994
-     if ( $Caption == NULL ) { $Caption = $Value; }
995
-
996
-     $Data = $this->pDataObject->getData();
997
-
998
-     if ( !isset($Data["Axis"][$AxisID]) ) { return(-1); }
957
+        $AxisID		= isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
958
+        $R			= isset($Format["R"]) ? $Format["R"] : 255;
959
+        $G			= isset($Format["G"]) ? $Format["G"] : 0;
960
+        $B			= isset($Format["B"]) ? $Format["B"] : 0;
961
+        $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : 50;
962
+        $Weight		= isset($Format["Weight"]) ? $Format["Weight"] : NULL;
963
+        $Ticks		= isset($Format["Ticks"]) ? $Format["Ticks"] : 3;
964
+        $Wide		= isset($Format["Wide"]) ? $Format["Wide"] : FALSE;
965
+        $WideFactor	= isset($Format["WideFactor"]) ? $Format["WideFactor"] : 5;
966
+        $WriteCaption	= isset($Format["WriteCaption"]) ? $Format["WriteCaption"] : FALSE;
967
+        $Caption		= isset($Format["Caption"]) ? $Format["Caption"] : NULL;
968
+        $CaptionAlign	= isset($Format["CaptionAlign"]) ? $Format["CaptionAlign"] : CAPTION_LEFT_TOP;
969
+        $CaptionOffset     = isset($Format["CaptionOffset"]) ? $Format["CaptionOffset"] : 10;
970
+        $CaptionR		= isset($Format["CaptionR"]) ? $Format["CaptionR"] : 255;
971
+        $CaptionG		= isset($Format["CaptionG"]) ? $Format["CaptionG"] : 255;
972
+        $CaptionB		= isset($Format["CaptionB"]) ? $Format["CaptionB"] : 255;
973
+        $CaptionAlpha	= isset($Format["CaptionAlpha"]) ? $Format["CaptionAlpha"] : 100;
974
+        $DrawBox		= isset($Format["DrawBox"]) ? $Format["DrawBox"] : TRUE;
975
+        $DrawBoxBorder	= isset($Format["DrawBoxBorder"]) ? $Format["DrawBoxBorder"] : FALSE;
976
+        $BorderOffset	= isset($Format["BorderOffset"]) ? $Format["BorderOffset"] : 5;
977
+        $BoxRounded	= isset($Format["BoxRounded"]) ? $Format["BoxRounded"] : TRUE;
978
+        $RoundedRadius	= isset($Format["RoundedRadius"]) ? $Format["RoundedRadius"] : 3;
979
+        $BoxR		= isset($Format["BoxR"]) ? $Format["BoxR"] : 0;
980
+        $BoxG		= isset($Format["BoxG"]) ? $Format["BoxG"] : 0;
981
+        $BoxB		= isset($Format["BoxB"]) ? $Format["BoxB"] : 0;
982
+        $BoxAlpha		= isset($Format["BoxAlpha"]) ? $Format["BoxAlpha"] : 20;
983
+        $BoxSurrounding	= isset($Format["BoxSurrounding"]) ? $Format["BoxSurrounding"] : "";
984
+        $BoxBorderR	= isset($Format["BoxBorderR"]) ? $Format["BoxBorderR"] : 255;
985
+        $BoxBorderG	= isset($Format["BoxBorderG"]) ? $Format["BoxBorderG"] : 255;
986
+        $BoxBorderB	= isset($Format["BoxBorderB"]) ? $Format["BoxBorderB"] : 255;
987
+        $BoxBorderAlpha	= isset($Format["BoxBorderAlpha"]) ? $Format["BoxBorderAlpha"] : 100;
988
+
989
+        $CaptionSettings = array("DrawBox"=>$DrawBox,"DrawBoxBorder"=>$DrawBoxBorder,"BorderOffset"=>$BorderOffset,"BoxRounded"=>$BoxRounded,"RoundedRadius"=>$RoundedRadius,
990
+                                "BoxR"=>$BoxR,"BoxG"=>$BoxG,"BoxB"=>$BoxB,"BoxAlpha"=>$BoxAlpha,"BoxSurrounding"=>$BoxSurrounding,
991
+                                "BoxBorderR"=>$BoxBorderR,"BoxBorderG"=>$BoxBorderG,"BoxBorderB"=>$BoxBorderB,"BoxBorderAlpha"=>$BoxBorderAlpha,
992
+                                "R"=>$CaptionR,"G"=>$CaptionG,"B"=>$CaptionB,"Alpha"=>$CaptionAlpha);
993
+
994
+        if ( $Caption == NULL ) { $Caption = $Value; }
995
+
996
+        $Data = $this->pDataObject->getData();
997
+
998
+        if ( !isset($Data["Axis"][$AxisID]) ) { return(-1); }
999 999
  
1000
-     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y )
1001
-      {
1002
-       $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"];
1003
-       $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"];
1004
-       $Y  = $this->getPosArray($Value,$AxisID);
1000
+        if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y )
1001
+        {
1002
+        $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"];
1003
+        $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"];
1004
+        $Y  = $this->getPosArray($Value,$AxisID);
1005 1005
 
1006
-       $this->pChartObject->drawLine($X1,$Y,$X2,$Y,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight));
1006
+        $this->pChartObject->drawLine($X1,$Y,$X2,$Y,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight));
1007 1007
 
1008
-       if ( $Wide )
1008
+        if ( $Wide )
1009 1009
         {
1010
-         $this->pChartObject->drawLine($X1,$Y-1,$X2,$Y-1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1011
-         $this->pChartObject->drawLine($X1,$Y+1,$X2,$Y+1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1010
+            $this->pChartObject->drawLine($X1,$Y-1,$X2,$Y-1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1011
+            $this->pChartObject->drawLine($X1,$Y+1,$X2,$Y+1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1012 1012
         }
1013 1013
 
1014
-       if ( $WriteCaption )
1014
+        if ( $WriteCaption )
1015 1015
         {
1016
-         if ( $CaptionAlign == CAPTION_LEFT_TOP )
1017
-          { $X = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLELEFT; }
1018
-         else 
1019
-          { $X = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"] - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLERIGHT; }
1016
+            if ( $CaptionAlign == CAPTION_LEFT_TOP )
1017
+            { $X = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLELEFT; }
1018
+            else 
1019
+            { $X = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"] - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLERIGHT; }
1020 1020
 
1021
-         $this->pChartObject->drawText($X,$Y,$Caption,$CaptionSettings);
1021
+            $this->pChartObject->drawText($X,$Y,$Caption,$CaptionSettings);
1022 1022
         }
1023 1023
 
1024
-       return(array("Y"=>$Y));
1025
-      }
1026
-     elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
1027
-      {
1028
-       $X  = $this->getPosArray($Value,$AxisID);
1029
-       $Y1 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"];
1030
-       $Y2 = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"];
1024
+        return(array("Y"=>$Y));
1025
+        }
1026
+        elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
1027
+        {
1028
+        $X  = $this->getPosArray($Value,$AxisID);
1029
+        $Y1 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"];
1030
+        $Y2 = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"];
1031 1031
 
1032
-       $this->pChartObject->drawLine($X,$Y1,$X,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight));
1032
+        $this->pChartObject->drawLine($X,$Y1,$X,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight));
1033 1033
 
1034
-       if ( $Wide )
1034
+        if ( $Wide )
1035 1035
         {
1036
-         $this->pChartObject->drawLine($X-1,$Y1,$X-1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1037
-         $this->pChartObject->drawLine($X+1,$Y1,$X+1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1036
+            $this->pChartObject->drawLine($X-1,$Y1,$X-1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1037
+            $this->pChartObject->drawLine($X+1,$Y1,$X+1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1038 1038
         }
1039 1039
 
1040
-       if ( $WriteCaption )
1040
+        if ( $WriteCaption )
1041 1041
         {
1042
-         if ( $CaptionAlign == CAPTION_LEFT_TOP )
1043
-          { $Y = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE; }
1044
-         else 
1045
-          { $Y = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_BOTTOMMIDDLE; }
1042
+            if ( $CaptionAlign == CAPTION_LEFT_TOP )
1043
+            { $Y = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE; }
1044
+            else 
1045
+            { $Y = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_BOTTOMMIDDLE; }
1046 1046
 
1047
-         $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE;
1048
-         $this->pChartObject->drawText($X,$Y,$Caption,$CaptionSettings);
1047
+            $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE;
1048
+            $this->pChartObject->drawText($X,$Y,$Caption,$CaptionSettings);
1049 1049
         }
1050 1050
 
1051
-       return(array("X"=>$X));
1052
-      }
1051
+        return(array("X"=>$X));
1052
+        }
1053 1053
     }
1054 1054
 
1055
-   /* Draw a Scatter threshold area */
1056
-   function drawScatterThresholdArea($Value1,$Value2,$Format="")
1055
+    /* Draw a Scatter threshold area */
1056
+    function drawScatterThresholdArea($Value1,$Value2,$Format="")
1057 1057
     {
1058
-     $AxisID	= isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
1059
-     $R		= isset($Format["R"]) ? $Format["R"] : 255;
1060
-     $G		= isset($Format["G"]) ? $Format["G"] : 0;
1061
-     $B		= isset($Format["B"]) ? $Format["B"] : 0;
1062
-     $Alpha	= isset($Format["Alpha"]) ? $Format["Alpha"] : 20;
1063
-     $Border    = isset($Format["Border"]) ? $Format["Border"] : TRUE;
1064
-     $BorderR   = isset($Format["BorderR"]) ? $Format["BorderR"] : $R;
1065
-     $BorderG   = isset($Format["BorderG"]) ? $Format["BorderG"] : $G;
1066
-     $BorderB   = isset($Format["BorderB"]) ? $Format["BorderB"] : $B;
1067
-     $BorderAlpha = isset($Format["BorderAlpha"]) ? $Format["BorderAlpha"] : $Alpha + 20;
1068
-     $BorderTicks = isset($Format["BorderTicks"]) ? $Format["BorderTicks"] : 2;
1069
-     $AreaName 	= isset($Format["AreaName"]) ? $Format["AreaName"] : "La ouate de phoque"; //NULL;
1070
-     $NameAngle	= isset($Format["NameAngle"]) ? $Format["NameAngle"] : ZONE_NAME_ANGLE_AUTO;
1071
-     $NameR	= isset($Format["NameR"]) ? $Format["NameR"] : 255;
1072
-     $NameG	= isset($Format["NameG"]) ? $Format["NameG"] : 255;
1073
-     $NameB	= isset($Format["NameB"]) ? $Format["NameB"] : 255;
1074
-     $NameAlpha	= isset($Format["NameAlpha"]) ? $Format["NameAlpha"] : 100;
1075
-     $DisableShadowOnArea = isset($Format["DisableShadowOnArea"]) ? $Format["DisableShadowOnArea"] : TRUE;
1076
-
1077
-     if ($Value1 > $Value2) { list($Value1, $Value2) = array($Value2, $Value1); }
1078
-
1079
-     $RestoreShadow = $this->pChartObject->Shadow;
1080
-     if ( $DisableShadowOnArea && $this->pChartObject->Shadow ) { $this->pChartObject->Shadow = FALSE; }
1081
-
1082
-     if ($BorderAlpha >100) { $BorderAlpha = 100;}
1083
-
1084
-     $Data = $this->pDataObject->getData();
1085
-
1086
-     if ( !isset($Data["Axis"][$AxisID]) ) { return(-1); }
1058
+        $AxisID	= isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
1059
+        $R		= isset($Format["R"]) ? $Format["R"] : 255;
1060
+        $G		= isset($Format["G"]) ? $Format["G"] : 0;
1061
+        $B		= isset($Format["B"]) ? $Format["B"] : 0;
1062
+        $Alpha	= isset($Format["Alpha"]) ? $Format["Alpha"] : 20;
1063
+        $Border    = isset($Format["Border"]) ? $Format["Border"] : TRUE;
1064
+        $BorderR   = isset($Format["BorderR"]) ? $Format["BorderR"] : $R;
1065
+        $BorderG   = isset($Format["BorderG"]) ? $Format["BorderG"] : $G;
1066
+        $BorderB   = isset($Format["BorderB"]) ? $Format["BorderB"] : $B;
1067
+        $BorderAlpha = isset($Format["BorderAlpha"]) ? $Format["BorderAlpha"] : $Alpha + 20;
1068
+        $BorderTicks = isset($Format["BorderTicks"]) ? $Format["BorderTicks"] : 2;
1069
+        $AreaName 	= isset($Format["AreaName"]) ? $Format["AreaName"] : "La ouate de phoque"; //NULL;
1070
+        $NameAngle	= isset($Format["NameAngle"]) ? $Format["NameAngle"] : ZONE_NAME_ANGLE_AUTO;
1071
+        $NameR	= isset($Format["NameR"]) ? $Format["NameR"] : 255;
1072
+        $NameG	= isset($Format["NameG"]) ? $Format["NameG"] : 255;
1073
+        $NameB	= isset($Format["NameB"]) ? $Format["NameB"] : 255;
1074
+        $NameAlpha	= isset($Format["NameAlpha"]) ? $Format["NameAlpha"] : 100;
1075
+        $DisableShadowOnArea = isset($Format["DisableShadowOnArea"]) ? $Format["DisableShadowOnArea"] : TRUE;
1076
+
1077
+        if ($Value1 > $Value2) { list($Value1, $Value2) = array($Value2, $Value1); }
1078
+
1079
+        $RestoreShadow = $this->pChartObject->Shadow;
1080
+        if ( $DisableShadowOnArea && $this->pChartObject->Shadow ) { $this->pChartObject->Shadow = FALSE; }
1081
+
1082
+        if ($BorderAlpha >100) { $BorderAlpha = 100;}
1083
+
1084
+        $Data = $this->pDataObject->getData();
1085
+
1086
+        if ( !isset($Data["Axis"][$AxisID]) ) { return(-1); }
1087 1087
  
1088
-     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
1089
-      {
1090
-       $Y1 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"];
1091
-       $Y2 = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"];
1092
-       $X1  = $this->getPosArray($Value1,$AxisID);
1093
-       $X2  = $this->getPosArray($Value2,$AxisID);
1088
+        if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
1089
+        {
1090
+        $Y1 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"];
1091
+        $Y2 = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"];
1092
+        $X1  = $this->getPosArray($Value1,$AxisID);
1093
+        $X2  = $this->getPosArray($Value2,$AxisID);
1094 1094
 
1095
-       if ( $X1 <= $this->pChartObject->GraphAreaX1 ) { $X1 = $this->pChartObject->GraphAreaX1+$Data["Axis"][$AxisID]["Margin"]; }
1096
-       if ( $X2 >= $this->pChartObject->GraphAreaX2 ) { $X2 = $this->pChartObject->GraphAreaX2-$Data["Axis"][$AxisID]["Margin"]; }
1095
+        if ( $X1 <= $this->pChartObject->GraphAreaX1 ) { $X1 = $this->pChartObject->GraphAreaX1+$Data["Axis"][$AxisID]["Margin"]; }
1096
+        if ( $X2 >= $this->pChartObject->GraphAreaX2 ) { $X2 = $this->pChartObject->GraphAreaX2-$Data["Axis"][$AxisID]["Margin"]; }
1097 1097
 
1098
-       $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha));
1098
+        $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha));
1099 1099
 
1100
-       if ( $Border )
1100
+        if ( $Border )
1101 1101
         {
1102
-         $this->pChartObject->drawLine($X1,$Y1,$X1,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1103
-         $this->pChartObject->drawLine($X2,$Y1,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1102
+            $this->pChartObject->drawLine($X1,$Y1,$X1,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1103
+            $this->pChartObject->drawLine($X2,$Y1,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1104 1104
         }
1105 1105
 
1106
-       if ( $AreaName != NULL )
1106
+        if ( $AreaName != NULL )
1107 1107
         {
1108
-         $XPos = ($X2-$X1)/2 + $X1;
1109
-         $YPos = ($Y2-$Y1)/2 + $Y1;
1110
-
1111
-         if ( $NameAngle == ZONE_NAME_ANGLE_AUTO )
1112
-          {
1113
-           $TxtPos   = $this->pChartObject->getTextBox($XPos,$YPos,$this->pChartObject->FontName,$this->pChartObject->FontSize,0,$AreaName);
1114
-           $TxtWidth = $TxtPos[1]["X"] - $TxtPos[0]["X"];
1115
-           if ( abs($X2 - $X1) > $TxtWidth ) { $NameAngle = 0; } else { $NameAngle = 90; }
1116
-          }
1117
-         $this->pChartObject->Shadow = $RestoreShadow;
1118
-         $this->pChartObject->drawText($XPos,$YPos,$AreaName,array("R"=>$NameR,"G"=>$NameG,"B"=>$NameB,"Alpha"=>$NameAlpha,"Angle"=>$NameAngle,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1119
-         if ( $DisableShadowOnArea ) { $this->pChartObject->Shadow = FALSE; }
1108
+            $XPos = ($X2-$X1)/2 + $X1;
1109
+            $YPos = ($Y2-$Y1)/2 + $Y1;
1110
+
1111
+            if ( $NameAngle == ZONE_NAME_ANGLE_AUTO )
1112
+            {
1113
+            $TxtPos   = $this->pChartObject->getTextBox($XPos,$YPos,$this->pChartObject->FontName,$this->pChartObject->FontSize,0,$AreaName);
1114
+            $TxtWidth = $TxtPos[1]["X"] - $TxtPos[0]["X"];
1115
+            if ( abs($X2 - $X1) > $TxtWidth ) { $NameAngle = 0; } else { $NameAngle = 90; }
1116
+            }
1117
+            $this->pChartObject->Shadow = $RestoreShadow;
1118
+            $this->pChartObject->drawText($XPos,$YPos,$AreaName,array("R"=>$NameR,"G"=>$NameG,"B"=>$NameB,"Alpha"=>$NameAlpha,"Angle"=>$NameAngle,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1119
+            if ( $DisableShadowOnArea ) { $this->pChartObject->Shadow = FALSE; }
1120 1120
         }
1121 1121
 
1122
-       $this->pChartObject->Shadow = $RestoreShadow;
1123
-       return(array("X1"=>$X1,"X2"=>$X2));
1124
-      }
1125
-     elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y )
1126
-      {
1127
-       $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"];
1128
-       $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"];
1129
-       $Y1 = $this->getPosArray($Value1,$AxisID);
1130
-       $Y2 = $this->getPosArray($Value2,$AxisID);
1122
+        $this->pChartObject->Shadow = $RestoreShadow;
1123
+        return(array("X1"=>$X1,"X2"=>$X2));
1124
+        }
1125
+        elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y )
1126
+        {
1127
+        $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"];
1128
+        $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"];
1129
+        $Y1 = $this->getPosArray($Value1,$AxisID);
1130
+        $Y2 = $this->getPosArray($Value2,$AxisID);
1131 1131
 
1132
-       if ( $Y1 >= $this->pChartObject->GraphAreaY2 ) { $Y1 = $this->pChartObject->GraphAreaY2-$Data["Axis"][$AxisID]["Margin"]; }
1133
-       if ( $Y2 <= $this->pChartObject->GraphAreaY1 ) { $Y2 = $this->pChartObject->GraphAreaY1+$Data["Axis"][$AxisID]["Margin"]; }
1132
+        if ( $Y1 >= $this->pChartObject->GraphAreaY2 ) { $Y1 = $this->pChartObject->GraphAreaY2-$Data["Axis"][$AxisID]["Margin"]; }
1133
+        if ( $Y2 <= $this->pChartObject->GraphAreaY1 ) { $Y2 = $this->pChartObject->GraphAreaY1+$Data["Axis"][$AxisID]["Margin"]; }
1134 1134
 
1135
-       $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha));
1135
+        $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha));
1136 1136
 
1137
-       if ( $Border )
1137
+        if ( $Border )
1138 1138
         {
1139
-         $this->pChartObject->drawLine($X1,$Y1,$X2,$Y1,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1140
-         $this->pChartObject->drawLine($X1,$Y2,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1139
+            $this->pChartObject->drawLine($X1,$Y1,$X2,$Y1,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1140
+            $this->pChartObject->drawLine($X1,$Y2,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1141 1141
         }
1142 1142
 
1143
-       if ( $AreaName != NULL )
1143
+        if ( $AreaName != NULL )
1144 1144
         {
1145
-         $XPos = ($X2-$X1)/2 + $X1;
1146
-         $YPos = ($Y2-$Y1)/2 + $Y1;
1145
+            $XPos = ($X2-$X1)/2 + $X1;
1146
+            $YPos = ($Y2-$Y1)/2 + $Y1;
1147 1147
 
1148
-         $this->pChartObject->Shadow = $RestoreShadow;
1149
-         $this->pChartObject->drawText($YPos,$XPos,$AreaName,array("R"=>$NameR,"G"=>$NameG,"B"=>$NameB,"Alpha"=>$NameAlpha,"Angle"=>0,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1150
-         if ( $DisableShadowOnArea ) { $this->Shadow = FALSE; }
1148
+            $this->pChartObject->Shadow = $RestoreShadow;
1149
+            $this->pChartObject->drawText($YPos,$XPos,$AreaName,array("R"=>$NameR,"G"=>$NameG,"B"=>$NameB,"Alpha"=>$NameAlpha,"Angle"=>0,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1150
+            if ( $DisableShadowOnArea ) { $this->Shadow = FALSE; }
1151 1151
         }
1152 1152
 
1153
-       $this->pChartObject->Shadow = $RestoreShadow;
1154
-       return(array("Y1"=>$Y1,"Y2"=>$Y2));
1155
-      }
1153
+        $this->pChartObject->Shadow = $RestoreShadow;
1154
+        return(array("Y1"=>$Y1,"Y2"=>$Y2));
1155
+        }
1156
+    }
1156 1157
     }
1157
-  }
1158 1158
 ?>
1159 1159
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +454 added lines, -454 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
      You can find the whole class documentation on the pChart web site.
14 14
  */
15 15
 
16
- define("SCATTER_MISSING_X_SERIE"	, 190001);
17
- define("SCATTER_MISSING_Y_SERIE"	, 190002);
16
+ define("SCATTER_MISSING_X_SERIE", 190001);
17
+ define("SCATTER_MISSING_Y_SERIE", 190002);
18 18
 
19 19
  /* pScatter class definition */
20 20
  class pScatter
@@ -23,24 +23,24 @@  discard block
 block discarded – undo
23 23
    var $pDataObject;
24 24
 
25 25
    /* Class creator */
26
-   function pScatter($pChartObject,$pDataObject)
26
+   function pScatter($pChartObject, $pDataObject)
27 27
     {
28 28
      $this->pChartObject = $pChartObject;
29 29
      $this->pDataObject  = $pDataObject;
30 30
     }
31 31
 
32 32
    /* Prepare the scale */
33
-   function drawScatterScale($Format="")
33
+   function drawScatterScale($Format = "")
34 34
     {
35
-     $Mode		= isset($Format["Mode"]) ? $Format["Mode"] : SCALE_MODE_FLOATING;
36
-     $Floating		= isset($Format["Floating"]) ? $Format["Floating"] : FALSE;
37
-     $XLabelsRotation	= isset($Format["XLabelsRotation"]) ? $Format["XLabelsRotation"] : 90;
38
-     $MinDivHeight	= isset($Format["MinDivHeight"]) ? $Format["MinDivHeight"] : 20;
39
-     $Factors		= isset($Format["Factors"]) ? $Format["Factors"] : array(1,2,5);
40
-     $ManualScale	= isset($Format["ManualScale"]) ? $Format["ManualScale"] : array("0"=>array("Min"=>-100,"Max"=>100));
35
+     $Mode = isset($Format["Mode"]) ? $Format["Mode"] : SCALE_MODE_FLOATING;
36
+     $Floating = isset($Format["Floating"]) ? $Format["Floating"] : FALSE;
37
+     $XLabelsRotation = isset($Format["XLabelsRotation"]) ? $Format["XLabelsRotation"] : 90;
38
+     $MinDivHeight = isset($Format["MinDivHeight"]) ? $Format["MinDivHeight"] : 20;
39
+     $Factors		= isset($Format["Factors"]) ? $Format["Factors"] : array(1, 2, 5);
40
+     $ManualScale = isset($Format["ManualScale"]) ? $Format["ManualScale"] : array("0"=>array("Min"=>-100, "Max"=>100));
41 41
      $XMargin		= isset($Format["XMargin"]) ? $Format["XMargin"] : 0;
42 42
      $YMargin		= isset($Format["YMargin"]) ? $Format["YMargin"] : 0;
43
-     $ScaleSpacing	= isset($Format["ScaleSpacing"]) ? $Format["ScaleSpacing"] : 15;
43
+     $ScaleSpacing = isset($Format["ScaleSpacing"]) ? $Format["ScaleSpacing"] : 15;
44 44
      $InnerTickWidth	= isset($Format["InnerTickWidth"]) ? $Format["InnerTickWidth"] : 2;
45 45
      $OuterTickWidth	= isset($Format["OuterTickWidth"]) ? $Format["OuterTickWidth"] : 2;
46 46
      $DrawXLines	= isset($Format["DrawXLines"]) ? $Format["DrawXLines"] : ALL;
@@ -49,75 +49,75 @@  discard block
 block discarded – undo
49 49
      $GridR		= isset($Format["GridR"]) ? $Format["GridR"] : 255;
50 50
      $GridG		= isset($Format["GridG"]) ? $Format["GridG"] : 255;
51 51
      $GridB		= isset($Format["GridB"]) ? $Format["GridB"] : 255;
52
-     $GridAlpha		= isset($Format["GridAlpha"]) ? $Format["GridAlpha"] : 40;
52
+     $GridAlpha = isset($Format["GridAlpha"]) ? $Format["GridAlpha"] : 40;
53 53
      $AxisRo		= isset($Format["AxisR"]) ? $Format["AxisR"] : 0;
54 54
      $AxisGo		= isset($Format["AxisG"]) ? $Format["AxisG"] : 0;
55 55
      $AxisBo		= isset($Format["AxisB"]) ? $Format["AxisB"] : 0;
56
-     $AxisAlpha		= isset($Format["AxisAlpha"]) ? $Format["AxisAlpha"] : 100;
56
+     $AxisAlpha = isset($Format["AxisAlpha"]) ? $Format["AxisAlpha"] : 100;
57 57
      $TickRo		= isset($Format["TickR"]) ? $Format["TickR"] : 0;
58 58
      $TickGo		= isset($Format["TickG"]) ? $Format["TickG"] : 0;
59 59
      $TickBo		= isset($Format["TickB"]) ? $Format["TickB"] : 0;
60
-     $TickAlpha		= isset($Format["TickAlpha"]) ? $Format["TickAlpha"] : 100;
61
-     $DrawSubTicks	= isset($Format["DrawSubTicks"]) ? $Format["DrawSubTicks"] : FALSE;
60
+     $TickAlpha = isset($Format["TickAlpha"]) ? $Format["TickAlpha"] : 100;
61
+     $DrawSubTicks = isset($Format["DrawSubTicks"]) ? $Format["DrawSubTicks"] : FALSE;
62 62
      $InnerSubTickWidth	= isset($Format["InnerSubTickWidth"]) ? $Format["InnerSubTickWidth"] : 0;
63 63
      $OuterSubTickWidth	= isset($Format["OuterSubTickWidth"]) ? $Format["OuterSubTickWidth"] : 2;
64 64
      $SubTickR		= isset($Format["SubTickR"]) ? $Format["SubTickR"] : 255;
65 65
      $SubTickG		= isset($Format["SubTickG"]) ? $Format["SubTickG"] : 0;
66 66
      $SubTickB		= isset($Format["SubTickB"]) ? $Format["SubTickB"] : 0;
67
-     $SubTickAlpha	= isset($Format["SubTickAlpha"]) ? $Format["SubTickAlpha"] : 100;
67
+     $SubTickAlpha = isset($Format["SubTickAlpha"]) ? $Format["SubTickAlpha"] : 100;
68 68
      $XReleasePercent	= isset($Format["XReleasePercent"]) ? $Format["XReleasePercent"] : 1;
69
-     $DrawArrows	= isset($Format["DrawArrows"]) ? $Format["DrawArrows"] : FALSE;
70
-     $ArrowSize         = isset($Format["ArrowSize"]) ? $Format["ArrowSize"] : 8;
69
+     $DrawArrows = isset($Format["DrawArrows"]) ? $Format["DrawArrows"] : FALSE;
70
+     $ArrowSize = isset($Format["ArrowSize"]) ? $Format["ArrowSize"] : 8;
71 71
      $CycleBackground	= isset($Format["CycleBackground"]) ? $Format["CycleBackground"] : FALSE;
72 72
      $BackgroundR1	= isset($Format["BackgroundR1"]) ? $Format["BackgroundR1"] : 255;
73 73
      $BackgroundG1	= isset($Format["BackgroundG1"]) ? $Format["BackgroundG1"] : 255;
74 74
      $BackgroundB1	= isset($Format["BackgroundB1"]) ? $Format["BackgroundB1"] : 255;
75
-     $BackgroundAlpha1	= isset($Format["BackgroundAlpha1"]) ? $Format["BackgroundAlpha1"] : 10;
75
+     $BackgroundAlpha1 = isset($Format["BackgroundAlpha1"]) ? $Format["BackgroundAlpha1"] : 10;
76 76
      $BackgroundR2	= isset($Format["BackgroundR2"]) ? $Format["BackgroundR2"] : 230;
77 77
      $BackgroundG2	= isset($Format["BackgroundG2"]) ? $Format["BackgroundG2"] : 230;
78 78
      $BackgroundB2	= isset($Format["BackgroundB2"]) ? $Format["BackgroundB2"] : 230;
79
-     $BackgroundAlpha2	= isset($Format["BackgroundAlpha2"]) ? $Format["BackgroundAlpha2"] : 10;
79
+     $BackgroundAlpha2 = isset($Format["BackgroundAlpha2"]) ? $Format["BackgroundAlpha2"] : 10;
80 80
 
81 81
      /* Check if we have at least both one X and Y axis */
82 82
      $GotXAxis = FALSE; $GotYAxis = FALSE;
83
-     foreach($this->pDataObject->Data["Axis"] as $AxisID => $AxisSettings)
83
+     foreach ($this->pDataObject->Data["Axis"] as $AxisID => $AxisSettings)
84 84
       {
85
-       if ( $AxisSettings["Identity"] == AXIS_X ) { $GotXAxis = TRUE; }
86
-       if ( $AxisSettings["Identity"] == AXIS_Y ) { $GotYAxis = TRUE; }
85
+       if ($AxisSettings["Identity"] == AXIS_X) { $GotXAxis = TRUE; }
86
+       if ($AxisSettings["Identity"] == AXIS_Y) { $GotYAxis = TRUE; }
87 87
       }
88
-     if ( !$GotXAxis ) { return(SCATTER_MISSING_X_SERIE); }
89
-     if ( !$GotYAxis ) { return(SCATTER_MISSING_Y_SERIE); }
88
+     if (!$GotXAxis) { return(SCATTER_MISSING_X_SERIE); }
89
+     if (!$GotYAxis) { return(SCATTER_MISSING_Y_SERIE); }
90 90
 
91 91
      /* Skip a NOTICE event in case of an empty array */
92
-     if ( $DrawYLines == NONE ) { $DrawYLines = array("zarma"=>"31"); }
92
+     if ($DrawYLines == NONE) { $DrawYLines = array("zarma"=>"31"); }
93 93
 
94 94
      $Data = $this->pDataObject->getData();
95 95
 
96
-     foreach($Data["Axis"] as $AxisID => $AxisSettings)
96
+     foreach ($Data["Axis"] as $AxisID => $AxisSettings)
97 97
       {
98
-       if ( $AxisSettings["Identity"] == AXIS_X)
98
+       if ($AxisSettings["Identity"] == AXIS_X)
99 99
         { $Width = $this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1 - $XMargin*2; }
100 100
        else
101 101
         { $Width = $this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1 - $YMargin*2; }
102 102
 
103 103
        $AxisMin = ABSOLUTE_MAX; $AxisMax = OUT_OF_SIGHT;
104
-       if ( $Mode == SCALE_MODE_FLOATING )
104
+       if ($Mode == SCALE_MODE_FLOATING)
105 105
         {
106
-         foreach($Data["Series"] as $SerieID => $SerieParameter)
106
+         foreach ($Data["Series"] as $SerieID => $SerieParameter)
107 107
           {
108
-           if ( $SerieParameter["Axis"] == $AxisID && $Data["Series"][$SerieID]["isDrawable"] )
108
+           if ($SerieParameter["Axis"] == $AxisID && $Data["Series"][$SerieID]["isDrawable"])
109 109
             {
110
-             $AxisMax = max($AxisMax,$Data["Series"][$SerieID]["Max"]);
111
-             $AxisMin = min($AxisMin,$Data["Series"][$SerieID]["Min"]);
110
+             $AxisMax = max($AxisMax, $Data["Series"][$SerieID]["Max"]);
111
+             $AxisMin = min($AxisMin, $Data["Series"][$SerieID]["Min"]);
112 112
             }
113 113
           }
114
-         $AutoMargin = (($AxisMax-$AxisMin)/100)*$XReleasePercent;
114
+         $AutoMargin = (($AxisMax - $AxisMin)/100)*$XReleasePercent;
115 115
 
116
-         $Data["Axis"][$AxisID]["Min"] = $AxisMin-$AutoMargin; $Data["Axis"][$AxisID]["Max"] = $AxisMax+$AutoMargin;
116
+         $Data["Axis"][$AxisID]["Min"] = $AxisMin - $AutoMargin; $Data["Axis"][$AxisID]["Max"] = $AxisMax + $AutoMargin;
117 117
         }
118
-       elseif ( $Mode == SCALE_MODE_MANUAL )
118
+       elseif ($Mode == SCALE_MODE_MANUAL)
119 119
         {
120
-         if ( isset($ManualScale[$AxisID]["Min"]) && isset($ManualScale[$AxisID]["Max"]) )
120
+         if (isset($ManualScale[$AxisID]["Min"]) && isset($ManualScale[$AxisID]["Max"]))
121 121
           {
122 122
            $Data["Axis"][$AxisID]["Min"] = $ManualScale[$AxisID]["Min"];
123 123
            $Data["Axis"][$AxisID]["Max"] = $ManualScale[$AxisID]["Max"];
@@ -127,12 +127,12 @@  discard block
 block discarded – undo
127 127
         }
128 128
 
129 129
        /* 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"]);
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 132
        else
133 133
         {
134 134
          $MaxDivs = floor($Width/$MinDivHeight);
135
-         $Scale   = $this->pChartObject->computeScale($Data["Axis"][$AxisID]["Min"],$Data["Axis"][$AxisID]["Max"],$MaxDivs,$Factors,$AxisID);
135
+         $Scale   = $this->pChartObject->computeScale($Data["Axis"][$AxisID]["Min"], $Data["Axis"][$AxisID]["Max"], $MaxDivs, $Factors, $AxisID);
136 136
         }
137 137
 
138 138
        $Data["Axis"][$AxisID]["Margin"]    = $AxisSettings["Identity"] == AXIS_X ? $XMargin : $YMargin;
@@ -141,11 +141,11 @@  discard block
 block discarded – undo
141 141
        $Data["Axis"][$AxisID]["Rows"]      = $Scale["Rows"];
142 142
        $Data["Axis"][$AxisID]["RowHeight"] = $Scale["RowHeight"];
143 143
 
144
-       if ( isset($Scale["Format"]) ) { $Data["Axis"][$AxisID]["Format"] = $Scale["Format"]; }
144
+       if (isset($Scale["Format"])) { $Data["Axis"][$AxisID]["Format"] = $Scale["Format"]; }
145 145
 
146
-       if ( !isset($Data["Axis"][$AxisID]["Display"]) ) { $Data["Axis"][$AxisID]["Display"] = NULL; }
147
-       if ( !isset($Data["Axis"][$AxisID]["Format"]) )  { $Data["Axis"][$AxisID]["Format"] = NULL; }
148
-       if ( !isset($Data["Axis"][$AxisID]["Unit"]) )    { $Data["Axis"][$AxisID]["Unit"] = NULL; }
146
+       if (!isset($Data["Axis"][$AxisID]["Display"])) { $Data["Axis"][$AxisID]["Display"] = NULL; }
147
+       if (!isset($Data["Axis"][$AxisID]["Format"])) { $Data["Axis"][$AxisID]["Format"] = NULL; }
148
+       if (!isset($Data["Axis"][$AxisID]["Unit"])) { $Data["Axis"][$AxisID]["Unit"] = NULL; }
149 149
       }
150 150
 
151 151
      /* Get the default font color */
@@ -154,67 +154,67 @@  discard block
 block discarded – undo
154 154
      /* Set the original boundaries */
155 155
      $AxisPos["L"] = $this->pChartObject->GraphAreaX1; $AxisPos["R"] = $this->pChartObject->GraphAreaX2; $AxisPos["T"] = $this->pChartObject->GraphAreaY1; $AxisPos["B"] = $this->pChartObject->GraphAreaY2;
156 156
 
157
-     foreach($Data["Axis"] as $AxisID => $AxisSettings)
157
+     foreach ($Data["Axis"] as $AxisID => $AxisSettings)
158 158
       {
159
-       if ( isset($AxisSettings["Color"]) )
159
+       if (isset($AxisSettings["Color"]))
160 160
         {
161 161
          $AxisR = $AxisSettings["Color"]["R"]; $AxisG = $AxisSettings["Color"]["G"]; $AxisB = $AxisSettings["Color"]["B"];
162 162
          $TickR = $AxisSettings["Color"]["R"]; $TickG = $AxisSettings["Color"]["G"]; $TickB = $AxisSettings["Color"]["B"];
163
-         $this->pChartObject->setFontProperties(array("R"=>$AxisSettings["Color"]["R"],"G"=>$AxisSettings["Color"]["G"],"B"=>$AxisSettings["Color"]["B"]));
163
+         $this->pChartObject->setFontProperties(array("R"=>$AxisSettings["Color"]["R"], "G"=>$AxisSettings["Color"]["G"], "B"=>$AxisSettings["Color"]["B"]));
164 164
         }
165 165
        else
166 166
         {
167 167
          $AxisR = $AxisRo; $AxisG = $AxisGo; $AxisB = $AxisBo;
168 168
          $TickR = $TickRo; $TickG = $TickGo; $TickB = $TickBo;
169
-         $this->pChartObject->setFontProperties(array("R"=>$FontColorRo,"G"=>$FontColorGo,"B"=>$FontColorBo));
169
+         $this->pChartObject->setFontProperties(array("R"=>$FontColorRo, "G"=>$FontColorGo, "B"=>$FontColorBo));
170 170
         }
171 171
 
172 172
        $LastValue = "w00t"; $ID = 1;
173
-       if ( $AxisSettings["Identity"] == AXIS_X )
173
+       if ($AxisSettings["Identity"] == AXIS_X)
174 174
         {
175
-         if ( $AxisSettings["Position"] == AXIS_POSITION_BOTTOM )
175
+         if ($AxisSettings["Position"] == AXIS_POSITION_BOTTOM)
176 176
           {
177
-           if ( $XLabelsRotation == 0 )				   { $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 2; }
178
-           if ( $XLabelsRotation > 0 && $XLabelsRotation < 190 )   { $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
179
-           if ( $XLabelsRotation == 180 )			   { $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 5; }
180
-           if ( $XLabelsRotation > 180 && $XLabelsRotation < 360 ) { $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
177
+           if ($XLabelsRotation == 0) { $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 2; }
178
+           if ($XLabelsRotation > 0 && $XLabelsRotation < 190) { $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
179
+           if ($XLabelsRotation == 180) { $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 5; }
180
+           if ($XLabelsRotation > 180 && $XLabelsRotation < 360) { $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
181 181
 
182
-           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)); }
182
+           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 184
            else
185
-            { $FloatingOffset = 0; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1,$AxisPos["B"],$this->pChartObject->GraphAreaX2,$AxisPos["B"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
185
+            { $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 186
 
187
-           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)); }
187
+           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)); }
188 188
 
189 189
            $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
190
-           $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxBottom = $AxisPos["B"];
190
+           $Step   = $Width/$AxisSettings["Rows"]; $SubTicksSize = $Step/2; $MaxBottom = $AxisPos["B"];
191 191
            $LastX  = NULL;
192
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
192
+           for ($i = 0; $i <= $AxisSettings["Rows"]; $i++)
193 193
             {
194 194
              $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
195 195
              $YPos  = $AxisPos["B"];
196
-             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
196
+             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i, $AxisSettings["Display"], $AxisSettings["Format"], $AxisSettings["Unit"]);
197 197
 
198
-             if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
199
-             if ( $LastX != NULL && $CycleBackground  && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); }
198
+             if ($i%2 == 1) { $BGColor = array("R"=>$BackgroundR1, "G"=>$BackgroundG1, "B"=>$BackgroundB1, "Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2, "G"=>$BackgroundG2, "B"=>$BackgroundB2, "Alpha"=>$BackgroundAlpha2); }
199
+             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 200
 
201
-             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));
201
+             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));
204 204
 
205
-             $this->pChartObject->drawLine($XPos,$YPos-$InnerTickWidth,$XPos,$YPos+$OuterTickWidth,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
206
-             $Bounds    = $this->pChartObject->drawText($XPos,$YPos+$OuterTickWidth+$LabelOffset,$Value,array("Angle"=>$XLabelsRotation,"Align"=>$LabelAlign));
207
-             $TxtBottom = $YPos+2+$OuterTickWidth+2+($Bounds[0]["Y"]-$Bounds[2]["Y"]);
208
-             $MaxBottom = max($MaxBottom,$TxtBottom);
205
+             $this->pChartObject->drawLine($XPos, $YPos - $InnerTickWidth, $XPos, $YPos + $OuterTickWidth, array("R"=>$TickR, "G"=>$TickG, "B"=>$TickB, "Alpha"=>$TickAlpha));
206
+             $Bounds    = $this->pChartObject->drawText($XPos, $YPos + $OuterTickWidth + $LabelOffset, $Value, array("Angle"=>$XLabelsRotation, "Align"=>$LabelAlign));
207
+             $TxtBottom = $YPos + 2 + $OuterTickWidth + 2 + ($Bounds[0]["Y"] - $Bounds[2]["Y"]);
208
+             $MaxBottom = max($MaxBottom, $TxtBottom);
209 209
 
210 210
              $LastX = $XPos;
211 211
             }
212 212
 
213
-           if ( isset($AxisSettings["Name"]) )
213
+           if (isset($AxisSettings["Name"]))
214 214
             {
215
-             $YPos   = $MaxBottom+2;
216
-             $XPos   = $this->pChartObject->GraphAreaX1+($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1)/2;
217
-             $Bounds = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_TOPMIDDLE));
215
+             $YPos   = $MaxBottom + 2;
216
+             $XPos   = $this->pChartObject->GraphAreaX1 + ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1)/2;
217
+             $Bounds = $this->pChartObject->drawText($XPos, $YPos, $AxisSettings["Name"], array("Align"=>TEXT_ALIGN_TOPMIDDLE));
218 218
              $MaxBottom = $Bounds[0]["Y"];
219 219
 
220 220
              $this->pDataObject->Data["GraphArea"]["Y2"] = $MaxBottom + $this->pChartObject->FontSize;
@@ -222,50 +222,50 @@  discard block
 block discarded – undo
222 222
 
223 223
            $AxisPos["B"] = $MaxBottom + $ScaleSpacing;
224 224
           }
225
-         elseif ( $AxisSettings["Position"] == AXIS_POSITION_TOP )
225
+         elseif ($AxisSettings["Position"] == AXIS_POSITION_TOP)
226 226
           {
227
-           if ( $XLabelsRotation == 0 )					{ $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 2; }
228
-           if ( $XLabelsRotation > 0 && $XLabelsRotation < 190 )	{ $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
229
-           if ( $XLabelsRotation == 180 )				{ $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 5; }
230
-           if ( $XLabelsRotation > 180 && $SLabelxRotation < 360 )	{ $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
227
+           if ($XLabelsRotation == 0) { $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 2; }
228
+           if ($XLabelsRotation > 0 && $XLabelsRotation < 190) { $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
229
+           if ($XLabelsRotation == 180) { $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 5; }
230
+           if ($XLabelsRotation > 180 && $SLabelxRotation < 360) { $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
231 231
 
232
-           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)); }
232
+           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 234
            else
235
-            { $FloatingOffset = 0; $this->pChartObject->drawLine($this->pChartObject->GraphAreaX1,$AxisPos["T"],$this->pChartObject->GraphAreaX2,$AxisPos["T"],array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
235
+            { $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 236
 
237
-           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)); }
237
+           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)); }
238 238
 
239 239
            $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
240
-           $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinTop = $AxisPos["T"];
240
+           $Step   = $Width/$AxisSettings["Rows"]; $SubTicksSize = $Step/2; $MinTop = $AxisPos["T"];
241 241
            $LastX  = NULL;
242
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
242
+           for ($i = 0; $i <= $AxisSettings["Rows"]; $i++)
243 243
             {
244 244
              $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
245 245
              $YPos  = $AxisPos["T"];
246
-             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
246
+             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i, $AxisSettings["Display"], $AxisSettings["Format"], $AxisSettings["Unit"]);
247 247
 
248
-             if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
249
-             if ( $LastX != NULL && $CycleBackground  && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); }
248
+             if ($i%2 == 1) { $BGColor = array("R"=>$BackgroundR1, "G"=>$BackgroundG1, "B"=>$BackgroundB1, "Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2, "G"=>$BackgroundG2, "B"=>$BackgroundB2, "Alpha"=>$BackgroundAlpha2); }
249
+             if ($LastX != NULL && $CycleBackground && ($DrawXLines == ALL || in_array($AxisID, $DrawXLines))) { $this->pChartObject->drawFilledRectangle($LastX, $this->pChartObject->GraphAreaY1 + $FloatingOffset, $XPos, $this->pChartObject->GraphAreaY2 - $FloatingOffset, $BGColor); }
250 250
 
251
-             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)); }
251
+             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 252
 
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));
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));
255 255
 
256
-             $this->pChartObject->drawLine($XPos,$YPos-$OuterTickWidth,$XPos,$YPos+$InnerTickWidth,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
257
-             $Bounds = $this->pChartObject->drawText($XPos,$YPos-$OuterTickWidth-$LabelOffset,$Value,array("Angle"=>$XLabelsRotation,"Align"=>$LabelAlign));
258
-             $TxtBox = $YPos-$OuterTickWidth-4-($Bounds[0]["Y"]-$Bounds[2]["Y"]);
259
-             $MinTop = min($MinTop,$TxtBox);
256
+             $this->pChartObject->drawLine($XPos, $YPos - $OuterTickWidth, $XPos, $YPos + $InnerTickWidth, array("R"=>$TickR, "G"=>$TickG, "B"=>$TickB, "Alpha"=>$TickAlpha));
257
+             $Bounds = $this->pChartObject->drawText($XPos, $YPos - $OuterTickWidth - $LabelOffset, $Value, array("Angle"=>$XLabelsRotation, "Align"=>$LabelAlign));
258
+             $TxtBox = $YPos - $OuterTickWidth - 4 - ($Bounds[0]["Y"] - $Bounds[2]["Y"]);
259
+             $MinTop = min($MinTop, $TxtBox);
260 260
 
261 261
              $LastX = $XPos;
262 262
             }
263 263
 
264
-           if ( isset($AxisSettings["Name"]) )
264
+           if (isset($AxisSettings["Name"]))
265 265
             {
266
-             $YPos   = $MinTop-2;
267
-             $XPos   = $this->pChartObject->GraphAreaX1+($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1)/2;
268
-             $Bounds = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE));
266
+             $YPos   = $MinTop - 2;
267
+             $XPos   = $this->pChartObject->GraphAreaX1 + ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1)/2;
268
+             $Bounds = $this->pChartObject->drawText($XPos, $YPos, $AxisSettings["Name"], array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE));
269 269
              $MinTop = $Bounds[2]["Y"];
270 270
 
271 271
              $this->pDataObject->Data["GraphArea"]["Y1"] = $MinTop;
@@ -274,48 +274,48 @@  discard block
 block discarded – undo
274 274
            $AxisPos["T"] = $MinTop - $ScaleSpacing;
275 275
           }
276 276
         }
277
-       elseif ( $AxisSettings["Identity"] == AXIS_Y )
277
+       elseif ($AxisSettings["Identity"] == AXIS_Y)
278 278
         {
279
-         if ( $AxisSettings["Position"] == AXIS_POSITION_LEFT )
279
+         if ($AxisSettings["Position"] == AXIS_POSITION_LEFT)
280 280
           {
281 281
 
282
-           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)); }
282
+           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 284
            else
285
-            { $FloatingOffset = 0; $this->pChartObject->drawLine($AxisPos["L"],$this->pChartObject->GraphAreaY1,$AxisPos["L"],$this->pChartObject->GraphAreaY2,array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
285
+            { $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 286
 
287
-           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)); }
287
+           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)); }
288 288
 
289 289
            $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
290
-           $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinLeft = $AxisPos["L"];
290
+           $Step   = $Height/$AxisSettings["Rows"]; $SubTicksSize = $Step/2; $MinLeft = $AxisPos["L"];
291 291
            $LastY  = NULL;
292
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
292
+           for ($i = 0; $i <= $AxisSettings["Rows"]; $i++)
293 293
             {
294 294
              $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
295 295
              $XPos  = $AxisPos["L"];
296
-             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
296
+             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i, $AxisSettings["Display"], $AxisSettings["Format"], $AxisSettings["Unit"]);
297 297
 
298
-             if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
299
-             if ( $LastY != NULL && $CycleBackground && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
298
+             if ($i%2 == 1) { $BGColor = array("R"=>$BackgroundR1, "G"=>$BackgroundG1, "B"=>$BackgroundB1, "Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2, "G"=>$BackgroundG2, "B"=>$BackgroundB2, "Alpha"=>$BackgroundAlpha2); }
299
+             if ($LastY != NULL && $CycleBackground && ($DrawYLines == ALL || in_array($AxisID, $DrawYLines))) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1 + $FloatingOffset, $LastY, $this->pChartObject->GraphAreaX2 - $FloatingOffset, $YPos, $BGColor); }
300 300
 
301
-             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)); }
301
+             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 302
 
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));
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));
305 305
 
306
-             $this->pChartObject->drawLine($XPos-$OuterTickWidth,$YPos,$XPos+$InnerTickWidth,$YPos,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
307
-             $Bounds  = $this->pChartObject->drawText($XPos-$OuterTickWidth-2,$YPos,$Value,array("Align"=>TEXT_ALIGN_MIDDLERIGHT));
308
-             $TxtLeft = $XPos-$OuterTickWidth-2-($Bounds[1]["X"]-$Bounds[0]["X"]);
309
-             $MinLeft = min($MinLeft,$TxtLeft);
306
+             $this->pChartObject->drawLine($XPos - $OuterTickWidth, $YPos, $XPos + $InnerTickWidth, $YPos, array("R"=>$TickR, "G"=>$TickG, "B"=>$TickB, "Alpha"=>$TickAlpha));
307
+             $Bounds  = $this->pChartObject->drawText($XPos - $OuterTickWidth - 2, $YPos, $Value, array("Align"=>TEXT_ALIGN_MIDDLERIGHT));
308
+             $TxtLeft = $XPos - $OuterTickWidth - 2 - ($Bounds[1]["X"] - $Bounds[0]["X"]);
309
+             $MinLeft = min($MinLeft, $TxtLeft);
310 310
 
311 311
              $LastY = $YPos;
312 312
             }
313 313
 
314
-           if ( isset($AxisSettings["Name"]) )
314
+           if (isset($AxisSettings["Name"]))
315 315
             {
316
-             $XPos    = $MinLeft-2;
317
-             $YPos    = $this->pChartObject->GraphAreaY1+($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1)/2;
318
-             $Bounds  = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE,"Angle"=>90));
316
+             $XPos    = $MinLeft - 2;
317
+             $YPos    = $this->pChartObject->GraphAreaY1 + ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1)/2;
318
+             $Bounds  = $this->pChartObject->drawText($XPos, $YPos, $AxisSettings["Name"], array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE, "Angle"=>90));
319 319
              $MinLeft = $Bounds[2]["X"];
320 320
 
321 321
              $this->pDataObject->Data["GraphArea"]["X1"] = $MinLeft;
@@ -323,46 +323,46 @@  discard block
 block discarded – undo
323 323
 
324 324
            $AxisPos["L"] = $MinLeft - $ScaleSpacing;
325 325
           }
326
-         elseif ( $AxisSettings["Position"] == AXIS_POSITION_RIGHT )
326
+         elseif ($AxisSettings["Position"] == AXIS_POSITION_RIGHT)
327 327
           {
328 328
 
329
-           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)); }
329
+           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 331
            else
332
-            { $FloatingOffset = 0; $this->pChartObject->drawLine($AxisPos["R"],$this->pChartObject->GraphAreaY1,$AxisPos["R"],$this->pChartObject->GraphAreaY2,array("R"=>$AxisR,"G"=>$AxisG,"B"=>$AxisB,"Alpha"=>$AxisAlpha)); }
332
+            { $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 333
 
334
-           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)); }
334
+           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)); }
335 335
 
336 336
            $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
337
-           $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxLeft = $AxisPos["R"];
337
+           $Step   = $Height/$AxisSettings["Rows"]; $SubTicksSize = $Step/2; $MaxLeft = $AxisPos["R"];
338 338
            $LastY  = NULL;
339
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
339
+           for ($i = 0; $i <= $AxisSettings["Rows"]; $i++)
340 340
             {
341 341
              $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
342 342
              $XPos  = $AxisPos["R"];
343
-             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
343
+             $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i, $AxisSettings["Display"], $AxisSettings["Format"], $AxisSettings["Unit"]);
344 344
 
345
-             if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
346
-             if ( $LastY != NULL && $CycleBackground  && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
345
+             if ($i%2 == 1) { $BGColor = array("R"=>$BackgroundR1, "G"=>$BackgroundG1, "B"=>$BackgroundB1, "Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2, "G"=>$BackgroundG2, "B"=>$BackgroundB2, "Alpha"=>$BackgroundAlpha2); }
346
+             if ($LastY != NULL && $CycleBackground && ($DrawYLines == ALL || in_array($AxisID, $DrawYLines))) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1 + $FloatingOffset, $LastY, $this->pChartObject->GraphAreaX2 - $FloatingOffset, $YPos, $BGColor); }
347 347
 
348
-             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)); }
348
+             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 349
 
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));
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));
352 352
 
353
-             $this->pChartObject->drawLine($XPos-$InnerTickWidth,$YPos,$XPos+$OuterTickWidth,$YPos,array("R"=>$TickR,"G"=>$TickG,"B"=>$TickB,"Alpha"=>$TickAlpha));
354
-             $Bounds  = $this->pChartObject->drawText($XPos+$OuterTickWidth+2,$YPos,$Value,array("Align"=>TEXT_ALIGN_MIDDLELEFT));
355
-             $TxtLeft = $XPos+$OuterTickWidth+2+($Bounds[1]["X"]-$Bounds[0]["X"]);
356
-             $MaxLeft = max($MaxLeft,$TxtLeft);
353
+             $this->pChartObject->drawLine($XPos - $InnerTickWidth, $YPos, $XPos + $OuterTickWidth, $YPos, array("R"=>$TickR, "G"=>$TickG, "B"=>$TickB, "Alpha"=>$TickAlpha));
354
+             $Bounds  = $this->pChartObject->drawText($XPos + $OuterTickWidth + 2, $YPos, $Value, array("Align"=>TEXT_ALIGN_MIDDLELEFT));
355
+             $TxtLeft = $XPos + $OuterTickWidth + 2 + ($Bounds[1]["X"] - $Bounds[0]["X"]);
356
+             $MaxLeft = max($MaxLeft, $TxtLeft);
357 357
 
358 358
              $LastY = $YPos;
359 359
             }
360 360
 
361
-           if ( isset($AxisSettings["Name"]) )
361
+           if (isset($AxisSettings["Name"]))
362 362
             {
363
-             $XPos    = $MaxLeft+6;
364
-             $YPos    = $this->pChartObject->GraphAreaY1+($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1)/2;
365
-             $Bounds  = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE,"Angle"=>270));
363
+             $XPos    = $MaxLeft + 6;
364
+             $YPos    = $this->pChartObject->GraphAreaY1 + ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1)/2;
365
+             $Bounds  = $this->pChartObject->drawText($XPos, $YPos, $AxisSettings["Name"], array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE, "Angle"=>270));
366 366
              $MaxLeft = $Bounds[2]["X"];
367 367
 
368 368
              $this->pDataObject->Data["GraphArea"]["X2"] = $MaxLeft + $this->pChartObject->FontSize;
@@ -377,64 +377,64 @@  discard block
 block discarded – undo
377 377
     }
378 378
 
379 379
    /* Draw a scatter plot chart */
380
-   function drawScatterPlotChart($Format=NULL)
380
+   function drawScatterPlotChart($Format = NULL)
381 381
     {
382
-     $PlotSize		= isset($Format["PlotSize"]) ? $Format["PlotSize"] : 3;
383
-     $PlotBorder	= isset($Format["PlotBorder"]) ? $Format["PlotBorder"] : FALSE;
382
+     $PlotSize = isset($Format["PlotSize"]) ? $Format["PlotSize"] : 3;
383
+     $PlotBorder = isset($Format["PlotBorder"]) ? $Format["PlotBorder"] : FALSE;
384 384
      $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 250;
385 385
      $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 250;
386 386
      $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 250;
387 387
      $BorderAlpha	= isset($Format["BorderAlpha"]) ? $Format["BorderAlpha"] : 30;
388
-     $BorderSize	= isset($Format["BorderSize"]) ? $Format["BorderSize"] : 1;
388
+     $BorderSize = isset($Format["BorderSize"]) ? $Format["BorderSize"] : 1;
389 389
      $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
390
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
391
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
390
+     $RecordImageMap = isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
391
+     $ImageMapTitle = isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
392 392
      $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
393 393
 
394 394
      $Data    = $this->pDataObject->getData();
395 395
      $Palette = $this->pDataObject->getPalette();
396 396
 
397
-     $BorderColor = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha);
397
+     $BorderColor = array("R"=>$BorderR, "G"=>$BorderG, "B"=>$BorderB, "Alpha"=>$BorderAlpha);
398 398
 
399
-     foreach($Data["ScatterSeries"] as $Key => $Series)
399
+     foreach ($Data["ScatterSeries"] as $Key => $Series)
400 400
       {
401
-       if ( $Series["isDrawable"] == TRUE )
401
+       if ($Series["isDrawable"] == TRUE)
402 402
         {
403 403
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
404 404
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
405 405
 
406
-         if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
406
+         if ($ImageMapTitle == NULL) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
407 407
          
408
-         if ( isset($Series["Picture"]) && $Series["Picture"] != "" )
409
-          { $Picture = $Series["Picture"]; list($PicWidth,$PicHeight,$PicType) = $this->pChartObject->getPicInfo($Picture); }
408
+         if (isset($Series["Picture"]) && $Series["Picture"] != "")
409
+          { $Picture = $Series["Picture"]; list($PicWidth, $PicHeight, $PicType) = $this->pChartObject->getPicInfo($Picture); }
410 410
          else
411 411
           { $Picture = NULL; }
412 412
 
413
-         $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
414
-         if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
415
-         $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
416
-         if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
413
+         $PosArrayX = $this->getPosArray($SerieValuesX, $SerieXAxis);
414
+         if (!is_array($PosArrayX)) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
415
+         $PosArrayY = $this->getPosArray($SerieValuesY, $SerieYAxis);
416
+         if (!is_array($PosArrayY)) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
417 417
 
418
-         $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
418
+         $Color = array("R"=>$Series["Color"]["R"], "G"=>$Series["Color"]["G"], "B"=>$Series["Color"]["B"], "Alpha"=>$Series["Color"]["Alpha"]);
419 419
 
420
-         foreach($PosArrayX as $Key => $Value)
420
+         foreach ($PosArrayX as $Key => $Value)
421 421
           {
422 422
            $X = $Value; $Y = $PosArrayY[$Key];
423 423
 
424
-           if ( $X != VOID && $Y != VOID )
424
+           if ($X != VOID && $Y != VOID)
425 425
             {
426
-             $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
427
-             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); }
426
+             $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key], 2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key], 2);
427
+             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 428
 
429
-             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 )
429
+             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)
432 432
               {
433
-               if ( $PlotBorder ) { $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize+$BorderSize,$BorderColor); }
434
-               $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize,$Color);
433
+               if ($PlotBorder) { $this->pChartObject->drawFilledCircle($X, $Y, $PlotSize + $BorderSize, $BorderColor); }
434
+               $this->pChartObject->drawFilledCircle($X, $Y, $PlotSize, $Color);
435 435
               }
436 436
              else
437
-              { $this->pChartObject->drawFromPicture($PicType,$Picture,$X-$PicWidth/2,$Y-$PicHeight/2); }
437
+              { $this->pChartObject->drawFromPicture($PicType, $Picture, $X - $PicWidth/2, $Y - $PicHeight/2); }
438 438
             }
439 439
           }
440 440
         }
@@ -442,49 +442,49 @@  discard block
 block discarded – undo
442 442
     }
443 443
 
444 444
    /* Draw a scatter line chart */
445
-   function drawScatterLineChart($Format=NULL)
445
+   function drawScatterLineChart($Format = NULL)
446 446
     {
447
-     $Data		= $this->pDataObject->getData();
448
-     $Palette		= $this->pDataObject->getPalette();
449
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
450
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
451
-     $ImageMapPlotSize	= isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
447
+     $Data = $this->pDataObject->getData();
448
+     $Palette = $this->pDataObject->getPalette();
449
+     $RecordImageMap = isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
450
+     $ImageMapTitle = isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
451
+     $ImageMapPlotSize = isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
452 452
      $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
453 453
 
454 454
      /* Parse all the series to draw */
455
-     foreach($Data["ScatterSeries"] as $Key => $Series)
455
+     foreach ($Data["ScatterSeries"] as $Key => $Series)
456 456
       {
457
-       if ( $Series["isDrawable"] == TRUE )
457
+       if ($Series["isDrawable"] == TRUE)
458 458
         {
459 459
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
460 460
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
461 461
          $Ticks  = $Series["Ticks"];
462 462
          $Weight = $Series["Weight"];
463 463
 
464
-         if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
464
+         if ($ImageMapTitle == NULL) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
465 465
 
466
-         $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
467
-         if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
468
-         $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
469
-         if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
466
+         $PosArrayX = $this->getPosArray($SerieValuesX, $SerieXAxis);
467
+         if (!is_array($PosArrayX)) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
468
+         $PosArrayY = $this->getPosArray($SerieValuesY, $SerieYAxis);
469
+         if (!is_array($PosArrayY)) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
470 470
 
471
-         $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
472
-         if ( $Ticks != 0 )  { $Color["Ticks"]  = $Ticks; }
473
-         if ( $Weight != 0 ) { $Color["Weight"] = $Weight; }
471
+         $Color = array("R"=>$Series["Color"]["R"], "G"=>$Series["Color"]["G"], "B"=>$Series["Color"]["B"], "Alpha"=>$Series["Color"]["Alpha"]);
472
+         if ($Ticks != 0) { $Color["Ticks"]  = $Ticks; }
473
+         if ($Weight != 0) { $Color["Weight"] = $Weight; }
474 474
 
475 475
          $LastX = VOID; $LastY = VOID;
476
-         foreach($PosArrayX as $Key => $Value)
476
+         foreach ($PosArrayX as $Key => $Value)
477 477
           {
478 478
            $X = $Value; $Y = $PosArrayY[$Key];
479 479
 
480
-           if ( $X != VOID && $Y != VOID )
480
+           if ($X != VOID && $Y != VOID)
481 481
             {
482
-             $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
483
-             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); }
482
+             $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key], 2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key], 2);
483
+             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 484
             }
485 485
 
486
-           if ( $X != VOID && $Y != VOID && $LastX != VOID && $LastY != VOID)
487
-            $this->pChartObject->drawLine($LastX,$LastY,$X,$Y,$Color);
486
+           if ($X != VOID && $Y != VOID && $LastX != VOID && $LastY != VOID)
487
+            $this->pChartObject->drawLine($LastX, $LastY, $X, $Y, $Color);
488 488
 
489 489
            $LastX = $X; $LastY = $Y;
490 490
           }
@@ -493,249 +493,249 @@  discard block
 block discarded – undo
493 493
     }
494 494
 
495 495
    /* Draw a scatter spline chart */
496
-   function drawScatterSplineChart($Format=NULL)
496
+   function drawScatterSplineChart($Format = NULL)
497 497
     {
498
-     $Data		= $this->pDataObject->getData();
499
-     $Palette		= $this->pDataObject->getPalette();
500
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
501
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
502
-     $ImageMapPlotSize	= isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
498
+     $Data = $this->pDataObject->getData();
499
+     $Palette = $this->pDataObject->getPalette();
500
+     $RecordImageMap = isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
501
+     $ImageMapTitle = isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
502
+     $ImageMapPlotSize = isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
503 503
      $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
504 504
 
505
-     foreach($Data["ScatterSeries"] as $Key => $Series)
505
+     foreach ($Data["ScatterSeries"] as $Key => $Series)
506 506
       {
507
-       if ( $Series["isDrawable"] == TRUE )
507
+       if ($Series["isDrawable"] == TRUE)
508 508
         {
509 509
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
510 510
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
511 511
          $Ticks  = $Series["Ticks"];
512 512
          $Weight = $Series["Weight"];
513 513
 
514
-         if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
514
+         if ($ImageMapTitle == NULL) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
515 515
 
516
-         $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
517
-         if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
518
-         $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
519
-         if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
516
+         $PosArrayX = $this->getPosArray($SerieValuesX, $SerieXAxis);
517
+         if (!is_array($PosArrayX)) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
518
+         $PosArrayY = $this->getPosArray($SerieValuesY, $SerieYAxis);
519
+         if (!is_array($PosArrayY)) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
520 520
 
521
-         $SplineSettings = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
522
-         if ( $Ticks != 0 )  { $SplineSettings["Ticks"]  = $Ticks; }
523
-         if ( $Weight != 0 ) { $SplineSettings["Weight"] = $Weight; }
521
+         $SplineSettings = array("R"=>$Series["Color"]["R"], "G"=>$Series["Color"]["G"], "B"=>$Series["Color"]["B"], "Alpha"=>$Series["Color"]["Alpha"]);
522
+         if ($Ticks != 0) { $SplineSettings["Ticks"]  = $Ticks; }
523
+         if ($Weight != 0) { $SplineSettings["Weight"] = $Weight; }
524 524
 
525 525
          $LastX = VOID; $LastY = VOID; $WayPoints = ""; $Forces = "";
526
-         foreach($PosArrayX as $Key => $Value)
526
+         foreach ($PosArrayX as $Key => $Value)
527 527
           {
528 528
            $X = $Value; $Y = $PosArrayY[$Key];
529
-           $Force = $this->pChartObject->getLength($LastX,$LastY,$X,$Y)/5;
529
+           $Force = $this->pChartObject->getLength($LastX, $LastY, $X, $Y)/5;
530 530
 
531
-           if ( $X != VOID && $Y != VOID )
531
+           if ($X != VOID && $Y != VOID)
532 532
             {
533
-             $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
534
-             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); }
533
+             $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key], 2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key], 2);
534
+             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); }
535 535
             }
536 536
 
537
-           if ( $X != VOID && $Y != VOID )
538
-            { $WayPoints[] = array($X,$Y); $Forces[] = $Force; }
537
+           if ($X != VOID && $Y != VOID)
538
+            { $WayPoints[] = array($X, $Y); $Forces[] = $Force; }
539 539
 
540
-           if ( $Y == VOID || $X == VOID )
541
-            { $SplineSettings["Forces"] = $Forces; $this->pChartObject->drawSpline($WayPoints,$SplineSettings); $WayPoints = ""; $Forces = "";}
540
+           if ($Y == VOID || $X == VOID)
541
+            { $SplineSettings["Forces"] = $Forces; $this->pChartObject->drawSpline($WayPoints, $SplineSettings); $WayPoints = ""; $Forces = ""; }
542 542
 
543 543
            $LastX = $X; $LastY = $Y;
544 544
           }
545 545
          $SplineSettings["Forces"] = $Forces; 
546
-         $this->pChartObject->drawSpline($WayPoints,$SplineSettings);
546
+         $this->pChartObject->drawSpline($WayPoints, $SplineSettings);
547 547
         }
548 548
       }
549 549
     }
550 550
 
551 551
    /* Return the scaled plot position */
552
-   function getPosArray($Values,$AxisID)
552
+   function getPosArray($Values, $AxisID)
553 553
     {
554 554
      $Data = $this->pDataObject->getData();
555 555
 
556
-     if ( !is_array($Values) ) { $Values = array($Values); }
556
+     if (!is_array($Values)) { $Values = array($Values); }
557 557
 
558
-     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
558
+     if ($Data["Axis"][$AxisID]["Identity"] == AXIS_X)
559 559
       {
560 560
        $Height      = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $Data["Axis"][$AxisID]["Margin"]*2;
561 561
        $ScaleHeight = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"];
562
-       $Step        = $Height / $ScaleHeight;
562
+       $Step        = $Height/$ScaleHeight;
563 563
 
564 564
        $Result = "";
565
-       foreach($Values as $Key => $Value)
565
+       foreach ($Values as $Key => $Value)
566 566
         {
567
-         if ( $Value == VOID ) 
567
+         if ($Value == VOID) 
568 568
           $Result[] = VOID;
569 569
          else
570
-          $Result[] = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + ($Step * ($Value-$Data["Axis"][$AxisID]["ScaleMin"]));
570
+          $Result[] = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + ($Step*($Value - $Data["Axis"][$AxisID]["ScaleMin"]));
571 571
         }
572 572
 
573
-       if ( count($Result) == 1 ) { return($Result[0]); } else { return($Result); }
573
+       if (count($Result) == 1) { return($Result[0]); } else { return($Result); }
574 574
       }
575 575
      else
576 576
       {
577 577
        $Height      = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $Data["Axis"][$AxisID]["Margin"]*2;
578 578
        $ScaleHeight = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"];
579
-       $Step        = $Height / $ScaleHeight;
579
+       $Step        = $Height/$ScaleHeight;
580 580
 
581 581
        $Result = "";
582
-       foreach($Values as $Key => $Value)
582
+       foreach ($Values as $Key => $Value)
583 583
         {
584
-         if ( $Value == VOID ) 
584
+         if ($Value == VOID) 
585 585
           $Result[] = VOID;
586 586
          else
587
-          $Result[] = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - ($Step * ($Value-$Data["Axis"][$AxisID]["ScaleMin"]));
587
+          $Result[] = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - ($Step*($Value - $Data["Axis"][$AxisID]["ScaleMin"]));
588 588
         }
589 589
 
590
-       if ( count($Result) == 1 ) { return($Result[0]); } else { return($Result); }
590
+       if (count($Result) == 1) { return($Result[0]); } else { return($Result); }
591 591
       }
592 592
     }
593 593
 
594 594
    /* Draw the legend of the active series */
595
-   function drawScatterLegend($X,$Y,$Format="")
595
+   function drawScatterLegend($X, $Y, $Format = "")
596 596
     {
597
-     $Family		= isset($Format["Family"]) ? $Format["Family"] : LEGEND_FAMILY_BOX;
597
+     $Family = isset($Format["Family"]) ? $Format["Family"] : LEGEND_FAMILY_BOX;
598 598
      $FontName		= isset($Format["FontName"]) ? $Format["FontName"] : $this->pChartObject->FontName;
599 599
      $FontSize		= isset($Format["FontSize"]) ? $Format["FontSize"] : $this->pChartObject->FontSize;
600 600
      $FontR		= isset($Format["FontR"]) ? $Format["FontR"] : $this->pChartObject->FontColorR;
601 601
      $FontG		= isset($Format["FontG"]) ? $Format["FontG"] : $this->pChartObject->FontColorG;
602 602
      $FontB		= isset($Format["FontB"]) ? $Format["FontB"] : $this->pChartObject->FontColorB;
603
-     $BoxWidth		= isset($Format["BoxWidth"]) ? $Format["BoxWidth"] : 5;
604
-     $BoxHeight		= isset($Format["BoxHeight"]) ? $Format["BoxHeight"] : 5;
605
-     $IconAreaWidth	= isset($Format["IconAreaWidth"]) ? $Format["IconAreaWidth"] : $BoxWidth;
606
-     $IconAreaHeight	= isset($Format["IconAreaHeight"]) ? $Format["IconAreaHeight"] : $BoxHeight;
607
-     $XSpacing		= isset($Format["XSpacing"]) ? $Format["XSpacing"] : 5;
608
-     $Margin		= isset($Format["Margin"]) ? $Format["Margin"] : 5;
603
+     $BoxWidth = isset($Format["BoxWidth"]) ? $Format["BoxWidth"] : 5;
604
+     $BoxHeight = isset($Format["BoxHeight"]) ? $Format["BoxHeight"] : 5;
605
+     $IconAreaWidth = isset($Format["IconAreaWidth"]) ? $Format["IconAreaWidth"] : $BoxWidth;
606
+     $IconAreaHeight = isset($Format["IconAreaHeight"]) ? $Format["IconAreaHeight"] : $BoxHeight;
607
+     $XSpacing = isset($Format["XSpacing"]) ? $Format["XSpacing"] : 5;
608
+     $Margin = isset($Format["Margin"]) ? $Format["Margin"] : 5;
609 609
      $R			= isset($Format["R"]) ? $Format["R"] : 200;
610 610
      $G			= isset($Format["G"]) ? $Format["G"] : 200;
611 611
      $B			= isset($Format["B"]) ? $Format["B"] : 200;
612
-     $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : 100;
612
+     $Alpha = isset($Format["Alpha"]) ? $Format["Alpha"] : 100;
613 613
      $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 255;
614 614
      $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 255;
615 615
      $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 255;
616
-     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
617
-     $Style		= isset($Format["Style"]) ? $Format["Style"] : LEGEND_ROUND;
618
-     $Mode		= isset($Format["Mode"]) ? $Format["Mode"] : LEGEND_VERTICAL;
616
+     $Surrounding = isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
617
+     $Style = isset($Format["Style"]) ? $Format["Style"] : LEGEND_ROUND;
618
+     $Mode = isset($Format["Mode"]) ? $Format["Mode"] : LEGEND_VERTICAL;
619 619
 
620
-     if ( $Surrounding != NULL ) { $BorderR = $R + $Surrounding; $BorderG = $G + $Surrounding; $BorderB = $B + $Surrounding; }
620
+     if ($Surrounding != NULL) { $BorderR = $R + $Surrounding; $BorderG = $G + $Surrounding; $BorderB = $B + $Surrounding; }
621 621
 
622 622
      $Data = $this->pDataObject->getData();
623 623
 
624
-     foreach($Data["ScatterSeries"] as $Key => $Series)
624
+     foreach ($Data["ScatterSeries"] as $Key => $Series)
625 625
       {
626
-       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
626
+       if ($Series["isDrawable"] == TRUE && isset($Series["Picture"]))
627 627
         {
628
-         list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
629
-         if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
630
-         if ( $IconAreaHeight < $PicHeight ) { $IconAreaHeight = $PicHeight; }
628
+         list($PicWidth, $PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
629
+         if ($IconAreaWidth < $PicWidth) { $IconAreaWidth = $PicWidth; }
630
+         if ($IconAreaHeight < $PicHeight) { $IconAreaHeight = $PicHeight; }
631 631
         }
632 632
       }
633 633
 
634
-     $YStep = max($this->pChartObject->FontSize,$IconAreaHeight) + 5;
634
+     $YStep = max($this->pChartObject->FontSize, $IconAreaHeight) + 5;
635 635
      $XStep = $IconAreaWidth + 5;
636 636
      $XStep = $XSpacing;
637 637
 
638 638
      $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
639
-     foreach($Data["ScatterSeries"] as $Key => $Series)
639
+     foreach ($Data["ScatterSeries"] as $Key => $Series)
640 640
       {
641
-       if ( $Series["isDrawable"] == TRUE )
641
+       if ($Series["isDrawable"] == TRUE)
642 642
         {
643
-         if ( $Mode == LEGEND_VERTICAL )
643
+         if ($Mode == LEGEND_VERTICAL)
644 644
           {
645
-           $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+4,$vY+$IconAreaHeight/2,$FontName,$FontSize,0,$Series["Description"]);
645
+           $BoxArray = $this->pChartObject->getTextBox($vX + $IconAreaWidth + 4, $vY + $IconAreaHeight/2, $FontName, $FontSize, 0, $Series["Description"]);
646 646
 
647
-           if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
648
-           if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
649
-           if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
647
+           if ($Boundaries["T"] > $BoxArray[2]["Y"] + $IconAreaHeight/2) { $Boundaries["T"] = $BoxArray[2]["Y"] + $IconAreaHeight/2; }
648
+           if ($Boundaries["R"] < $BoxArray[1]["X"] + 2) { $Boundaries["R"] = $BoxArray[1]["X"] + 2; }
649
+           if ($Boundaries["B"] < $BoxArray[1]["Y"] + 2 + $IconAreaHeight/2) { $Boundaries["B"] = $BoxArray[1]["Y"] + 2 + $IconAreaHeight/2; }
650 650
 
651
-           $Lines = preg_split("/\n/",$Series["Description"]);
652
-           $vY = $vY + max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
651
+           $Lines = preg_split("/\n/", $Series["Description"]);
652
+           $vY = $vY + max($this->pChartObject->FontSize*count($Lines), $IconAreaHeight) + 5;
653 653
           }
654
-         elseif ( $Mode == LEGEND_HORIZONTAL )
654
+         elseif ($Mode == LEGEND_HORIZONTAL)
655 655
           {
656
-           $Lines = preg_split("/\n/",$Series["Description"]);
656
+           $Lines = preg_split("/\n/", $Series["Description"]);
657 657
            $Width = "";
658
-           foreach($Lines as $Key => $Value)
658
+           foreach ($Lines as $Key => $Value)
659 659
             {
660
-             $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+6,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$FontName,$FontSize,0,$Value);
660
+             $BoxArray = $this->pChartObject->getTextBox($vX + $IconAreaWidth + 6, $Y + $IconAreaHeight/2 + (($this->pChartObject->FontSize + 3)*$Key), $FontName, $FontSize, 0, $Value);
661 661
 
662
-             if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
663
-             if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
664
-             if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
662
+             if ($Boundaries["T"] > $BoxArray[2]["Y"] + $IconAreaHeight/2) { $Boundaries["T"] = $BoxArray[2]["Y"] + $IconAreaHeight/2; }
663
+             if ($Boundaries["R"] < $BoxArray[1]["X"] + 2) { $Boundaries["R"] = $BoxArray[1]["X"] + 2; }
664
+             if ($Boundaries["B"] < $BoxArray[1]["Y"] + 2 + $IconAreaHeight/2) { $Boundaries["B"] = $BoxArray[1]["Y"] + 2 + $IconAreaHeight/2; }
665 665
 
666 666
              $Width[] = $BoxArray[1]["X"];
667 667
             }
668 668
 
669
-           $vX=max($Width)+$XStep;
669
+           $vX = max($Width) + $XStep;
670 670
           }
671 671
         }
672 672
       }
673
-     $vY=$vY-$YStep; $vX=$vX-$XStep;
673
+     $vY = $vY - $YStep; $vX = $vX - $XStep;
674 674
 
675
-     $TopOffset  = $Y - $Boundaries["T"];
676
-     if ( $Boundaries["B"]-($vY+$IconAreaHeight) < $TopOffset ) { $Boundaries["B"] = $vY+$IconAreaHeight+$TopOffset; }
675
+     $TopOffset = $Y - $Boundaries["T"];
676
+     if ($Boundaries["B"] - ($vY + $IconAreaHeight) < $TopOffset) { $Boundaries["B"] = $vY + $IconAreaHeight + $TopOffset; }
677 677
 
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));
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));
682 682
 
683 683
      $RestoreShadow = $this->pChartObject->Shadow; $this->Shadow = FALSE;
684
-     foreach($Data["ScatterSeries"] as $Key => $Series)
684
+     foreach ($Data["ScatterSeries"] as $Key => $Series)
685 685
       {
686
-       if ( $Series["isDrawable"] == TRUE )
686
+       if ($Series["isDrawable"] == TRUE)
687 687
         {
688 688
          $R = $Series["Color"]["R"]; $G = $Series["Color"]["G"]; $B = $Series["Color"]["B"];
689 689
          $Ticks = $Series["Ticks"]; $Weight = $Series["Weight"];
690 690
 
691
-         if ( isset($Series["Picture"]) )
691
+         if (isset($Series["Picture"]))
692 692
           {
693 693
            $Picture = $Series["Picture"];
694
-           list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Picture);
695
-           $PicX = $X+$IconAreaWidth/2; $PicY = $Y+$IconAreaHeight/2; 
694
+           list($PicWidth, $PicHeight) = $this->pChartObject->getPicInfo($Picture);
695
+           $PicX = $X + $IconAreaWidth/2; $PicY = $Y + $IconAreaHeight/2; 
696 696
 
697
-           $this->pChartObject->drawFromPNG($PicX-$PicWidth/2,$PicY-$PicHeight/2,$Picture);
697
+           $this->pChartObject->drawFromPNG($PicX - $PicWidth/2, $PicY - $PicHeight/2, $Picture);
698 698
           }
699 699
          else
700 700
           {
701
-           if ( $Family == LEGEND_FAMILY_BOX )
701
+           if ($Family == LEGEND_FAMILY_BOX)
702 702
             {
703
-             if ( $BoxWidth != $IconAreaWidth ) { $XOffset = floor(($IconAreaWidth-$BoxWidth)/2); } else { $XOffset = 0; }
704
-             if ( $BoxHeight != $IconAreaHeight ) { $YOffset = floor(($IconAreaHeight-$BoxHeight)/2); } else { $YOffset = 0; }
703
+             if ($BoxWidth != $IconAreaWidth) { $XOffset = floor(($IconAreaWidth - $BoxWidth)/2); } else { $XOffset = 0; }
704
+             if ($BoxHeight != $IconAreaHeight) { $YOffset = floor(($IconAreaHeight - $BoxHeight)/2); } else { $YOffset = 0; }
705 705
 
706
-             $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
-             $this->pChartObject->drawFilledRectangle($X+$XOffset,$Y+$YOffset,$X+$BoxWidth+$XOffset,$Y+$BoxHeight+$YOffset,array("R"=>$R,"G"=>$G,"B"=>$B,"Surrounding"=>20));
706
+             $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
+             $this->pChartObject->drawFilledRectangle($X + $XOffset, $Y + $YOffset, $X + $BoxWidth + $XOffset, $Y + $BoxHeight + $YOffset, array("R"=>$R, "G"=>$G, "B"=>$B, "Surrounding"=>20));
708 708
             }
709
-           elseif ( $Family == LEGEND_FAMILY_CIRCLE )
709
+           elseif ($Family == LEGEND_FAMILY_CIRCLE)
710 710
             {
711
-             $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
-             $this->pChartObject->drawFilledCircle($X+$IconAreaWidth/2,$Y+$IconAreaHeight/2,min($IconAreaHeight/2,$IconAreaWidth/2),array("R"=>$R,"G"=>$G,"B"=>$B,"Surrounding"=>20));
711
+             $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
+             $this->pChartObject->drawFilledCircle($X + $IconAreaWidth/2, $Y + $IconAreaHeight/2, min($IconAreaHeight/2, $IconAreaWidth/2), array("R"=>$R, "G"=>$G, "B"=>$B, "Surrounding"=>20));
713 713
             }
714
-           elseif ( $Family == LEGEND_FAMILY_LINE )
714
+           elseif ($Family == LEGEND_FAMILY_LINE)
715 715
             {
716
-             $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
-             $this->pChartObject->drawLine($X,$Y+$IconAreaHeight/2,$X+$IconAreaWidth,$Y+$IconAreaHeight/2,array("R"=>$R,"G"=>$G,"B"=>$B,"Ticks"=>$Ticks,"Weight"=>$Weight));
716
+             $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
+             $this->pChartObject->drawLine($X, $Y + $IconAreaHeight/2, $X + $IconAreaWidth, $Y + $IconAreaHeight/2, array("R"=>$R, "G"=>$G, "B"=>$B, "Ticks"=>$Ticks, "Weight"=>$Weight));
718 718
             }
719 719
           }
720 720
 
721
-         if ( $Mode == LEGEND_VERTICAL )
721
+         if ($Mode == LEGEND_VERTICAL)
722 722
           {
723
-           $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));
723
+           $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));
726 726
 
727
-           $Y=$Y+max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
727
+           $Y = $Y + max($this->pChartObject->FontSize*count($Lines), $IconAreaHeight) + 5;
728 728
           }
729
-         elseif ( $Mode == LEGEND_HORIZONTAL )
729
+         elseif ($Mode == LEGEND_HORIZONTAL)
730 730
           {
731
-           $Lines = preg_split("/\n/",$Series["Description"]);
731
+           $Lines = preg_split("/\n/", $Series["Description"]);
732 732
            $Width = "";
733
-           foreach($Lines as $Key => $Value)
733
+           foreach ($Lines as $Key => $Value)
734 734
             {
735
-             $BoxArray = $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));
735
+             $BoxArray = $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));
736 736
              $Width[] = $BoxArray[1]["X"];
737 737
             }
738
-           $X=max($Width)+2+$XStep;
738
+           $X = max($Width) + 2 + $XStep;
739 739
           }
740 740
         }
741 741
       }
@@ -744,104 +744,104 @@  discard block
 block discarded – undo
744 744
     }
745 745
 
746 746
    /* Get the legend box size */
747
-   function getScatterLegendSize($Format="")
747
+   function getScatterLegendSize($Format = "")
748 748
     {
749 749
      $FontName	= isset($Format["FontName"]) ? $Format["FontName"] : $this->pChartObject->FontName;
750 750
      $FontSize	= isset($Format["FontSize"]) ? $Format["FontSize"] : $this->pChartObject->FontSize;
751
-     $BoxSize	= isset($Format["BoxSize"]) ? $Format["BoxSize"] : 5;
752
-     $Margin	= isset($Format["Margin"]) ? $Format["Margin"] : 5;
751
+     $BoxSize = isset($Format["BoxSize"]) ? $Format["BoxSize"] : 5;
752
+     $Margin = isset($Format["Margin"]) ? $Format["Margin"] : 5;
753 753
      $Style	= isset($Format["Style"]) ? $Format["Style"] : LEGEND_ROUND;
754
-     $Mode	= isset($Format["Mode"]) ? $Format["Mode"] : LEGEND_VERTICAL;
754
+     $Mode = isset($Format["Mode"]) ? $Format["Mode"] : LEGEND_VERTICAL;
755 755
 
756
-     $YStep = max($this->pChartObject->FontSize,$BoxSize) + 5;
756
+     $YStep = max($this->pChartObject->FontSize, $BoxSize) + 5;
757 757
      $XStep = $BoxSize + 5;
758 758
 
759
-     $X=100; $Y=100;
759
+     $X = 100; $Y = 100;
760 760
 
761 761
      $Data = $this->pDataObject->getData();
762 762
 
763
-     foreach($Data["ScatterSeries"] as $Key => $Series)
763
+     foreach ($Data["ScatterSeries"] as $Key => $Series)
764 764
       {
765
-       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
765
+       if ($Series["isDrawable"] == TRUE && isset($Series["Picture"]))
766 766
         {
767
-         list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
768
-         if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
769
-         if ( $IconAreaHeight < $PicHeight ) { $IconAreaHeight = $PicHeight; }
767
+         list($PicWidth, $PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
768
+         if ($IconAreaWidth < $PicWidth) { $IconAreaWidth = $PicWidth; }
769
+         if ($IconAreaHeight < $PicHeight) { $IconAreaHeight = $PicHeight; }
770 770
         }
771 771
       }
772 772
 
773
-     $YStep = max($this->pChartObject->FontSize,$IconAreaHeight) + 5;
773
+     $YStep = max($this->pChartObject->FontSize, $IconAreaHeight) + 5;
774 774
      $XStep = $IconAreaWidth + 5;
775 775
      $XStep = $XSpacing;
776 776
 
777 777
      $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
778
-     foreach($Data["ScatterSeries"] as $Key => $Series)
778
+     foreach ($Data["ScatterSeries"] as $Key => $Series)
779 779
       {
780
-       if ( $Series["isDrawable"] == TRUE )
780
+       if ($Series["isDrawable"] == TRUE)
781 781
         {
782
-         if ( $Mode == LEGEND_VERTICAL )
782
+         if ($Mode == LEGEND_VERTICAL)
783 783
           {
784
-           $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+4,$vY+$IconAreaHeight/2,$FontName,$FontSize,0,$Series["Description"]);
784
+           $BoxArray = $this->pChartObject->getTextBox($vX + $IconAreaWidth + 4, $vY + $IconAreaHeight/2, $FontName, $FontSize, 0, $Series["Description"]);
785 785
 
786
-           if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
787
-           if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
788
-           if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
786
+           if ($Boundaries["T"] > $BoxArray[2]["Y"] + $IconAreaHeight/2) { $Boundaries["T"] = $BoxArray[2]["Y"] + $IconAreaHeight/2; }
787
+           if ($Boundaries["R"] < $BoxArray[1]["X"] + 2) { $Boundaries["R"] = $BoxArray[1]["X"] + 2; }
788
+           if ($Boundaries["B"] < $BoxArray[1]["Y"] + 2 + $IconAreaHeight/2) { $Boundaries["B"] = $BoxArray[1]["Y"] + 2 + $IconAreaHeight/2; }
789 789
 
790
-           $Lines = preg_split("/\n/",$Series["Description"]);
791
-           $vY = $vY + max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
790
+           $Lines = preg_split("/\n/", $Series["Description"]);
791
+           $vY = $vY + max($this->pChartObject->FontSize*count($Lines), $IconAreaHeight) + 5;
792 792
           }
793
-         elseif ( $Mode == LEGEND_HORIZONTAL )
793
+         elseif ($Mode == LEGEND_HORIZONTAL)
794 794
           {
795
-           $Lines = preg_split("/\n/",$Series["Description"]);
795
+           $Lines = preg_split("/\n/", $Series["Description"]);
796 796
            $Width = "";
797
-           foreach($Lines as $Key => $Value)
797
+           foreach ($Lines as $Key => $Value)
798 798
             {
799
-             $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+6,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$FontName,$FontSize,0,$Value);
799
+             $BoxArray = $this->pChartObject->getTextBox($vX + $IconAreaWidth + 6, $Y + $IconAreaHeight/2 + (($this->pChartObject->FontSize + 3)*$Key), $FontName, $FontSize, 0, $Value);
800 800
 
801
-             if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
802
-             if ( $Boundaries["R"] < $BoxArray[1]["X"]+2 ) { $Boundaries["R"] = $BoxArray[1]["X"]+2; }
803
-             if ( $Boundaries["B"] < $BoxArray[1]["Y"]+2+$IconAreaHeight/2 ) { $Boundaries["B"] = $BoxArray[1]["Y"]+2+$IconAreaHeight/2; }
801
+             if ($Boundaries["T"] > $BoxArray[2]["Y"] + $IconAreaHeight/2) { $Boundaries["T"] = $BoxArray[2]["Y"] + $IconAreaHeight/2; }
802
+             if ($Boundaries["R"] < $BoxArray[1]["X"] + 2) { $Boundaries["R"] = $BoxArray[1]["X"] + 2; }
803
+             if ($Boundaries["B"] < $BoxArray[1]["Y"] + 2 + $IconAreaHeight/2) { $Boundaries["B"] = $BoxArray[1]["Y"] + 2 + $IconAreaHeight/2; }
804 804
 
805 805
              $Width[] = $BoxArray[1]["X"];
806 806
             }
807 807
 
808
-           $vX=max($Width)+$XStep;
808
+           $vX = max($Width) + $XStep;
809 809
           }
810 810
         }
811 811
       }
812
-     $vY=$vY-$YStep; $vX=$vX-$XStep;
812
+     $vY = $vY - $YStep; $vX = $vX - $XStep;
813 813
 
814
-     $TopOffset  = $Y - $Boundaries["T"];
815
-     if ( $Boundaries["B"]-($vY+$BoxSize) < $TopOffset ) { $Boundaries["B"] = $vY+$BoxSize+$TopOffset; }
814
+     $TopOffset = $Y - $Boundaries["T"];
815
+     if ($Boundaries["B"] - ($vY + $BoxSize) < $TopOffset) { $Boundaries["B"] = $vY + $BoxSize + $TopOffset; }
816 816
 
817
-     $Width  = ($Boundaries["R"]+$Margin) - ($Boundaries["L"]-$Margin);
818
-     $Height = ($Boundaries["B"]+$Margin) - ($Boundaries["T"]-$Margin);
817
+     $Width  = ($Boundaries["R"] + $Margin) - ($Boundaries["L"] - $Margin);
818
+     $Height = ($Boundaries["B"] + $Margin) - ($Boundaries["T"] - $Margin);
819 819
 
820
-     return(array("Width"=>$Width,"Height"=>$Height));
820
+     return(array("Width"=>$Width, "Height"=>$Height));
821 821
     }
822 822
 
823 823
    /* Draw the line of best fit */
824
-   function drawScatterBestFit($Format="")
824
+   function drawScatterBestFit($Format = "")
825 825
     {
826
-     $Ticks	= isset($Format["Ticks"]) ? $Format["Ticks"] : 0;
826
+     $Ticks = isset($Format["Ticks"]) ? $Format["Ticks"] : 0;
827 827
 
828
-     $Data    = $this->pDataObject->getData();
828
+     $Data = $this->pDataObject->getData();
829 829
 
830
-     foreach($Data["ScatterSeries"] as $Key => $Series)
830
+     foreach ($Data["ScatterSeries"] as $Key => $Series)
831 831
       {
832
-       if ( $Series["isDrawable"] == TRUE )
832
+       if ($Series["isDrawable"] == TRUE)
833 833
         {
834 834
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
835 835
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
836 836
 
837
-         $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
837
+         $Color = array("R"=>$Series["Color"]["R"], "G"=>$Series["Color"]["G"], "B"=>$Series["Color"]["B"], "Alpha"=>$Series["Color"]["Alpha"]);
838 838
          $Color["Ticks"] = $Ticks;
839 839
 
840 840
          $PosArrayX = $Data["Series"][$Series["X"]]["Data"];
841 841
          $PosArrayY = $Data["Series"][$Series["Y"]]["Data"];
842 842
 
843 843
          $Sxy = 0; $Sx = 0; $Sy = 0; $Sxx = 0;
844
-         foreach($PosArrayX as $Key => $Value)
844
+         foreach ($PosArrayX as $Key => $Value)
845 845
           {
846 846
            $X = $Value; $Y = $PosArrayY[$Key];
847 847
 
@@ -855,68 +855,68 @@  discard block
 block discarded – undo
855 855
 
856 856
          if ((($n*$Sxx) == ($Sx*$Sx)))
857 857
           {
858
-           $X1 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMin"],$SerieXAxis);
858
+           $X1 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMin"], $SerieXAxis);
859 859
            $X2 = $X1;
860 860
            $Y1 = $this->pChartObject->GraphAreaY1;
861 861
            $Y2 = $this->pChartObject->GraphAreaY2;
862 862
           }
863 863
          else
864 864
           {
865
-           $M = (($n*$Sxy)-($Sx*$Sy)) / (($n*$Sxx)-($Sx*$Sx));
866
-           $B = (($Sy)-($M*$Sx))/($n);
865
+           $M = (($n*$Sxy) - ($Sx*$Sy))/(($n*$Sxx) - ($Sx*$Sx));
866
+           $B = (($Sy) - ($M*$Sx))/($n);
867 867
 
868
-           $X1 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMin"],$SerieXAxis);
869
-           $Y1 = $this->getPosArray($M * $Data["Axis"][$SerieXAxis]["ScaleMin"] + $B,$SerieYAxis);
870
-           $X2 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMax"],$SerieXAxis);
871
-           $Y2 = $this->getPosArray($M * $Data["Axis"][$SerieXAxis]["ScaleMax"] + $B,$SerieYAxis);
868
+           $X1 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMin"], $SerieXAxis);
869
+           $Y1 = $this->getPosArray($M*$Data["Axis"][$SerieXAxis]["ScaleMin"] + $B, $SerieYAxis);
870
+           $X2 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMax"], $SerieXAxis);
871
+           $Y2 = $this->getPosArray($M*$Data["Axis"][$SerieXAxis]["ScaleMax"] + $B, $SerieYAxis);
872 872
 
873
-           $RealM = -($Y2-$Y1)/($X2-$X1);
873
+           $RealM = -($Y2 - $Y1)/($X2 - $X1);
874 874
 
875
-           if ( $Y1 < $this->pChartObject->GraphAreaY1 ) { $X1 = $X1 + ($this->pChartObject->GraphAreaY1-$Y1/$RealM); $Y1 = $this->pChartObject->GraphAreaY1; }
876
-           if ( $Y1 > $this->pChartObject->GraphAreaY2 ) { $X1 = $X1 + ($Y1-$this->pChartObject->GraphAreaY2)/$RealM; $Y1 = $this->pChartObject->GraphAreaY2; }
877
-           if ( $Y2 < $this->pChartObject->GraphAreaY1 ) { $X2 = $X2 - ($this->pChartObject->GraphAreaY1-$Y2)/$RealM; $Y2 = $this->pChartObject->GraphAreaY1; }
878
-           if ( $Y2 > $this->pChartObject->GraphAreaY2 ) { $X2 = $X2 - ($Y2-$this->pChartObject->GraphAreaY2)/$RealM; $Y2 = $this->pChartObject->GraphAreaY2; }
875
+           if ($Y1 < $this->pChartObject->GraphAreaY1) { $X1 = $X1 + ($this->pChartObject->GraphAreaY1 - $Y1/$RealM); $Y1 = $this->pChartObject->GraphAreaY1; }
876
+           if ($Y1 > $this->pChartObject->GraphAreaY2) { $X1 = $X1 + ($Y1 - $this->pChartObject->GraphAreaY2)/$RealM; $Y1 = $this->pChartObject->GraphAreaY2; }
877
+           if ($Y2 < $this->pChartObject->GraphAreaY1) { $X2 = $X2 - ($this->pChartObject->GraphAreaY1 - $Y2)/$RealM; $Y2 = $this->pChartObject->GraphAreaY1; }
878
+           if ($Y2 > $this->pChartObject->GraphAreaY2) { $X2 = $X2 - ($Y2 - $this->pChartObject->GraphAreaY2)/$RealM; $Y2 = $this->pChartObject->GraphAreaY2; }
879 879
           }
880 880
 
881
-         $this->pChartObject->drawLine($X1,$Y1,$X2,$Y2,$Color);
881
+         $this->pChartObject->drawLine($X1, $Y1, $X2, $Y2, $Color);
882 882
         }
883 883
       }
884 884
     }
885 885
 
886
-   function writeScatterLabel($ScatterSerieID,$Points,$Format="")
886
+   function writeScatterLabel($ScatterSerieID, $Points, $Format = "")
887 887
     {
888
-     $OverrideTitle	= isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : NULL;
889
-     $DrawPoint		= isset($Format["DrawPoint"]) ? $Format["DrawPoint"] : LABEL_POINT_BOX;
890
-     $Decimals		= isset($Format["Decimals"]) ? $Format["Decimals"] : NULL;
888
+     $OverrideTitle = isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : NULL;
889
+     $DrawPoint = isset($Format["DrawPoint"]) ? $Format["DrawPoint"] : LABEL_POINT_BOX;
890
+     $Decimals = isset($Format["Decimals"]) ? $Format["Decimals"] : NULL;
891 891
 
892 892
      $Data    = $this->pDataObject->getData();
893 893
      $Palette = $this->pDataObject->getPalette();
894 894
 
895
-     if ( !is_array($Points) ) { $Point = $Points; $Points = ""; $Points[0] = $Point; }
895
+     if (!is_array($Points)) { $Point = $Points; $Points = ""; $Points[0] = $Point; }
896 896
 
897
-     if ( !isset($Data["ScatterSeries"][$ScatterSerieID]) ) 
897
+     if (!isset($Data["ScatterSeries"][$ScatterSerieID])) 
898 898
       return(0);
899 899
 
900 900
      $Series = $Data["ScatterSeries"][$ScatterSerieID];
901 901
      $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
902 902
      $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
903 903
 
904
-     $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
905
-     if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
906
-     $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
907
-     if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
904
+     $PosArrayX = $this->getPosArray($SerieValuesX, $SerieXAxis);
905
+     if (!is_array($PosArrayX)) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
906
+     $PosArrayY = $this->getPosArray($SerieValuesY, $SerieYAxis);
907
+     if (!is_array($PosArrayY)) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
908 908
 
909
-     foreach($Points as $Key => $Point)
909
+     foreach ($Points as $Key => $Point)
910 910
       {
911
-       if ( isset($PosArrayX[$Point]) && isset($PosArrayY[$Point]) )
911
+       if (isset($PosArrayX[$Point]) && isset($PosArrayY[$Point]))
912 912
         {
913 913
          $X = floor($PosArrayX[$Point]);
914 914
          $Y = floor($PosArrayY[$Point]);
915 915
 
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));
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));
920 920
 
921 921
          $Serie = "";
922 922
          $Serie["R"] = $Series["Color"]["R"];
@@ -927,125 +927,125 @@  discard block
 block discarded – undo
927 927
          $XAxisMode   = $Data["Axis"][$SerieXAxis]["Display"];
928 928
          $XAxisFormat = $Data["Axis"][$SerieXAxis]["Format"];
929 929
          $XAxisUnit   = $Data["Axis"][$SerieXAxis]["Unit"];
930
-         if ( $Decimals == NULL ) { $XValue = $SerieValuesX[$Point]; } else { $XValue = round($SerieValuesX[$Point],$Decimals); }
931
-         $XValue      = $this->pChartObject->scaleFormat($XValue,$XAxisMode,$XAxisFormat,$XAxisUnit);
930
+         if ($Decimals == NULL) { $XValue = $SerieValuesX[$Point]; } else { $XValue = round($SerieValuesX[$Point], $Decimals); }
931
+         $XValue      = $this->pChartObject->scaleFormat($XValue, $XAxisMode, $XAxisFormat, $XAxisUnit);
932 932
 
933 933
          $YAxisMode   = $Data["Axis"][$SerieYAxis]["Display"];
934 934
          $YAxisFormat = $Data["Axis"][$SerieYAxis]["Format"];
935 935
          $YAxisUnit   = $Data["Axis"][$SerieYAxis]["Unit"];
936
-         if ( $Decimals == NULL ) { $YValue = $SerieValuesY[$Point]; } else { $YValue = round($SerieValuesY[$Point],$Decimals); }
937
-         $YValue      = $this->pChartObject->scaleFormat($YValue,$YAxisMode,$YAxisFormat,$YAxisUnit);
936
+         if ($Decimals == NULL) { $YValue = $SerieValuesY[$Point]; } else { $YValue = round($SerieValuesY[$Point], $Decimals); }
937
+         $YValue      = $this->pChartObject->scaleFormat($YValue, $YAxisMode, $YAxisFormat, $YAxisUnit);
938 938
 
939 939
          $Caption = $XValue." / ".$YValue;
940 940
 
941
-         if ( isset($Series["Description"]) )
941
+         if (isset($Series["Description"]))
942 942
           $Description = $Series["Description"];
943 943
          else
944 944
           $Description = "No description";
945 945
 
946 946
          $Series = "";
947
-         $Series[] = array("Format"=>$Serie,"Caption"=>$Caption);
947
+         $Series[] = array("Format"=>$Serie, "Caption"=>$Caption);
948 948
 
949
-         $this->pChartObject->drawLabelBox($X,$Y-3,$Description,$Series,$Format);
949
+         $this->pChartObject->drawLabelBox($X, $Y - 3, $Description, $Series, $Format);
950 950
         }
951 951
       }
952 952
     }
953 953
 
954 954
    /* Draw a Scatter threshold */
955
-   function drawScatterThreshold($Value,$Format="")
955
+   function drawScatterThreshold($Value, $Format = "")
956 956
     {
957
-     $AxisID		= isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
957
+     $AxisID = isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
958 958
      $R			= isset($Format["R"]) ? $Format["R"] : 255;
959 959
      $G			= isset($Format["G"]) ? $Format["G"] : 0;
960 960
      $B			= isset($Format["B"]) ? $Format["B"] : 0;
961 961
      $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : 50;
962
-     $Weight		= isset($Format["Weight"]) ? $Format["Weight"] : NULL;
962
+     $Weight = isset($Format["Weight"]) ? $Format["Weight"] : NULL;
963 963
      $Ticks		= isset($Format["Ticks"]) ? $Format["Ticks"] : 3;
964
-     $Wide		= isset($Format["Wide"]) ? $Format["Wide"] : FALSE;
965
-     $WideFactor	= isset($Format["WideFactor"]) ? $Format["WideFactor"] : 5;
964
+     $Wide = isset($Format["Wide"]) ? $Format["Wide"] : FALSE;
965
+     $WideFactor = isset($Format["WideFactor"]) ? $Format["WideFactor"] : 5;
966 966
      $WriteCaption	= isset($Format["WriteCaption"]) ? $Format["WriteCaption"] : FALSE;
967
-     $Caption		= isset($Format["Caption"]) ? $Format["Caption"] : NULL;
967
+     $Caption = isset($Format["Caption"]) ? $Format["Caption"] : NULL;
968 968
      $CaptionAlign	= isset($Format["CaptionAlign"]) ? $Format["CaptionAlign"] : CAPTION_LEFT_TOP;
969
-     $CaptionOffset     = isset($Format["CaptionOffset"]) ? $Format["CaptionOffset"] : 10;
969
+     $CaptionOffset = isset($Format["CaptionOffset"]) ? $Format["CaptionOffset"] : 10;
970 970
      $CaptionR		= isset($Format["CaptionR"]) ? $Format["CaptionR"] : 255;
971 971
      $CaptionG		= isset($Format["CaptionG"]) ? $Format["CaptionG"] : 255;
972 972
      $CaptionB		= isset($Format["CaptionB"]) ? $Format["CaptionB"] : 255;
973 973
      $CaptionAlpha	= isset($Format["CaptionAlpha"]) ? $Format["CaptionAlpha"] : 100;
974
-     $DrawBox		= isset($Format["DrawBox"]) ? $Format["DrawBox"] : TRUE;
974
+     $DrawBox = isset($Format["DrawBox"]) ? $Format["DrawBox"] : TRUE;
975 975
      $DrawBoxBorder	= isset($Format["DrawBoxBorder"]) ? $Format["DrawBoxBorder"] : FALSE;
976 976
      $BorderOffset	= isset($Format["BorderOffset"]) ? $Format["BorderOffset"] : 5;
977
-     $BoxRounded	= isset($Format["BoxRounded"]) ? $Format["BoxRounded"] : TRUE;
977
+     $BoxRounded = isset($Format["BoxRounded"]) ? $Format["BoxRounded"] : TRUE;
978 978
      $RoundedRadius	= isset($Format["RoundedRadius"]) ? $Format["RoundedRadius"] : 3;
979 979
      $BoxR		= isset($Format["BoxR"]) ? $Format["BoxR"] : 0;
980 980
      $BoxG		= isset($Format["BoxG"]) ? $Format["BoxG"] : 0;
981 981
      $BoxB		= isset($Format["BoxB"]) ? $Format["BoxB"] : 0;
982
-     $BoxAlpha		= isset($Format["BoxAlpha"]) ? $Format["BoxAlpha"] : 20;
983
-     $BoxSurrounding	= isset($Format["BoxSurrounding"]) ? $Format["BoxSurrounding"] : "";
982
+     $BoxAlpha = isset($Format["BoxAlpha"]) ? $Format["BoxAlpha"] : 20;
983
+     $BoxSurrounding = isset($Format["BoxSurrounding"]) ? $Format["BoxSurrounding"] : "";
984 984
      $BoxBorderR	= isset($Format["BoxBorderR"]) ? $Format["BoxBorderR"] : 255;
985 985
      $BoxBorderG	= isset($Format["BoxBorderG"]) ? $Format["BoxBorderG"] : 255;
986 986
      $BoxBorderB	= isset($Format["BoxBorderB"]) ? $Format["BoxBorderB"] : 255;
987
-     $BoxBorderAlpha	= isset($Format["BoxBorderAlpha"]) ? $Format["BoxBorderAlpha"] : 100;
987
+     $BoxBorderAlpha = isset($Format["BoxBorderAlpha"]) ? $Format["BoxBorderAlpha"] : 100;
988 988
 
989
-     $CaptionSettings = array("DrawBox"=>$DrawBox,"DrawBoxBorder"=>$DrawBoxBorder,"BorderOffset"=>$BorderOffset,"BoxRounded"=>$BoxRounded,"RoundedRadius"=>$RoundedRadius,
990
-                              "BoxR"=>$BoxR,"BoxG"=>$BoxG,"BoxB"=>$BoxB,"BoxAlpha"=>$BoxAlpha,"BoxSurrounding"=>$BoxSurrounding,
991
-                              "BoxBorderR"=>$BoxBorderR,"BoxBorderG"=>$BoxBorderG,"BoxBorderB"=>$BoxBorderB,"BoxBorderAlpha"=>$BoxBorderAlpha,
992
-                              "R"=>$CaptionR,"G"=>$CaptionG,"B"=>$CaptionB,"Alpha"=>$CaptionAlpha);
989
+     $CaptionSettings = array("DrawBox"=>$DrawBox, "DrawBoxBorder"=>$DrawBoxBorder, "BorderOffset"=>$BorderOffset, "BoxRounded"=>$BoxRounded, "RoundedRadius"=>$RoundedRadius,
990
+                              "BoxR"=>$BoxR, "BoxG"=>$BoxG, "BoxB"=>$BoxB, "BoxAlpha"=>$BoxAlpha, "BoxSurrounding"=>$BoxSurrounding,
991
+                              "BoxBorderR"=>$BoxBorderR, "BoxBorderG"=>$BoxBorderG, "BoxBorderB"=>$BoxBorderB, "BoxBorderAlpha"=>$BoxBorderAlpha,
992
+                              "R"=>$CaptionR, "G"=>$CaptionG, "B"=>$CaptionB, "Alpha"=>$CaptionAlpha);
993 993
 
994
-     if ( $Caption == NULL ) { $Caption = $Value; }
994
+     if ($Caption == NULL) { $Caption = $Value; }
995 995
 
996 996
      $Data = $this->pDataObject->getData();
997 997
 
998
-     if ( !isset($Data["Axis"][$AxisID]) ) { return(-1); }
998
+     if (!isset($Data["Axis"][$AxisID])) { return(-1); }
999 999
  
1000
-     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y )
1000
+     if ($Data["Axis"][$AxisID]["Identity"] == AXIS_Y)
1001 1001
       {
1002 1002
        $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"];
1003 1003
        $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"];
1004
-       $Y  = $this->getPosArray($Value,$AxisID);
1004
+       $Y  = $this->getPosArray($Value, $AxisID);
1005 1005
 
1006
-       $this->pChartObject->drawLine($X1,$Y,$X2,$Y,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight));
1006
+       $this->pChartObject->drawLine($X1, $Y, $X2, $Y, array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha, "Ticks"=>$Ticks, "Weight"=>$Weight));
1007 1007
 
1008
-       if ( $Wide )
1008
+       if ($Wide)
1009 1009
         {
1010
-         $this->pChartObject->drawLine($X1,$Y-1,$X2,$Y-1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1011
-         $this->pChartObject->drawLine($X1,$Y+1,$X2,$Y+1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1010
+         $this->pChartObject->drawLine($X1, $Y - 1, $X2, $Y - 1, array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha/$WideFactor, "Ticks"=>$Ticks));
1011
+         $this->pChartObject->drawLine($X1, $Y + 1, $X2, $Y + 1, array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha/$WideFactor, "Ticks"=>$Ticks));
1012 1012
         }
1013 1013
 
1014
-       if ( $WriteCaption )
1014
+       if ($WriteCaption)
1015 1015
         {
1016
-         if ( $CaptionAlign == CAPTION_LEFT_TOP )
1016
+         if ($CaptionAlign == CAPTION_LEFT_TOP)
1017 1017
           { $X = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLELEFT; }
1018 1018
          else 
1019 1019
           { $X = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"] - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLERIGHT; }
1020 1020
 
1021
-         $this->pChartObject->drawText($X,$Y,$Caption,$CaptionSettings);
1021
+         $this->pChartObject->drawText($X, $Y, $Caption, $CaptionSettings);
1022 1022
         }
1023 1023
 
1024 1024
        return(array("Y"=>$Y));
1025 1025
       }
1026
-     elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
1026
+     elseif ($Data["Axis"][$AxisID]["Identity"] == AXIS_X)
1027 1027
       {
1028
-       $X  = $this->getPosArray($Value,$AxisID);
1028
+       $X  = $this->getPosArray($Value, $AxisID);
1029 1029
        $Y1 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"];
1030 1030
        $Y2 = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"];
1031 1031
 
1032
-       $this->pChartObject->drawLine($X,$Y1,$X,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight));
1032
+       $this->pChartObject->drawLine($X, $Y1, $X, $Y2, array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha, "Ticks"=>$Ticks, "Weight"=>$Weight));
1033 1033
 
1034
-       if ( $Wide )
1034
+       if ($Wide)
1035 1035
         {
1036
-         $this->pChartObject->drawLine($X-1,$Y1,$X-1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1037
-         $this->pChartObject->drawLine($X+1,$Y1,$X+1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1036
+         $this->pChartObject->drawLine($X - 1, $Y1, $X - 1, $Y2, array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha/$WideFactor, "Ticks"=>$Ticks));
1037
+         $this->pChartObject->drawLine($X + 1, $Y1, $X + 1, $Y2, array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha/$WideFactor, "Ticks"=>$Ticks));
1038 1038
         }
1039 1039
 
1040
-       if ( $WriteCaption )
1040
+       if ($WriteCaption)
1041 1041
         {
1042
-         if ( $CaptionAlign == CAPTION_LEFT_TOP )
1042
+         if ($CaptionAlign == CAPTION_LEFT_TOP)
1043 1043
           { $Y = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE; }
1044 1044
          else 
1045 1045
           { $Y = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_BOTTOMMIDDLE; }
1046 1046
 
1047 1047
          $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE;
1048
-         $this->pChartObject->drawText($X,$Y,$Caption,$CaptionSettings);
1048
+         $this->pChartObject->drawText($X, $Y, $Caption, $CaptionSettings);
1049 1049
         }
1050 1050
 
1051 1051
        return(array("X"=>$X));
@@ -1053,13 +1053,13 @@  discard block
 block discarded – undo
1053 1053
     }
1054 1054
 
1055 1055
    /* Draw a Scatter threshold area */
1056
-   function drawScatterThresholdArea($Value1,$Value2,$Format="")
1056
+   function drawScatterThresholdArea($Value1, $Value2, $Format = "")
1057 1057
     {
1058
-     $AxisID	= isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
1058
+     $AxisID = isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
1059 1059
      $R		= isset($Format["R"]) ? $Format["R"] : 255;
1060 1060
      $G		= isset($Format["G"]) ? $Format["G"] : 0;
1061 1061
      $B		= isset($Format["B"]) ? $Format["B"] : 0;
1062
-     $Alpha	= isset($Format["Alpha"]) ? $Format["Alpha"] : 20;
1062
+     $Alpha = isset($Format["Alpha"]) ? $Format["Alpha"] : 20;
1063 1063
      $Border    = isset($Format["Border"]) ? $Format["Border"] : TRUE;
1064 1064
      $BorderR   = isset($Format["BorderR"]) ? $Format["BorderR"] : $R;
1065 1065
      $BorderG   = isset($Format["BorderG"]) ? $Format["BorderG"] : $G;
@@ -1071,87 +1071,87 @@  discard block
 block discarded – undo
1071 1071
      $NameR	= isset($Format["NameR"]) ? $Format["NameR"] : 255;
1072 1072
      $NameG	= isset($Format["NameG"]) ? $Format["NameG"] : 255;
1073 1073
      $NameB	= isset($Format["NameB"]) ? $Format["NameB"] : 255;
1074
-     $NameAlpha	= isset($Format["NameAlpha"]) ? $Format["NameAlpha"] : 100;
1074
+     $NameAlpha = isset($Format["NameAlpha"]) ? $Format["NameAlpha"] : 100;
1075 1075
      $DisableShadowOnArea = isset($Format["DisableShadowOnArea"]) ? $Format["DisableShadowOnArea"] : TRUE;
1076 1076
 
1077 1077
      if ($Value1 > $Value2) { list($Value1, $Value2) = array($Value2, $Value1); }
1078 1078
 
1079 1079
      $RestoreShadow = $this->pChartObject->Shadow;
1080
-     if ( $DisableShadowOnArea && $this->pChartObject->Shadow ) { $this->pChartObject->Shadow = FALSE; }
1080
+     if ($DisableShadowOnArea && $this->pChartObject->Shadow) { $this->pChartObject->Shadow = FALSE; }
1081 1081
 
1082
-     if ($BorderAlpha >100) { $BorderAlpha = 100;}
1082
+     if ($BorderAlpha > 100) { $BorderAlpha = 100; }
1083 1083
 
1084 1084
      $Data = $this->pDataObject->getData();
1085 1085
 
1086
-     if ( !isset($Data["Axis"][$AxisID]) ) { return(-1); }
1086
+     if (!isset($Data["Axis"][$AxisID])) { return(-1); }
1087 1087
  
1088
-     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
1088
+     if ($Data["Axis"][$AxisID]["Identity"] == AXIS_X)
1089 1089
       {
1090 1090
        $Y1 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"];
1091 1091
        $Y2 = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"];
1092
-       $X1  = $this->getPosArray($Value1,$AxisID);
1093
-       $X2  = $this->getPosArray($Value2,$AxisID);
1092
+       $X1  = $this->getPosArray($Value1, $AxisID);
1093
+       $X2  = $this->getPosArray($Value2, $AxisID);
1094 1094
 
1095
-       if ( $X1 <= $this->pChartObject->GraphAreaX1 ) { $X1 = $this->pChartObject->GraphAreaX1+$Data["Axis"][$AxisID]["Margin"]; }
1096
-       if ( $X2 >= $this->pChartObject->GraphAreaX2 ) { $X2 = $this->pChartObject->GraphAreaX2-$Data["Axis"][$AxisID]["Margin"]; }
1095
+       if ($X1 <= $this->pChartObject->GraphAreaX1) { $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"]; }
1096
+       if ($X2 >= $this->pChartObject->GraphAreaX2) { $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"]; }
1097 1097
 
1098
-       $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha));
1098
+       $this->pChartObject->drawFilledRectangle($X1, $Y1, $X2, $Y2, array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha));
1099 1099
 
1100
-       if ( $Border )
1100
+       if ($Border)
1101 1101
         {
1102
-         $this->pChartObject->drawLine($X1,$Y1,$X1,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1103
-         $this->pChartObject->drawLine($X2,$Y1,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1102
+         $this->pChartObject->drawLine($X1, $Y1, $X1, $Y2, array("R"=>$BorderR, "G"=>$BorderG, "B"=>$BorderB, "Alpha"=>$BorderAlpha, "Ticks"=>$BorderTicks));
1103
+         $this->pChartObject->drawLine($X2, $Y1, $X2, $Y2, array("R"=>$BorderR, "G"=>$BorderG, "B"=>$BorderB, "Alpha"=>$BorderAlpha, "Ticks"=>$BorderTicks));
1104 1104
         }
1105 1105
 
1106
-       if ( $AreaName != NULL )
1106
+       if ($AreaName != NULL)
1107 1107
         {
1108
-         $XPos = ($X2-$X1)/2 + $X1;
1109
-         $YPos = ($Y2-$Y1)/2 + $Y1;
1108
+         $XPos = ($X2 - $X1)/2 + $X1;
1109
+         $YPos = ($Y2 - $Y1)/2 + $Y1;
1110 1110
 
1111
-         if ( $NameAngle == ZONE_NAME_ANGLE_AUTO )
1111
+         if ($NameAngle == ZONE_NAME_ANGLE_AUTO)
1112 1112
           {
1113
-           $TxtPos   = $this->pChartObject->getTextBox($XPos,$YPos,$this->pChartObject->FontName,$this->pChartObject->FontSize,0,$AreaName);
1113
+           $TxtPos   = $this->pChartObject->getTextBox($XPos, $YPos, $this->pChartObject->FontName, $this->pChartObject->FontSize, 0, $AreaName);
1114 1114
            $TxtWidth = $TxtPos[1]["X"] - $TxtPos[0]["X"];
1115
-           if ( abs($X2 - $X1) > $TxtWidth ) { $NameAngle = 0; } else { $NameAngle = 90; }
1115
+           if (abs($X2 - $X1) > $TxtWidth) { $NameAngle = 0; } else { $NameAngle = 90; }
1116 1116
           }
1117 1117
          $this->pChartObject->Shadow = $RestoreShadow;
1118
-         $this->pChartObject->drawText($XPos,$YPos,$AreaName,array("R"=>$NameR,"G"=>$NameG,"B"=>$NameB,"Alpha"=>$NameAlpha,"Angle"=>$NameAngle,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1119
-         if ( $DisableShadowOnArea ) { $this->pChartObject->Shadow = FALSE; }
1118
+         $this->pChartObject->drawText($XPos, $YPos, $AreaName, array("R"=>$NameR, "G"=>$NameG, "B"=>$NameB, "Alpha"=>$NameAlpha, "Angle"=>$NameAngle, "Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1119
+         if ($DisableShadowOnArea) { $this->pChartObject->Shadow = FALSE; }
1120 1120
         }
1121 1121
 
1122 1122
        $this->pChartObject->Shadow = $RestoreShadow;
1123
-       return(array("X1"=>$X1,"X2"=>$X2));
1123
+       return(array("X1"=>$X1, "X2"=>$X2));
1124 1124
       }
1125
-     elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y )
1125
+     elseif ($Data["Axis"][$AxisID]["Identity"] == AXIS_Y)
1126 1126
       {
1127 1127
        $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"];
1128 1128
        $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"];
1129
-       $Y1 = $this->getPosArray($Value1,$AxisID);
1130
-       $Y2 = $this->getPosArray($Value2,$AxisID);
1129
+       $Y1 = $this->getPosArray($Value1, $AxisID);
1130
+       $Y2 = $this->getPosArray($Value2, $AxisID);
1131 1131
 
1132
-       if ( $Y1 >= $this->pChartObject->GraphAreaY2 ) { $Y1 = $this->pChartObject->GraphAreaY2-$Data["Axis"][$AxisID]["Margin"]; }
1133
-       if ( $Y2 <= $this->pChartObject->GraphAreaY1 ) { $Y2 = $this->pChartObject->GraphAreaY1+$Data["Axis"][$AxisID]["Margin"]; }
1132
+       if ($Y1 >= $this->pChartObject->GraphAreaY2) { $Y1 = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"]; }
1133
+       if ($Y2 <= $this->pChartObject->GraphAreaY1) { $Y2 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"]; }
1134 1134
 
1135
-       $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha));
1135
+       $this->pChartObject->drawFilledRectangle($X1, $Y1, $X2, $Y2, array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha));
1136 1136
 
1137
-       if ( $Border )
1137
+       if ($Border)
1138 1138
         {
1139
-         $this->pChartObject->drawLine($X1,$Y1,$X2,$Y1,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1140
-         $this->pChartObject->drawLine($X1,$Y2,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1139
+         $this->pChartObject->drawLine($X1, $Y1, $X2, $Y1, array("R"=>$BorderR, "G"=>$BorderG, "B"=>$BorderB, "Alpha"=>$BorderAlpha, "Ticks"=>$BorderTicks));
1140
+         $this->pChartObject->drawLine($X1, $Y2, $X2, $Y2, array("R"=>$BorderR, "G"=>$BorderG, "B"=>$BorderB, "Alpha"=>$BorderAlpha, "Ticks"=>$BorderTicks));
1141 1141
         }
1142 1142
 
1143
-       if ( $AreaName != NULL )
1143
+       if ($AreaName != NULL)
1144 1144
         {
1145
-         $XPos = ($X2-$X1)/2 + $X1;
1146
-         $YPos = ($Y2-$Y1)/2 + $Y1;
1145
+         $XPos = ($X2 - $X1)/2 + $X1;
1146
+         $YPos = ($Y2 - $Y1)/2 + $Y1;
1147 1147
 
1148 1148
          $this->pChartObject->Shadow = $RestoreShadow;
1149
-         $this->pChartObject->drawText($YPos,$XPos,$AreaName,array("R"=>$NameR,"G"=>$NameG,"B"=>$NameB,"Alpha"=>$NameAlpha,"Angle"=>0,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1150
-         if ( $DisableShadowOnArea ) { $this->Shadow = FALSE; }
1149
+         $this->pChartObject->drawText($YPos, $XPos, $AreaName, array("R"=>$NameR, "G"=>$NameG, "B"=>$NameB, "Alpha"=>$NameAlpha, "Angle"=>0, "Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1150
+         if ($DisableShadowOnArea) { $this->Shadow = FALSE; }
1151 1151
         }
1152 1152
 
1153 1153
        $this->pChartObject->Shadow = $RestoreShadow;
1154
-       return(array("Y1"=>$Y1,"Y2"=>$Y2));
1154
+       return(array("Y1"=>$Y1, "Y2"=>$Y2));
1155 1155
       }
1156 1156
     }
1157 1157
   }
Please login to merge, or discard this patch.
Braces   +112 added lines, -236 removed lines patch added patch discarded remove patch
@@ -17,21 +17,18 @@  discard block
 block discarded – undo
17 17
  define("SCATTER_MISSING_Y_SERIE"	, 190002);
18 18
 
19 19
  /* pScatter class definition */
20
- class pScatter
21
-  {
20
+ class pScatter {
22 21
    var $pChartObject;
23 22
    var $pDataObject;
24 23
 
25 24
    /* Class creator */
26
-   function pScatter($pChartObject,$pDataObject)
27
-    {
25
+   function pScatter($pChartObject,$pDataObject) {
28 26
      $this->pChartObject = $pChartObject;
29 27
      $this->pDataObject  = $pDataObject;
30 28
     }
31 29
 
32 30
    /* Prepare the scale */
33
-   function drawScatterScale($Format="")
34
-    {
31
+   function drawScatterScale($Format="") {
35 32
      $Mode		= isset($Format["Mode"]) ? $Format["Mode"] : SCALE_MODE_FLOATING;
36 33
      $Floating		= isset($Format["Floating"]) ? $Format["Floating"] : FALSE;
37 34
      $XLabelsRotation	= isset($Format["XLabelsRotation"]) ? $Format["XLabelsRotation"] : 90;
@@ -80,8 +77,7 @@  discard block
 block discarded – undo
80 77
 
81 78
      /* Check if we have at least both one X and Y axis */
82 79
      $GotXAxis = FALSE; $GotYAxis = FALSE;
83
-     foreach($this->pDataObject->Data["Axis"] as $AxisID => $AxisSettings)
84
-      {
80
+     foreach($this->pDataObject->Data["Axis"] as $AxisID => $AxisSettings) {
85 81
        if ( $AxisSettings["Identity"] == AXIS_X ) { $GotXAxis = TRUE; }
86 82
        if ( $AxisSettings["Identity"] == AXIS_Y ) { $GotYAxis = TRUE; }
87 83
       }
@@ -93,20 +89,15 @@  discard block
 block discarded – undo
93 89
 
94 90
      $Data = $this->pDataObject->getData();
95 91
 
96
-     foreach($Data["Axis"] as $AxisID => $AxisSettings)
97
-      {
92
+     foreach($Data["Axis"] as $AxisID => $AxisSettings) {
98 93
        if ( $AxisSettings["Identity"] == AXIS_X)
99
-        { $Width = $this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1 - $XMargin*2; }
100
-       else
94
+        { $Width = $this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1 - $XMargin*2; } else
101 95
         { $Width = $this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1 - $YMargin*2; }
102 96
 
103 97
        $AxisMin = ABSOLUTE_MAX; $AxisMax = OUT_OF_SIGHT;
104
-       if ( $Mode == SCALE_MODE_FLOATING )
105
-        {
106
-         foreach($Data["Series"] as $SerieID => $SerieParameter)
107
-          {
108
-           if ( $SerieParameter["Axis"] == $AxisID && $Data["Series"][$SerieID]["isDrawable"] )
109
-            {
98
+       if ( $Mode == SCALE_MODE_FLOATING ) {
99
+         foreach($Data["Series"] as $SerieID => $SerieParameter) {
100
+           if ( $SerieParameter["Axis"] == $AxisID && $Data["Series"][$SerieID]["isDrawable"] ) {
110 101
              $AxisMax = max($AxisMax,$Data["Series"][$SerieID]["Max"]);
111 102
              $AxisMin = min($AxisMin,$Data["Series"][$SerieID]["Min"]);
112 103
             }
@@ -114,23 +105,18 @@  discard block
 block discarded – undo
114 105
          $AutoMargin = (($AxisMax-$AxisMin)/100)*$XReleasePercent;
115 106
 
116 107
          $Data["Axis"][$AxisID]["Min"] = $AxisMin-$AutoMargin; $Data["Axis"][$AxisID]["Max"] = $AxisMax+$AutoMargin;
117
-        }
118
-       elseif ( $Mode == SCALE_MODE_MANUAL )
119
-        {
120
-         if ( isset($ManualScale[$AxisID]["Min"]) && isset($ManualScale[$AxisID]["Max"]) )
121
-          {
108
+        } elseif ( $Mode == SCALE_MODE_MANUAL ) {
109
+         if ( isset($ManualScale[$AxisID]["Min"]) && isset($ManualScale[$AxisID]["Max"]) ) {
122 110
            $Data["Axis"][$AxisID]["Min"] = $ManualScale[$AxisID]["Min"];
123 111
            $Data["Axis"][$AxisID]["Max"] = $ManualScale[$AxisID]["Max"];
124
-          }
125
-         else
112
+          } else
126 113
           { echo "Manual scale boundaries not set."; exit(); }
127 114
         }
128 115
 
129 116
        /* Full manual scale */
130 117
        if ( isset($ManualScale[$AxisID]["Rows"]) && isset($ManualScale[$AxisID]["RowHeight"]) )
131 118
         $Scale = array("Rows"=>$ManualScale[$AxisID]["Rows"],"RowHeight"=>$ManualScale[$AxisID]["RowHeight"],"XMin"=>$ManualScale[$AxisID]["Min"],"XMax"=>$ManualScale[$AxisID]["Max"]);
132
-       else
133
-        {
119
+       else {
134 120
          $MaxDivs = floor($Width/$MinDivHeight);
135 121
          $Scale   = $this->pChartObject->computeScale($Data["Axis"][$AxisID]["Min"],$Data["Axis"][$AxisID]["Max"],$MaxDivs,$Factors,$AxisID);
136 122
         }
@@ -154,34 +140,27 @@  discard block
 block discarded – undo
154 140
      /* Set the original boundaries */
155 141
      $AxisPos["L"] = $this->pChartObject->GraphAreaX1; $AxisPos["R"] = $this->pChartObject->GraphAreaX2; $AxisPos["T"] = $this->pChartObject->GraphAreaY1; $AxisPos["B"] = $this->pChartObject->GraphAreaY2;
156 142
 
157
-     foreach($Data["Axis"] as $AxisID => $AxisSettings)
158
-      {
159
-       if ( isset($AxisSettings["Color"]) )
160
-        {
143
+     foreach($Data["Axis"] as $AxisID => $AxisSettings) {
144
+       if ( isset($AxisSettings["Color"]) ) {
161 145
          $AxisR = $AxisSettings["Color"]["R"]; $AxisG = $AxisSettings["Color"]["G"]; $AxisB = $AxisSettings["Color"]["B"];
162 146
          $TickR = $AxisSettings["Color"]["R"]; $TickG = $AxisSettings["Color"]["G"]; $TickB = $AxisSettings["Color"]["B"];
163 147
          $this->pChartObject->setFontProperties(array("R"=>$AxisSettings["Color"]["R"],"G"=>$AxisSettings["Color"]["G"],"B"=>$AxisSettings["Color"]["B"]));
164
-        }
165
-       else
166
-        {
148
+        } else {
167 149
          $AxisR = $AxisRo; $AxisG = $AxisGo; $AxisB = $AxisBo;
168 150
          $TickR = $TickRo; $TickG = $TickGo; $TickB = $TickBo;
169 151
          $this->pChartObject->setFontProperties(array("R"=>$FontColorRo,"G"=>$FontColorGo,"B"=>$FontColorBo));
170 152
         }
171 153
 
172 154
        $LastValue = "w00t"; $ID = 1;
173
-       if ( $AxisSettings["Identity"] == AXIS_X )
174
-        {
175
-         if ( $AxisSettings["Position"] == AXIS_POSITION_BOTTOM )
176
-          {
155
+       if ( $AxisSettings["Identity"] == AXIS_X ) {
156
+         if ( $AxisSettings["Position"] == AXIS_POSITION_BOTTOM ) {
177 157
            if ( $XLabelsRotation == 0 )				   { $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 2; }
178 158
            if ( $XLabelsRotation > 0 && $XLabelsRotation < 190 )   { $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
179 159
            if ( $XLabelsRotation == 180 )			   { $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 5; }
180 160
            if ( $XLabelsRotation > 180 && $XLabelsRotation < 360 ) { $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
181 161
 
182 162
            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
163
+            { $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 164
             { $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 165
 
187 166
            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)); }
@@ -189,8 +168,7 @@  discard block
 block discarded – undo
189 168
            $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
190 169
            $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxBottom = $AxisPos["B"];
191 170
            $LastX  = NULL;
192
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
193
-            {
171
+           for($i=0;$i<=$AxisSettings["Rows"];$i++) {
194 172
              $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
195 173
              $YPos  = $AxisPos["B"];
196 174
              $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
@@ -210,8 +188,7 @@  discard block
 block discarded – undo
210 188
              $LastX = $XPos;
211 189
             }
212 190
 
213
-           if ( isset($AxisSettings["Name"]) )
214
-            {
191
+           if ( isset($AxisSettings["Name"]) ) {
215 192
              $YPos   = $MaxBottom+2;
216 193
              $XPos   = $this->pChartObject->GraphAreaX1+($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1)/2;
217 194
              $Bounds = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_TOPMIDDLE));
@@ -221,17 +198,14 @@  discard block
 block discarded – undo
221 198
             }
222 199
 
223 200
            $AxisPos["B"] = $MaxBottom + $ScaleSpacing;
224
-          }
225
-         elseif ( $AxisSettings["Position"] == AXIS_POSITION_TOP )
226
-          {
201
+          } elseif ( $AxisSettings["Position"] == AXIS_POSITION_TOP ) {
227 202
            if ( $XLabelsRotation == 0 )					{ $LabelAlign = TEXT_ALIGN_BOTTOMMIDDLE; $LabelOffset = 2; }
228 203
            if ( $XLabelsRotation > 0 && $XLabelsRotation < 190 )	{ $LabelAlign = TEXT_ALIGN_MIDDLELEFT; $LabelOffset = 2; }
229 204
            if ( $XLabelsRotation == 180 )				{ $LabelAlign = TEXT_ALIGN_TOPMIDDLE; $LabelOffset = 5; }
230 205
            if ( $XLabelsRotation > 180 && $SLabelxRotation < 360 )	{ $LabelAlign = TEXT_ALIGN_MIDDLERIGHT; $LabelOffset = 5; }
231 206
 
232 207
            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
208
+            { $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 209
             { $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 210
 
237 211
            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)); }
@@ -239,8 +213,7 @@  discard block
 block discarded – undo
239 213
            $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
240 214
            $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinTop = $AxisPos["T"];
241 215
            $LastX  = NULL;
242
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
243
-            {
216
+           for($i=0;$i<=$AxisSettings["Rows"];$i++) {
244 217
              $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
245 218
              $YPos  = $AxisPos["T"];
246 219
              $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
@@ -261,8 +234,7 @@  discard block
 block discarded – undo
261 234
              $LastX = $XPos;
262 235
             }
263 236
 
264
-           if ( isset($AxisSettings["Name"]) )
265
-            {
237
+           if ( isset($AxisSettings["Name"]) ) {
266 238
              $YPos   = $MinTop-2;
267 239
              $XPos   = $this->pChartObject->GraphAreaX1+($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1)/2;
268 240
              $Bounds = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE));
@@ -273,15 +245,11 @@  discard block
 block discarded – undo
273 245
 
274 246
            $AxisPos["T"] = $MinTop - $ScaleSpacing;
275 247
           }
276
-        }
277
-       elseif ( $AxisSettings["Identity"] == AXIS_Y )
278
-        {
279
-         if ( $AxisSettings["Position"] == AXIS_POSITION_LEFT )
280
-          {
248
+        } elseif ( $AxisSettings["Identity"] == AXIS_Y ) {
249
+         if ( $AxisSettings["Position"] == AXIS_POSITION_LEFT ) {
281 250
 
282 251
            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
252
+            { $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 253
             { $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 254
 
287 255
            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)); }
@@ -289,8 +257,7 @@  discard block
 block discarded – undo
289 257
            $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
290 258
            $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinLeft = $AxisPos["L"];
291 259
            $LastY  = NULL;
292
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
293
-            {
260
+           for($i=0;$i<=$AxisSettings["Rows"];$i++) {
294 261
              $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
295 262
              $XPos  = $AxisPos["L"];
296 263
              $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
@@ -311,8 +278,7 @@  discard block
 block discarded – undo
311 278
              $LastY = $YPos;
312 279
             }
313 280
 
314
-           if ( isset($AxisSettings["Name"]) )
315
-            {
281
+           if ( isset($AxisSettings["Name"]) ) {
316 282
              $XPos    = $MinLeft-2;
317 283
              $YPos    = $this->pChartObject->GraphAreaY1+($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1)/2;
318 284
              $Bounds  = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE,"Angle"=>90));
@@ -322,13 +288,10 @@  discard block
 block discarded – undo
322 288
             }
323 289
 
324 290
            $AxisPos["L"] = $MinLeft - $ScaleSpacing;
325
-          }
326
-         elseif ( $AxisSettings["Position"] == AXIS_POSITION_RIGHT )
327
-          {
291
+          } elseif ( $AxisSettings["Position"] == AXIS_POSITION_RIGHT ) {
328 292
 
329 293
            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
294
+            { $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 295
             { $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 296
 
334 297
            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)); }
@@ -336,8 +299,7 @@  discard block
 block discarded – undo
336 299
            $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
337 300
            $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxLeft = $AxisPos["R"];
338 301
            $LastY  = NULL;
339
-           for($i=0;$i<=$AxisSettings["Rows"];$i++)
340
-            {
302
+           for($i=0;$i<=$AxisSettings["Rows"];$i++) {
341 303
              $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
342 304
              $XPos  = $AxisPos["R"];
343 305
              $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
@@ -358,8 +320,7 @@  discard block
 block discarded – undo
358 320
              $LastY = $YPos;
359 321
             }
360 322
 
361
-           if ( isset($AxisSettings["Name"]) )
362
-            {
323
+           if ( isset($AxisSettings["Name"]) ) {
363 324
              $XPos    = $MaxLeft+6;
364 325
              $YPos    = $this->pChartObject->GraphAreaY1+($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1)/2;
365 326
              $Bounds  = $this->pChartObject->drawText($XPos,$YPos,$AxisSettings["Name"],array("Align"=>TEXT_ALIGN_BOTTOMMIDDLE,"Angle"=>270));
@@ -377,8 +338,7 @@  discard block
 block discarded – undo
377 338
     }
378 339
 
379 340
    /* Draw a scatter plot chart */
380
-   function drawScatterPlotChart($Format=NULL)
381
-    {
341
+   function drawScatterPlotChart($Format=NULL) {
382 342
      $PlotSize		= isset($Format["PlotSize"]) ? $Format["PlotSize"] : 3;
383 343
      $PlotBorder	= isset($Format["PlotBorder"]) ? $Format["PlotBorder"] : FALSE;
384 344
      $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 250;
@@ -396,18 +356,15 @@  discard block
 block discarded – undo
396 356
 
397 357
      $BorderColor = array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha);
398 358
 
399
-     foreach($Data["ScatterSeries"] as $Key => $Series)
400
-      {
401
-       if ( $Series["isDrawable"] == TRUE )
402
-        {
359
+     foreach($Data["ScatterSeries"] as $Key => $Series) {
360
+       if ( $Series["isDrawable"] == TRUE ) {
403 361
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
404 362
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
405 363
 
406 364
          if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
407 365
          
408 366
          if ( isset($Series["Picture"]) && $Series["Picture"] != "" )
409
-          { $Picture = $Series["Picture"]; list($PicWidth,$PicHeight,$PicType) = $this->pChartObject->getPicInfo($Picture); }
410
-         else
367
+          { $Picture = $Series["Picture"]; list($PicWidth,$PicHeight,$PicType) = $this->pChartObject->getPicInfo($Picture); } else
411 368
           { $Picture = NULL; }
412 369
 
413 370
          $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
@@ -417,23 +374,18 @@  discard block
 block discarded – undo
417 374
 
418 375
          $Color = array("R"=>$Series["Color"]["R"],"G"=>$Series["Color"]["G"],"B"=>$Series["Color"]["B"],"Alpha"=>$Series["Color"]["Alpha"]);
419 376
 
420
-         foreach($PosArrayX as $Key => $Value)
421
-          {
377
+         foreach($PosArrayX as $Key => $Value) {
422 378
            $X = $Value; $Y = $PosArrayY[$Key];
423 379
 
424
-           if ( $X != VOID && $Y != VOID )
425
-            {
380
+           if ( $X != VOID && $Y != VOID ) {
426 381
              $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
427 382
              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 383
 
429 384
              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 )
432
-              {
385
+              { $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 ) {
433 386
                if ( $PlotBorder ) { $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize+$BorderSize,$BorderColor); }
434 387
                $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize,$Color);
435
-              }
436
-             else
388
+              } else
437 389
               { $this->pChartObject->drawFromPicture($PicType,$Picture,$X-$PicWidth/2,$Y-$PicHeight/2); }
438 390
             }
439 391
           }
@@ -442,8 +394,7 @@  discard block
 block discarded – undo
442 394
     }
443 395
 
444 396
    /* Draw a scatter line chart */
445
-   function drawScatterLineChart($Format=NULL)
446
-    {
397
+   function drawScatterLineChart($Format=NULL) {
447 398
      $Data		= $this->pDataObject->getData();
448 399
      $Palette		= $this->pDataObject->getPalette();
449 400
      $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
@@ -452,10 +403,8 @@  discard block
 block discarded – undo
452 403
      $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
453 404
 
454 405
      /* Parse all the series to draw */
455
-     foreach($Data["ScatterSeries"] as $Key => $Series)
456
-      {
457
-       if ( $Series["isDrawable"] == TRUE )
458
-        {
406
+     foreach($Data["ScatterSeries"] as $Key => $Series) {
407
+       if ( $Series["isDrawable"] == TRUE ) {
459 408
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
460 409
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
461 410
          $Ticks  = $Series["Ticks"];
@@ -473,12 +422,10 @@  discard block
 block discarded – undo
473 422
          if ( $Weight != 0 ) { $Color["Weight"] = $Weight; }
474 423
 
475 424
          $LastX = VOID; $LastY = VOID;
476
-         foreach($PosArrayX as $Key => $Value)
477
-          {
425
+         foreach($PosArrayX as $Key => $Value) {
478 426
            $X = $Value; $Y = $PosArrayY[$Key];
479 427
 
480
-           if ( $X != VOID && $Y != VOID )
481
-            {
428
+           if ( $X != VOID && $Y != VOID ) {
482 429
              $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
483 430
              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 431
             }
@@ -493,8 +440,7 @@  discard block
 block discarded – undo
493 440
     }
494 441
 
495 442
    /* Draw a scatter spline chart */
496
-   function drawScatterSplineChart($Format=NULL)
497
-    {
443
+   function drawScatterSplineChart($Format=NULL) {
498 444
      $Data		= $this->pDataObject->getData();
499 445
      $Palette		= $this->pDataObject->getPalette();
500 446
      $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
@@ -502,10 +448,8 @@  discard block
 block discarded – undo
502 448
      $ImageMapPlotSize	= isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
503 449
      $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
504 450
 
505
-     foreach($Data["ScatterSeries"] as $Key => $Series)
506
-      {
507
-       if ( $Series["isDrawable"] == TRUE )
508
-        {
451
+     foreach($Data["ScatterSeries"] as $Key => $Series) {
452
+       if ( $Series["isDrawable"] == TRUE ) {
509 453
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
510 454
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
511 455
          $Ticks  = $Series["Ticks"];
@@ -523,13 +467,11 @@  discard block
 block discarded – undo
523 467
          if ( $Weight != 0 ) { $SplineSettings["Weight"] = $Weight; }
524 468
 
525 469
          $LastX = VOID; $LastY = VOID; $WayPoints = ""; $Forces = "";
526
-         foreach($PosArrayX as $Key => $Value)
527
-          {
470
+         foreach($PosArrayX as $Key => $Value) {
528 471
            $X = $Value; $Y = $PosArrayY[$Key];
529 472
            $Force = $this->pChartObject->getLength($LastX,$LastY,$X,$Y)/5;
530 473
 
531
-           if ( $X != VOID && $Y != VOID )
532
-            {
474
+           if ( $X != VOID && $Y != VOID ) {
533 475
              $RealValue = round($Data["Series"][$Series["X"]]["Data"][$Key],2)." / ".round($Data["Series"][$Series["Y"]]["Data"][$Key],2);
534 476
              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); }
535 477
             }
@@ -549,21 +491,18 @@  discard block
 block discarded – undo
549 491
     }
550 492
 
551 493
    /* Return the scaled plot position */
552
-   function getPosArray($Values,$AxisID)
553
-    {
494
+   function getPosArray($Values,$AxisID) {
554 495
      $Data = $this->pDataObject->getData();
555 496
 
556 497
      if ( !is_array($Values) ) { $Values = array($Values); }
557 498
 
558
-     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
559
-      {
499
+     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X ) {
560 500
        $Height      = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $Data["Axis"][$AxisID]["Margin"]*2;
561 501
        $ScaleHeight = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"];
562 502
        $Step        = $Height / $ScaleHeight;
563 503
 
564 504
        $Result = "";
565
-       foreach($Values as $Key => $Value)
566
-        {
505
+       foreach($Values as $Key => $Value) {
567 506
          if ( $Value == VOID ) 
568 507
           $Result[] = VOID;
569 508
          else
@@ -571,16 +510,13 @@  discard block
 block discarded – undo
571 510
         }
572 511
 
573 512
        if ( count($Result) == 1 ) { return($Result[0]); } else { return($Result); }
574
-      }
575
-     else
576
-      {
513
+      } else {
577 514
        $Height      = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $Data["Axis"][$AxisID]["Margin"]*2;
578 515
        $ScaleHeight = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"];
579 516
        $Step        = $Height / $ScaleHeight;
580 517
 
581 518
        $Result = "";
582
-       foreach($Values as $Key => $Value)
583
-        {
519
+       foreach($Values as $Key => $Value) {
584 520
          if ( $Value == VOID ) 
585 521
           $Result[] = VOID;
586 522
          else
@@ -592,8 +528,7 @@  discard block
 block discarded – undo
592 528
     }
593 529
 
594 530
    /* Draw the legend of the active series */
595
-   function drawScatterLegend($X,$Y,$Format="")
596
-    {
531
+   function drawScatterLegend($X,$Y,$Format="") {
597 532
      $Family		= isset($Format["Family"]) ? $Format["Family"] : LEGEND_FAMILY_BOX;
598 533
      $FontName		= isset($Format["FontName"]) ? $Format["FontName"] : $this->pChartObject->FontName;
599 534
      $FontSize		= isset($Format["FontSize"]) ? $Format["FontSize"] : $this->pChartObject->FontSize;
@@ -621,10 +556,8 @@  discard block
 block discarded – undo
621 556
 
622 557
      $Data = $this->pDataObject->getData();
623 558
 
624
-     foreach($Data["ScatterSeries"] as $Key => $Series)
625
-      {
626
-       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
627
-        {
559
+     foreach($Data["ScatterSeries"] as $Key => $Series) {
560
+       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"])) {
628 561
          list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
629 562
          if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
630 563
          if ( $IconAreaHeight < $PicHeight ) { $IconAreaHeight = $PicHeight; }
@@ -636,12 +569,9 @@  discard block
 block discarded – undo
636 569
      $XStep = $XSpacing;
637 570
 
638 571
      $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
639
-     foreach($Data["ScatterSeries"] as $Key => $Series)
640
-      {
641
-       if ( $Series["isDrawable"] == TRUE )
642
-        {
643
-         if ( $Mode == LEGEND_VERTICAL )
644
-          {
572
+     foreach($Data["ScatterSeries"] as $Key => $Series) {
573
+       if ( $Series["isDrawable"] == TRUE ) {
574
+         if ( $Mode == LEGEND_VERTICAL ) {
645 575
            $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+4,$vY+$IconAreaHeight/2,$FontName,$FontSize,0,$Series["Description"]);
646 576
 
647 577
            if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
@@ -650,13 +580,10 @@  discard block
 block discarded – undo
650 580
 
651 581
            $Lines = preg_split("/\n/",$Series["Description"]);
652 582
            $vY = $vY + max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
653
-          }
654
-         elseif ( $Mode == LEGEND_HORIZONTAL )
655
-          {
583
+          } elseif ( $Mode == LEGEND_HORIZONTAL ) {
656 584
            $Lines = preg_split("/\n/",$Series["Description"]);
657 585
            $Width = "";
658
-           foreach($Lines as $Key => $Value)
659
-            {
586
+           foreach($Lines as $Key => $Value) {
660 587
              $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+6,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$FontName,$FontSize,0,$Value);
661 588
 
662 589
              if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
@@ -681,57 +608,44 @@  discard block
 block discarded – undo
681 608
       $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));
682 609
 
683 610
      $RestoreShadow = $this->pChartObject->Shadow; $this->Shadow = FALSE;
684
-     foreach($Data["ScatterSeries"] as $Key => $Series)
685
-      {
686
-       if ( $Series["isDrawable"] == TRUE )
687
-        {
611
+     foreach($Data["ScatterSeries"] as $Key => $Series) {
612
+       if ( $Series["isDrawable"] == TRUE ) {
688 613
          $R = $Series["Color"]["R"]; $G = $Series["Color"]["G"]; $B = $Series["Color"]["B"];
689 614
          $Ticks = $Series["Ticks"]; $Weight = $Series["Weight"];
690 615
 
691
-         if ( isset($Series["Picture"]) )
692
-          {
616
+         if ( isset($Series["Picture"]) ) {
693 617
            $Picture = $Series["Picture"];
694 618
            list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Picture);
695 619
            $PicX = $X+$IconAreaWidth/2; $PicY = $Y+$IconAreaHeight/2; 
696 620
 
697 621
            $this->pChartObject->drawFromPNG($PicX-$PicWidth/2,$PicY-$PicHeight/2,$Picture);
698
-          }
699
-         else
700
-          {
701
-           if ( $Family == LEGEND_FAMILY_BOX )
702
-            {
622
+          } else {
623
+           if ( $Family == LEGEND_FAMILY_BOX ) {
703 624
              if ( $BoxWidth != $IconAreaWidth ) { $XOffset = floor(($IconAreaWidth-$BoxWidth)/2); } else { $XOffset = 0; }
704 625
              if ( $BoxHeight != $IconAreaHeight ) { $YOffset = floor(($IconAreaHeight-$BoxHeight)/2); } else { $YOffset = 0; }
705 626
 
706 627
              $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 628
              $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 )
710
-            {
629
+            } elseif ( $Family == LEGEND_FAMILY_CIRCLE ) {
711 630
              $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 631
              $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 )
715
-            {
632
+            } elseif ( $Family == LEGEND_FAMILY_LINE ) {
716 633
              $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 634
              $this->pChartObject->drawLine($X,$Y+$IconAreaHeight/2,$X+$IconAreaWidth,$Y+$IconAreaHeight/2,array("R"=>$R,"G"=>$G,"B"=>$B,"Ticks"=>$Ticks,"Weight"=>$Weight));
718 635
             }
719 636
           }
720 637
 
721
-         if ( $Mode == LEGEND_VERTICAL )
722
-          {
638
+         if ( $Mode == LEGEND_VERTICAL ) {
723 639
            $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));
640
+           foreach($Lines as $Key => $Value) {
641
+                       $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));
642
+           }
726 643
 
727 644
            $Y=$Y+max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
728
-          }
729
-         elseif ( $Mode == LEGEND_HORIZONTAL )
730
-          {
645
+          } elseif ( $Mode == LEGEND_HORIZONTAL ) {
731 646
            $Lines = preg_split("/\n/",$Series["Description"]);
732 647
            $Width = "";
733
-           foreach($Lines as $Key => $Value)
734
-            {
648
+           foreach($Lines as $Key => $Value) {
735 649
              $BoxArray = $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));
736 650
              $Width[] = $BoxArray[1]["X"];
737 651
             }
@@ -744,8 +658,7 @@  discard block
 block discarded – undo
744 658
     }
745 659
 
746 660
    /* Get the legend box size */
747
-   function getScatterLegendSize($Format="")
748
-    {
661
+   function getScatterLegendSize($Format="") {
749 662
      $FontName	= isset($Format["FontName"]) ? $Format["FontName"] : $this->pChartObject->FontName;
750 663
      $FontSize	= isset($Format["FontSize"]) ? $Format["FontSize"] : $this->pChartObject->FontSize;
751 664
      $BoxSize	= isset($Format["BoxSize"]) ? $Format["BoxSize"] : 5;
@@ -760,10 +673,8 @@  discard block
 block discarded – undo
760 673
 
761 674
      $Data = $this->pDataObject->getData();
762 675
 
763
-     foreach($Data["ScatterSeries"] as $Key => $Series)
764
-      {
765
-       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
766
-        {
676
+     foreach($Data["ScatterSeries"] as $Key => $Series) {
677
+       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"])) {
767 678
          list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
768 679
          if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
769 680
          if ( $IconAreaHeight < $PicHeight ) { $IconAreaHeight = $PicHeight; }
@@ -775,12 +686,9 @@  discard block
 block discarded – undo
775 686
      $XStep = $XSpacing;
776 687
 
777 688
      $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
778
-     foreach($Data["ScatterSeries"] as $Key => $Series)
779
-      {
780
-       if ( $Series["isDrawable"] == TRUE )
781
-        {
782
-         if ( $Mode == LEGEND_VERTICAL )
783
-          {
689
+     foreach($Data["ScatterSeries"] as $Key => $Series) {
690
+       if ( $Series["isDrawable"] == TRUE ) {
691
+         if ( $Mode == LEGEND_VERTICAL ) {
784 692
            $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+4,$vY+$IconAreaHeight/2,$FontName,$FontSize,0,$Series["Description"]);
785 693
 
786 694
            if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
@@ -789,13 +697,10 @@  discard block
 block discarded – undo
789 697
 
790 698
            $Lines = preg_split("/\n/",$Series["Description"]);
791 699
            $vY = $vY + max($this->pChartObject->FontSize*count($Lines),$IconAreaHeight) + 5;
792
-          }
793
-         elseif ( $Mode == LEGEND_HORIZONTAL )
794
-          {
700
+          } elseif ( $Mode == LEGEND_HORIZONTAL ) {
795 701
            $Lines = preg_split("/\n/",$Series["Description"]);
796 702
            $Width = "";
797
-           foreach($Lines as $Key => $Value)
798
-            {
703
+           foreach($Lines as $Key => $Value) {
799 704
              $BoxArray = $this->pChartObject->getTextBox($vX+$IconAreaWidth+6,$Y+$IconAreaHeight/2+(($this->pChartObject->FontSize+3)*$Key),$FontName,$FontSize,0,$Value);
800 705
 
801 706
              if ( $Boundaries["T"] > $BoxArray[2]["Y"]+$IconAreaHeight/2 ) { $Boundaries["T"] = $BoxArray[2]["Y"]+$IconAreaHeight/2; }
@@ -821,16 +726,13 @@  discard block
 block discarded – undo
821 726
     }
822 727
 
823 728
    /* Draw the line of best fit */
824
-   function drawScatterBestFit($Format="")
825
-    {
729
+   function drawScatterBestFit($Format="") {
826 730
      $Ticks	= isset($Format["Ticks"]) ? $Format["Ticks"] : 0;
827 731
 
828 732
      $Data    = $this->pDataObject->getData();
829 733
 
830
-     foreach($Data["ScatterSeries"] as $Key => $Series)
831
-      {
832
-       if ( $Series["isDrawable"] == TRUE )
833
-        {
734
+     foreach($Data["ScatterSeries"] as $Key => $Series) {
735
+       if ( $Series["isDrawable"] == TRUE ) {
834 736
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
835 737
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
836 738
 
@@ -841,8 +743,7 @@  discard block
 block discarded – undo
841 743
          $PosArrayY = $Data["Series"][$Series["Y"]]["Data"];
842 744
 
843 745
          $Sxy = 0; $Sx = 0; $Sy = 0; $Sxx = 0;
844
-         foreach($PosArrayX as $Key => $Value)
845
-          {
746
+         foreach($PosArrayX as $Key => $Value) {
846 747
            $X = $Value; $Y = $PosArrayY[$Key];
847 748
 
848 749
            $Sxy = $Sxy + $X*$Y;
@@ -853,15 +754,12 @@  discard block
 block discarded – undo
853 754
 
854 755
          $n = count($PosArrayX);
855 756
 
856
-         if ((($n*$Sxx) == ($Sx*$Sx)))
857
-          {
757
+         if ((($n*$Sxx) == ($Sx*$Sx))) {
858 758
            $X1 = $this->getPosArray($Data["Axis"][$SerieXAxis]["ScaleMin"],$SerieXAxis);
859 759
            $X2 = $X1;
860 760
            $Y1 = $this->pChartObject->GraphAreaY1;
861 761
            $Y2 = $this->pChartObject->GraphAreaY2;
862
-          }
863
-         else
864
-          {
762
+          } else {
865 763
            $M = (($n*$Sxy)-($Sx*$Sy)) / (($n*$Sxx)-($Sx*$Sx));
866 764
            $B = (($Sy)-($M*$Sx))/($n);
867 765
 
@@ -883,8 +781,7 @@  discard block
 block discarded – undo
883 781
       }
884 782
     }
885 783
 
886
-   function writeScatterLabel($ScatterSerieID,$Points,$Format="")
887
-    {
784
+   function writeScatterLabel($ScatterSerieID,$Points,$Format="") {
888 785
      $OverrideTitle	= isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : NULL;
889 786
      $DrawPoint		= isset($Format["DrawPoint"]) ? $Format["DrawPoint"] : LABEL_POINT_BOX;
890 787
      $Decimals		= isset($Format["Decimals"]) ? $Format["Decimals"] : NULL;
@@ -906,10 +803,8 @@  discard block
 block discarded – undo
906 803
      $PosArrayY = $this->getPosArray($SerieValuesY,$SerieYAxis);
907 804
      if ( !is_array($PosArrayY) ) { $Value = $PosArrayY; $PosArrayY = ""; $PosArrayY[0] = $Value; }
908 805
 
909
-     foreach($Points as $Key => $Point)
910
-      {
911
-       if ( isset($PosArrayX[$Point]) && isset($PosArrayY[$Point]) )
912
-        {
806
+     foreach($Points as $Key => $Point) {
807
+       if ( isset($PosArrayX[$Point]) && isset($PosArrayY[$Point]) ) {
913 808
          $X = floor($PosArrayX[$Point]);
914 809
          $Y = floor($PosArrayY[$Point]);
915 810
 
@@ -952,8 +847,7 @@  discard block
 block discarded – undo
952 847
     }
953 848
 
954 849
    /* Draw a Scatter threshold */
955
-   function drawScatterThreshold($Value,$Format="")
956
-    {
850
+   function drawScatterThreshold($Value,$Format="") {
957 851
      $AxisID		= isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
958 852
      $R			= isset($Format["R"]) ? $Format["R"] : 255;
959 853
      $G			= isset($Format["G"]) ? $Format["G"] : 0;
@@ -997,51 +891,42 @@  discard block
 block discarded – undo
997 891
 
998 892
      if ( !isset($Data["Axis"][$AxisID]) ) { return(-1); }
999 893
  
1000
-     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y )
1001
-      {
894
+     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y ) {
1002 895
        $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"];
1003 896
        $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"];
1004 897
        $Y  = $this->getPosArray($Value,$AxisID);
1005 898
 
1006 899
        $this->pChartObject->drawLine($X1,$Y,$X2,$Y,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight));
1007 900
 
1008
-       if ( $Wide )
1009
-        {
901
+       if ( $Wide ) {
1010 902
          $this->pChartObject->drawLine($X1,$Y-1,$X2,$Y-1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1011 903
          $this->pChartObject->drawLine($X1,$Y+1,$X2,$Y+1,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1012 904
         }
1013 905
 
1014
-       if ( $WriteCaption )
1015
-        {
906
+       if ( $WriteCaption ) {
1016 907
          if ( $CaptionAlign == CAPTION_LEFT_TOP )
1017
-          { $X = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLELEFT; }
1018
-         else 
908
+          { $X = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLELEFT; } else 
1019 909
           { $X = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"] - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_MIDDLERIGHT; }
1020 910
 
1021 911
          $this->pChartObject->drawText($X,$Y,$Caption,$CaptionSettings);
1022 912
         }
1023 913
 
1024 914
        return(array("Y"=>$Y));
1025
-      }
1026
-     elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
1027
-      {
915
+      } elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X ) {
1028 916
        $X  = $this->getPosArray($Value,$AxisID);
1029 917
        $Y1 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"];
1030 918
        $Y2 = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"];
1031 919
 
1032 920
        $this->pChartObject->drawLine($X,$Y1,$X,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks,"Weight"=>$Weight));
1033 921
 
1034
-       if ( $Wide )
1035
-        {
922
+       if ( $Wide ) {
1036 923
          $this->pChartObject->drawLine($X-1,$Y1,$X-1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1037 924
          $this->pChartObject->drawLine($X+1,$Y1,$X+1,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha/$WideFactor,"Ticks"=>$Ticks));
1038 925
         }
1039 926
 
1040
-       if ( $WriteCaption )
1041
-        {
927
+       if ( $WriteCaption ) {
1042 928
          if ( $CaptionAlign == CAPTION_LEFT_TOP )
1043
-          { $Y = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE; }
1044
-         else 
929
+          { $Y = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"] + $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE; } else 
1045 930
           { $Y = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"] - $CaptionOffset; $CaptionSettings["Align"] = TEXT_ALIGN_BOTTOMMIDDLE; }
1046 931
 
1047 932
          $CaptionSettings["Align"] = TEXT_ALIGN_TOPMIDDLE;
@@ -1053,8 +938,7 @@  discard block
 block discarded – undo
1053 938
     }
1054 939
 
1055 940
    /* Draw a Scatter threshold area */
1056
-   function drawScatterThresholdArea($Value1,$Value2,$Format="")
1057
-    {
941
+   function drawScatterThresholdArea($Value1,$Value2,$Format="") {
1058 942
      $AxisID	= isset($Format["AxisID"]) ? $Format["AxisID"] : 0;
1059 943
      $R		= isset($Format["R"]) ? $Format["R"] : 255;
1060 944
      $G		= isset($Format["G"]) ? $Format["G"] : 0;
@@ -1085,8 +969,7 @@  discard block
 block discarded – undo
1085 969
 
1086 970
      if ( !isset($Data["Axis"][$AxisID]) ) { return(-1); }
1087 971
  
1088
-     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X )
1089
-      {
972
+     if ( $Data["Axis"][$AxisID]["Identity"] == AXIS_X ) {
1090 973
        $Y1 = $this->pChartObject->GraphAreaY1 + $Data["Axis"][$AxisID]["Margin"];
1091 974
        $Y2 = $this->pChartObject->GraphAreaY2 - $Data["Axis"][$AxisID]["Margin"];
1092 975
        $X1  = $this->getPosArray($Value1,$AxisID);
@@ -1097,19 +980,16 @@  discard block
 block discarded – undo
1097 980
 
1098 981
        $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha));
1099 982
 
1100
-       if ( $Border )
1101
-        {
983
+       if ( $Border ) {
1102 984
          $this->pChartObject->drawLine($X1,$Y1,$X1,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1103 985
          $this->pChartObject->drawLine($X2,$Y1,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1104 986
         }
1105 987
 
1106
-       if ( $AreaName != NULL )
1107
-        {
988
+       if ( $AreaName != NULL ) {
1108 989
          $XPos = ($X2-$X1)/2 + $X1;
1109 990
          $YPos = ($Y2-$Y1)/2 + $Y1;
1110 991
 
1111
-         if ( $NameAngle == ZONE_NAME_ANGLE_AUTO )
1112
-          {
992
+         if ( $NameAngle == ZONE_NAME_ANGLE_AUTO ) {
1113 993
            $TxtPos   = $this->pChartObject->getTextBox($XPos,$YPos,$this->pChartObject->FontName,$this->pChartObject->FontSize,0,$AreaName);
1114 994
            $TxtWidth = $TxtPos[1]["X"] - $TxtPos[0]["X"];
1115 995
            if ( abs($X2 - $X1) > $TxtWidth ) { $NameAngle = 0; } else { $NameAngle = 90; }
@@ -1121,9 +1001,7 @@  discard block
 block discarded – undo
1121 1001
 
1122 1002
        $this->pChartObject->Shadow = $RestoreShadow;
1123 1003
        return(array("X1"=>$X1,"X2"=>$X2));
1124
-      }
1125
-     elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y )
1126
-      {
1004
+      } elseif ( $Data["Axis"][$AxisID]["Identity"] == AXIS_Y ) {
1127 1005
        $X1 = $this->pChartObject->GraphAreaX1 + $Data["Axis"][$AxisID]["Margin"];
1128 1006
        $X2 = $this->pChartObject->GraphAreaX2 - $Data["Axis"][$AxisID]["Margin"];
1129 1007
        $Y1 = $this->getPosArray($Value1,$AxisID);
@@ -1134,14 +1012,12 @@  discard block
 block discarded – undo
1134 1012
 
1135 1013
        $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2,$Y2,array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha));
1136 1014
 
1137
-       if ( $Border )
1138
-        {
1015
+       if ( $Border ) {
1139 1016
          $this->pChartObject->drawLine($X1,$Y1,$X2,$Y1,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1140 1017
          $this->pChartObject->drawLine($X1,$Y2,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1141 1018
         }
1142 1019
 
1143
-       if ( $AreaName != NULL )
1144
-        {
1020
+       if ( $AreaName != NULL ) {
1145 1021
          $XPos = ($X2-$X1)/2 + $X1;
1146 1022
          $YPos = ($Y2-$Y1)/2 + $Y1;
1147 1023
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
    function drawScatterScale($Format="")
34 34
     {
35 35
      $Mode		= isset($Format["Mode"]) ? $Format["Mode"] : SCALE_MODE_FLOATING;
36
-     $Floating		= isset($Format["Floating"]) ? $Format["Floating"] : FALSE;
36
+     $Floating		= isset($Format["Floating"]) ? $Format["Floating"] : false;
37 37
      $XLabelsRotation	= isset($Format["XLabelsRotation"]) ? $Format["XLabelsRotation"] : 90;
38 38
      $MinDivHeight	= isset($Format["MinDivHeight"]) ? $Format["MinDivHeight"] : 20;
39 39
      $Factors		= isset($Format["Factors"]) ? $Format["Factors"] : array(1,2,5);
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      $TickGo		= isset($Format["TickG"]) ? $Format["TickG"] : 0;
59 59
      $TickBo		= isset($Format["TickB"]) ? $Format["TickB"] : 0;
60 60
      $TickAlpha		= isset($Format["TickAlpha"]) ? $Format["TickAlpha"] : 100;
61
-     $DrawSubTicks	= isset($Format["DrawSubTicks"]) ? $Format["DrawSubTicks"] : FALSE;
61
+     $DrawSubTicks	= isset($Format["DrawSubTicks"]) ? $Format["DrawSubTicks"] : false;
62 62
      $InnerSubTickWidth	= isset($Format["InnerSubTickWidth"]) ? $Format["InnerSubTickWidth"] : 0;
63 63
      $OuterSubTickWidth	= isset($Format["OuterSubTickWidth"]) ? $Format["OuterSubTickWidth"] : 2;
64 64
      $SubTickR		= isset($Format["SubTickR"]) ? $Format["SubTickR"] : 255;
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
      $SubTickB		= isset($Format["SubTickB"]) ? $Format["SubTickB"] : 0;
67 67
      $SubTickAlpha	= isset($Format["SubTickAlpha"]) ? $Format["SubTickAlpha"] : 100;
68 68
      $XReleasePercent	= isset($Format["XReleasePercent"]) ? $Format["XReleasePercent"] : 1;
69
-     $DrawArrows	= isset($Format["DrawArrows"]) ? $Format["DrawArrows"] : FALSE;
69
+     $DrawArrows	= isset($Format["DrawArrows"]) ? $Format["DrawArrows"] : false;
70 70
      $ArrowSize         = isset($Format["ArrowSize"]) ? $Format["ArrowSize"] : 8;
71
-     $CycleBackground	= isset($Format["CycleBackground"]) ? $Format["CycleBackground"] : FALSE;
71
+     $CycleBackground	= isset($Format["CycleBackground"]) ? $Format["CycleBackground"] : false;
72 72
      $BackgroundR1	= isset($Format["BackgroundR1"]) ? $Format["BackgroundR1"] : 255;
73 73
      $BackgroundG1	= isset($Format["BackgroundG1"]) ? $Format["BackgroundG1"] : 255;
74 74
      $BackgroundB1	= isset($Format["BackgroundB1"]) ? $Format["BackgroundB1"] : 255;
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
      $BackgroundAlpha2	= isset($Format["BackgroundAlpha2"]) ? $Format["BackgroundAlpha2"] : 10;
80 80
 
81 81
      /* Check if we have at least both one X and Y axis */
82
-     $GotXAxis = FALSE; $GotYAxis = FALSE;
82
+     $GotXAxis = false; $GotYAxis = false;
83 83
      foreach($this->pDataObject->Data["Axis"] as $AxisID => $AxisSettings)
84 84
       {
85
-       if ( $AxisSettings["Identity"] == AXIS_X ) { $GotXAxis = TRUE; }
86
-       if ( $AxisSettings["Identity"] == AXIS_Y ) { $GotYAxis = TRUE; }
85
+       if ( $AxisSettings["Identity"] == AXIS_X ) { $GotXAxis = true; }
86
+       if ( $AxisSettings["Identity"] == AXIS_Y ) { $GotYAxis = true; }
87 87
       }
88 88
      if ( !$GotXAxis ) { return(SCATTER_MISSING_X_SERIE); }
89 89
      if ( !$GotYAxis ) { return(SCATTER_MISSING_Y_SERIE); }
@@ -143,9 +143,9 @@  discard block
 block discarded – undo
143 143
 
144 144
        if ( isset($Scale["Format"]) ) { $Data["Axis"][$AxisID]["Format"] = $Scale["Format"]; }
145 145
 
146
-       if ( !isset($Data["Axis"][$AxisID]["Display"]) ) { $Data["Axis"][$AxisID]["Display"] = NULL; }
147
-       if ( !isset($Data["Axis"][$AxisID]["Format"]) )  { $Data["Axis"][$AxisID]["Format"] = NULL; }
148
-       if ( !isset($Data["Axis"][$AxisID]["Unit"]) )    { $Data["Axis"][$AxisID]["Unit"] = NULL; }
146
+       if ( !isset($Data["Axis"][$AxisID]["Display"]) ) { $Data["Axis"][$AxisID]["Display"] = null; }
147
+       if ( !isset($Data["Axis"][$AxisID]["Format"]) )  { $Data["Axis"][$AxisID]["Format"] = null; }
148
+       if ( !isset($Data["Axis"][$AxisID]["Unit"]) )    { $Data["Axis"][$AxisID]["Unit"] = null; }
149 149
       }
150 150
 
151 151
      /* Get the default font color */
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
            $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
190 190
            $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxBottom = $AxisPos["B"];
191
-           $LastX  = NULL;
191
+           $LastX  = null;
192 192
            for($i=0;$i<=$AxisSettings["Rows"];$i++)
193 193
             {
194 194
              $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
              $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
197 197
 
198 198
              if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
199
-             if ( $LastX != NULL && $CycleBackground  && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); }
199
+             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 200
 
201 201
              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 202
              if ( $DrawSubTicks && $i != $AxisSettings["Rows"] )
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 
239 239
            $Width = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) - $AxisSettings["Margin"]*2;
240 240
            $Step   = $Width / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinTop = $AxisPos["T"];
241
-           $LastX  = NULL;
241
+           $LastX  = null;
242 242
            for($i=0;$i<=$AxisSettings["Rows"];$i++)
243 243
             {
244 244
              $XPos  = $this->pChartObject->GraphAreaX1 + $AxisSettings["Margin"] + $Step*$i;
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
              $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
247 247
 
248 248
              if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
249
-             if ( $LastX != NULL && $CycleBackground  && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); }
249
+             if ( $LastX != null && $CycleBackground  && ( $DrawXLines == ALL || in_array($AxisID,$DrawXLines) )) { $this->pChartObject->drawFilledRectangle($LastX,$this->pChartObject->GraphAreaY1+$FloatingOffset,$XPos,$this->pChartObject->GraphAreaY2-$FloatingOffset,$BGColor); }
250 250
 
251 251
              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 252
 
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 
289 289
            $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
290 290
            $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MinLeft = $AxisPos["L"];
291
-           $LastY  = NULL;
291
+           $LastY  = null;
292 292
            for($i=0;$i<=$AxisSettings["Rows"];$i++)
293 293
             {
294 294
              $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
              $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
297 297
 
298 298
              if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
299
-             if ( $LastY != NULL && $CycleBackground && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
299
+             if ( $LastY != null && $CycleBackground && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
300 300
 
301 301
              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 302
 
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 
336 336
            $Height = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) - $AxisSettings["Margin"]*2;
337 337
            $Step   = $Height / $AxisSettings["Rows"]; $SubTicksSize = $Step /2; $MaxLeft = $AxisPos["R"];
338
-           $LastY  = NULL;
338
+           $LastY  = null;
339 339
            for($i=0;$i<=$AxisSettings["Rows"];$i++)
340 340
             {
341 341
              $YPos  = $this->pChartObject->GraphAreaY2 - $AxisSettings["Margin"] - $Step*$i;
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
              $Value = $this->pChartObject->scaleFormat($AxisSettings["ScaleMin"] + $AxisSettings["RowHeight"]*$i,$AxisSettings["Display"],$AxisSettings["Format"],$AxisSettings["Unit"]);
344 344
 
345 345
              if ( $i%2 == 1 ) { $BGColor = array("R"=>$BackgroundR1,"G"=>$BackgroundG1,"B"=>$BackgroundB1,"Alpha"=>$BackgroundAlpha1); } else { $BGColor = array("R"=>$BackgroundR2,"G"=>$BackgroundG2,"B"=>$BackgroundB2,"Alpha"=>$BackgroundAlpha2); }
346
-             if ( $LastY != NULL && $CycleBackground  && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
346
+             if ( $LastY != null && $CycleBackground  && ( $DrawYLines == ALL || in_array($AxisID,$DrawYLines) )) { $this->pChartObject->drawFilledRectangle($this->pChartObject->GraphAreaX1+$FloatingOffset,$LastY,$this->pChartObject->GraphAreaX2-$FloatingOffset,$YPos,$BGColor); }
347 347
 
348 348
              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 349
 
@@ -377,18 +377,18 @@  discard block
 block discarded – undo
377 377
     }
378 378
 
379 379
    /* Draw a scatter plot chart */
380
-   function drawScatterPlotChart($Format=NULL)
380
+   function drawScatterPlotChart($Format=null)
381 381
     {
382 382
      $PlotSize		= isset($Format["PlotSize"]) ? $Format["PlotSize"] : 3;
383
-     $PlotBorder	= isset($Format["PlotBorder"]) ? $Format["PlotBorder"] : FALSE;
383
+     $PlotBorder	= isset($Format["PlotBorder"]) ? $Format["PlotBorder"] : false;
384 384
      $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 250;
385 385
      $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 250;
386 386
      $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 250;
387 387
      $BorderAlpha	= isset($Format["BorderAlpha"]) ? $Format["BorderAlpha"] : 30;
388 388
      $BorderSize	= isset($Format["BorderSize"]) ? $Format["BorderSize"] : 1;
389
-     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
390
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
391
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
389
+     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : null;
390
+     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : false;
391
+     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : null;
392 392
      $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
393 393
 
394 394
      $Data    = $this->pDataObject->getData();
@@ -398,17 +398,17 @@  discard block
 block discarded – undo
398 398
 
399 399
      foreach($Data["ScatterSeries"] as $Key => $Series)
400 400
       {
401
-       if ( $Series["isDrawable"] == TRUE )
401
+       if ( $Series["isDrawable"] == true )
402 402
         {
403 403
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
404 404
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
405 405
 
406
-         if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
406
+         if ( $ImageMapTitle == null ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
407 407
          
408 408
          if ( isset($Series["Picture"]) && $Series["Picture"] != "" )
409 409
           { $Picture = $Series["Picture"]; list($PicWidth,$PicHeight,$PicType) = $this->pChartObject->getPicInfo($Picture); }
410 410
          else
411
-          { $Picture = NULL; }
411
+          { $Picture = null; }
412 412
 
413 413
          $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
414 414
          if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 
429 429
              if( isset($Series["Shape"]) )
430 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 )
431
+             elseif ( $Picture == null )
432 432
               {
433 433
                if ( $PlotBorder ) { $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize+$BorderSize,$BorderColor); }
434 434
                $this->pChartObject->drawFilledCircle($X,$Y,$PlotSize,$Color);
@@ -442,26 +442,26 @@  discard block
 block discarded – undo
442 442
     }
443 443
 
444 444
    /* Draw a scatter line chart */
445
-   function drawScatterLineChart($Format=NULL)
445
+   function drawScatterLineChart($Format=null)
446 446
     {
447 447
      $Data		= $this->pDataObject->getData();
448 448
      $Palette		= $this->pDataObject->getPalette();
449
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
450
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
449
+     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : false;
450
+     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : null;
451 451
      $ImageMapPlotSize	= isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
452 452
      $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
453 453
 
454 454
      /* Parse all the series to draw */
455 455
      foreach($Data["ScatterSeries"] as $Key => $Series)
456 456
       {
457
-       if ( $Series["isDrawable"] == TRUE )
457
+       if ( $Series["isDrawable"] == true )
458 458
         {
459 459
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
460 460
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
461 461
          $Ticks  = $Series["Ticks"];
462 462
          $Weight = $Series["Weight"];
463 463
 
464
-         if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
464
+         if ( $ImageMapTitle == null ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
465 465
 
466 466
          $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
467 467
          if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
@@ -493,25 +493,25 @@  discard block
 block discarded – undo
493 493
     }
494 494
 
495 495
    /* Draw a scatter spline chart */
496
-   function drawScatterSplineChart($Format=NULL)
496
+   function drawScatterSplineChart($Format=null)
497 497
     {
498 498
      $Data		= $this->pDataObject->getData();
499 499
      $Palette		= $this->pDataObject->getPalette();
500
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
501
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : NULL;
500
+     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : false;
501
+     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : null;
502 502
      $ImageMapPlotSize	= isset($Format["ImageMapPlotSize"]) ? $Format["ImageMapPlotSize"] : 10;
503 503
      $ImageMapPrecision = isset($Format["ImageMapPrecision"]) ? $Format["ImageMapPrecision"] : 2;
504 504
 
505 505
      foreach($Data["ScatterSeries"] as $Key => $Series)
506 506
       {
507
-       if ( $Series["isDrawable"] == TRUE )
507
+       if ( $Series["isDrawable"] == true )
508 508
         {
509 509
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
510 510
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
511 511
          $Ticks  = $Series["Ticks"];
512 512
          $Weight = $Series["Weight"];
513 513
 
514
-         if ( $ImageMapTitle == NULL ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
514
+         if ( $ImageMapTitle == null ) { $Description = $Data["Series"][$Series["X"]]["Description"]." / ".$Data["Series"][$Series["Y"]]["Description"]; } else { $Description = $ImageMapTitle; }
515 515
 
516 516
          $PosArrayX = $this->getPosArray($SerieValuesX,$SerieXAxis);
517 517
          if ( !is_array($PosArrayX) ) { $Value = $PosArrayX; $PosArrayX = ""; $PosArrayX[0] = $Value; }
@@ -613,17 +613,17 @@  discard block
 block discarded – undo
613 613
      $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 255;
614 614
      $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 255;
615 615
      $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 255;
616
-     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
616
+     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : null;
617 617
      $Style		= isset($Format["Style"]) ? $Format["Style"] : LEGEND_ROUND;
618 618
      $Mode		= isset($Format["Mode"]) ? $Format["Mode"] : LEGEND_VERTICAL;
619 619
 
620
-     if ( $Surrounding != NULL ) { $BorderR = $R + $Surrounding; $BorderG = $G + $Surrounding; $BorderB = $B + $Surrounding; }
620
+     if ( $Surrounding != null ) { $BorderR = $R + $Surrounding; $BorderG = $G + $Surrounding; $BorderB = $B + $Surrounding; }
621 621
 
622 622
      $Data = $this->pDataObject->getData();
623 623
 
624 624
      foreach($Data["ScatterSeries"] as $Key => $Series)
625 625
       {
626
-       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
626
+       if ( $Series["isDrawable"] == true && isset($Series["Picture"]))
627 627
         {
628 628
          list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
629 629
          if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
      $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
639 639
      foreach($Data["ScatterSeries"] as $Key => $Series)
640 640
       {
641
-       if ( $Series["isDrawable"] == TRUE )
641
+       if ( $Series["isDrawable"] == true )
642 642
         {
643 643
          if ( $Mode == LEGEND_VERTICAL )
644 644
           {
@@ -680,10 +680,10 @@  discard block
 block discarded – undo
680 680
      elseif ( $Style == LEGEND_BOX )
681 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));
682 682
 
683
-     $RestoreShadow = $this->pChartObject->Shadow; $this->Shadow = FALSE;
683
+     $RestoreShadow = $this->pChartObject->Shadow; $this->Shadow = false;
684 684
      foreach($Data["ScatterSeries"] as $Key => $Series)
685 685
       {
686
-       if ( $Series["isDrawable"] == TRUE )
686
+       if ( $Series["isDrawable"] == true )
687 687
         {
688 688
          $R = $Series["Color"]["R"]; $G = $Series["Color"]["G"]; $B = $Series["Color"]["B"];
689 689
          $Ticks = $Series["Ticks"]; $Weight = $Series["Weight"];
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
 
763 763
      foreach($Data["ScatterSeries"] as $Key => $Series)
764 764
       {
765
-       if ( $Series["isDrawable"] == TRUE && isset($Series["Picture"]))
765
+       if ( $Series["isDrawable"] == true && isset($Series["Picture"]))
766 766
         {
767 767
          list($PicWidth,$PicHeight) = $this->pChartObject->getPicInfo($Series["Picture"]);
768 768
          if ( $IconAreaWidth < $PicWidth ) { $IconAreaWidth = $PicWidth; }
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
      $Boundaries = ""; $Boundaries["L"] = $X; $Boundaries["T"] = $Y; $Boundaries["R"] = 0; $Boundaries["B"] = 0; $vY = $Y; $vX = $X;
778 778
      foreach($Data["ScatterSeries"] as $Key => $Series)
779 779
       {
780
-       if ( $Series["isDrawable"] == TRUE )
780
+       if ( $Series["isDrawable"] == true )
781 781
         {
782 782
          if ( $Mode == LEGEND_VERTICAL )
783 783
           {
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 
830 830
      foreach($Data["ScatterSeries"] as $Key => $Series)
831 831
       {
832
-       if ( $Series["isDrawable"] == TRUE )
832
+       if ( $Series["isDrawable"] == true )
833 833
         {
834 834
          $SerieX = $Series["X"]; $SerieValuesX = $Data["Series"][$SerieX]["Data"]; $SerieXAxis = $Data["Series"][$SerieX]["Axis"];
835 835
          $SerieY = $Series["Y"]; $SerieValuesY = $Data["Series"][$SerieY]["Data"]; $SerieYAxis = $Data["Series"][$SerieY]["Axis"];
@@ -885,9 +885,9 @@  discard block
 block discarded – undo
885 885
 
886 886
    function writeScatterLabel($ScatterSerieID,$Points,$Format="")
887 887
     {
888
-     $OverrideTitle	= isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : NULL;
888
+     $OverrideTitle	= isset($Format["OverrideTitle"]) ? $Format["OverrideTitle"] : null;
889 889
      $DrawPoint		= isset($Format["DrawPoint"]) ? $Format["DrawPoint"] : LABEL_POINT_BOX;
890
-     $Decimals		= isset($Format["Decimals"]) ? $Format["Decimals"] : NULL;
890
+     $Decimals		= isset($Format["Decimals"]) ? $Format["Decimals"] : null;
891 891
 
892 892
      $Data    = $this->pDataObject->getData();
893 893
      $Palette = $this->pDataObject->getPalette();
@@ -927,13 +927,13 @@  discard block
 block discarded – undo
927 927
          $XAxisMode   = $Data["Axis"][$SerieXAxis]["Display"];
928 928
          $XAxisFormat = $Data["Axis"][$SerieXAxis]["Format"];
929 929
          $XAxisUnit   = $Data["Axis"][$SerieXAxis]["Unit"];
930
-         if ( $Decimals == NULL ) { $XValue = $SerieValuesX[$Point]; } else { $XValue = round($SerieValuesX[$Point],$Decimals); }
930
+         if ( $Decimals == null ) { $XValue = $SerieValuesX[$Point]; } else { $XValue = round($SerieValuesX[$Point],$Decimals); }
931 931
          $XValue      = $this->pChartObject->scaleFormat($XValue,$XAxisMode,$XAxisFormat,$XAxisUnit);
932 932
 
933 933
          $YAxisMode   = $Data["Axis"][$SerieYAxis]["Display"];
934 934
          $YAxisFormat = $Data["Axis"][$SerieYAxis]["Format"];
935 935
          $YAxisUnit   = $Data["Axis"][$SerieYAxis]["Unit"];
936
-         if ( $Decimals == NULL ) { $YValue = $SerieValuesY[$Point]; } else { $YValue = round($SerieValuesY[$Point],$Decimals); }
936
+         if ( $Decimals == null ) { $YValue = $SerieValuesY[$Point]; } else { $YValue = round($SerieValuesY[$Point],$Decimals); }
937 937
          $YValue      = $this->pChartObject->scaleFormat($YValue,$YAxisMode,$YAxisFormat,$YAxisUnit);
938 938
 
939 939
          $Caption = $XValue." / ".$YValue;
@@ -959,22 +959,22 @@  discard block
 block discarded – undo
959 959
      $G			= isset($Format["G"]) ? $Format["G"] : 0;
960 960
      $B			= isset($Format["B"]) ? $Format["B"] : 0;
961 961
      $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : 50;
962
-     $Weight		= isset($Format["Weight"]) ? $Format["Weight"] : NULL;
962
+     $Weight		= isset($Format["Weight"]) ? $Format["Weight"] : null;
963 963
      $Ticks		= isset($Format["Ticks"]) ? $Format["Ticks"] : 3;
964
-     $Wide		= isset($Format["Wide"]) ? $Format["Wide"] : FALSE;
964
+     $Wide		= isset($Format["Wide"]) ? $Format["Wide"] : false;
965 965
      $WideFactor	= isset($Format["WideFactor"]) ? $Format["WideFactor"] : 5;
966
-     $WriteCaption	= isset($Format["WriteCaption"]) ? $Format["WriteCaption"] : FALSE;
967
-     $Caption		= isset($Format["Caption"]) ? $Format["Caption"] : NULL;
966
+     $WriteCaption	= isset($Format["WriteCaption"]) ? $Format["WriteCaption"] : false;
967
+     $Caption		= isset($Format["Caption"]) ? $Format["Caption"] : null;
968 968
      $CaptionAlign	= isset($Format["CaptionAlign"]) ? $Format["CaptionAlign"] : CAPTION_LEFT_TOP;
969 969
      $CaptionOffset     = isset($Format["CaptionOffset"]) ? $Format["CaptionOffset"] : 10;
970 970
      $CaptionR		= isset($Format["CaptionR"]) ? $Format["CaptionR"] : 255;
971 971
      $CaptionG		= isset($Format["CaptionG"]) ? $Format["CaptionG"] : 255;
972 972
      $CaptionB		= isset($Format["CaptionB"]) ? $Format["CaptionB"] : 255;
973 973
      $CaptionAlpha	= isset($Format["CaptionAlpha"]) ? $Format["CaptionAlpha"] : 100;
974
-     $DrawBox		= isset($Format["DrawBox"]) ? $Format["DrawBox"] : TRUE;
975
-     $DrawBoxBorder	= isset($Format["DrawBoxBorder"]) ? $Format["DrawBoxBorder"] : FALSE;
974
+     $DrawBox		= isset($Format["DrawBox"]) ? $Format["DrawBox"] : true;
975
+     $DrawBoxBorder	= isset($Format["DrawBoxBorder"]) ? $Format["DrawBoxBorder"] : false;
976 976
      $BorderOffset	= isset($Format["BorderOffset"]) ? $Format["BorderOffset"] : 5;
977
-     $BoxRounded	= isset($Format["BoxRounded"]) ? $Format["BoxRounded"] : TRUE;
977
+     $BoxRounded	= isset($Format["BoxRounded"]) ? $Format["BoxRounded"] : true;
978 978
      $RoundedRadius	= isset($Format["RoundedRadius"]) ? $Format["RoundedRadius"] : 3;
979 979
      $BoxR		= isset($Format["BoxR"]) ? $Format["BoxR"] : 0;
980 980
      $BoxG		= isset($Format["BoxG"]) ? $Format["BoxG"] : 0;
@@ -991,7 +991,7 @@  discard block
 block discarded – undo
991 991
                               "BoxBorderR"=>$BoxBorderR,"BoxBorderG"=>$BoxBorderG,"BoxBorderB"=>$BoxBorderB,"BoxBorderAlpha"=>$BoxBorderAlpha,
992 992
                               "R"=>$CaptionR,"G"=>$CaptionG,"B"=>$CaptionB,"Alpha"=>$CaptionAlpha);
993 993
 
994
-     if ( $Caption == NULL ) { $Caption = $Value; }
994
+     if ( $Caption == null ) { $Caption = $Value; }
995 995
 
996 996
      $Data = $this->pDataObject->getData();
997 997
 
@@ -1060,7 +1060,7 @@  discard block
 block discarded – undo
1060 1060
      $G		= isset($Format["G"]) ? $Format["G"] : 0;
1061 1061
      $B		= isset($Format["B"]) ? $Format["B"] : 0;
1062 1062
      $Alpha	= isset($Format["Alpha"]) ? $Format["Alpha"] : 20;
1063
-     $Border    = isset($Format["Border"]) ? $Format["Border"] : TRUE;
1063
+     $Border    = isset($Format["Border"]) ? $Format["Border"] : true;
1064 1064
      $BorderR   = isset($Format["BorderR"]) ? $Format["BorderR"] : $R;
1065 1065
      $BorderG   = isset($Format["BorderG"]) ? $Format["BorderG"] : $G;
1066 1066
      $BorderB   = isset($Format["BorderB"]) ? $Format["BorderB"] : $B;
@@ -1072,12 +1072,12 @@  discard block
 block discarded – undo
1072 1072
      $NameG	= isset($Format["NameG"]) ? $Format["NameG"] : 255;
1073 1073
      $NameB	= isset($Format["NameB"]) ? $Format["NameB"] : 255;
1074 1074
      $NameAlpha	= isset($Format["NameAlpha"]) ? $Format["NameAlpha"] : 100;
1075
-     $DisableShadowOnArea = isset($Format["DisableShadowOnArea"]) ? $Format["DisableShadowOnArea"] : TRUE;
1075
+     $DisableShadowOnArea = isset($Format["DisableShadowOnArea"]) ? $Format["DisableShadowOnArea"] : true;
1076 1076
 
1077 1077
      if ($Value1 > $Value2) { list($Value1, $Value2) = array($Value2, $Value1); }
1078 1078
 
1079 1079
      $RestoreShadow = $this->pChartObject->Shadow;
1080
-     if ( $DisableShadowOnArea && $this->pChartObject->Shadow ) { $this->pChartObject->Shadow = FALSE; }
1080
+     if ( $DisableShadowOnArea && $this->pChartObject->Shadow ) { $this->pChartObject->Shadow = false; }
1081 1081
 
1082 1082
      if ($BorderAlpha >100) { $BorderAlpha = 100;}
1083 1083
 
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
          $this->pChartObject->drawLine($X2,$Y1,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1104 1104
         }
1105 1105
 
1106
-       if ( $AreaName != NULL )
1106
+       if ( $AreaName != null )
1107 1107
         {
1108 1108
          $XPos = ($X2-$X1)/2 + $X1;
1109 1109
          $YPos = ($Y2-$Y1)/2 + $Y1;
@@ -1116,7 +1116,7 @@  discard block
 block discarded – undo
1116 1116
           }
1117 1117
          $this->pChartObject->Shadow = $RestoreShadow;
1118 1118
          $this->pChartObject->drawText($XPos,$YPos,$AreaName,array("R"=>$NameR,"G"=>$NameG,"B"=>$NameB,"Alpha"=>$NameAlpha,"Angle"=>$NameAngle,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1119
-         if ( $DisableShadowOnArea ) { $this->pChartObject->Shadow = FALSE; }
1119
+         if ( $DisableShadowOnArea ) { $this->pChartObject->Shadow = false; }
1120 1120
         }
1121 1121
 
1122 1122
        $this->pChartObject->Shadow = $RestoreShadow;
@@ -1140,14 +1140,14 @@  discard block
 block discarded – undo
1140 1140
          $this->pChartObject->drawLine($X1,$Y2,$X2,$Y2,array("R"=>$BorderR,"G"=>$BorderG,"B"=>$BorderB,"Alpha"=>$BorderAlpha,"Ticks"=>$BorderTicks));
1141 1141
         }
1142 1142
 
1143
-       if ( $AreaName != NULL )
1143
+       if ( $AreaName != null )
1144 1144
         {
1145 1145
          $XPos = ($X2-$X1)/2 + $X1;
1146 1146
          $YPos = ($Y2-$Y1)/2 + $Y1;
1147 1147
 
1148 1148
          $this->pChartObject->Shadow = $RestoreShadow;
1149 1149
          $this->pChartObject->drawText($YPos,$XPos,$AreaName,array("R"=>$NameR,"G"=>$NameG,"B"=>$NameB,"Alpha"=>$NameAlpha,"Angle"=>0,"Align"=>TEXT_ALIGN_MIDDLEMIDDLE));
1150
-         if ( $DisableShadowOnArea ) { $this->Shadow = FALSE; }
1150
+         if ( $DisableShadowOnArea ) { $this->Shadow = false; }
1151 1151
         }
1152 1152
 
1153 1153
        $this->pChartObject->Shadow = $RestoreShadow;
Please login to merge, or discard this patch.
default/boinc/modules/boincstats/includes/pchart/class/pSplit.class.php 4 patches
Indentation   +90 added lines, -90 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
- /*
2
+    /*
3 3
      pSplit - class to draw spline splitted charts
4 4
 
5 5
      Version     : 2.1.3
@@ -13,119 +13,119 @@  discard block
 block discarded – undo
13 13
      You can find the whole class documentation on the pChart web site.
14 14
  */
15 15
 
16
- define("TEXT_POS_TOP"		, 690001);
17
- define("TEXT_POS_RIGHT"	, 690002);
16
+    define("TEXT_POS_TOP"		, 690001);
17
+    define("TEXT_POS_RIGHT"	, 690002);
18 18
 
19
- /* pSplit class definition */
20
- class pSplit
21
-  {
22
-   var $pChartObject;
19
+    /* pSplit class definition */
20
+    class pSplit
21
+    {
22
+    var $pChartObject;
23 23
 
24
-   /* Class creator */
25
-   function pSplit()
24
+    /* Class creator */
25
+    function pSplit()
26 26
     { }
27 27
 
28
-   /* Create the encoded string */
29
-   function drawSplitPath($Object,$Values,$Format="")
28
+    /* Create the encoded string */
29
+    function drawSplitPath($Object,$Values,$Format="")
30 30
     {
31
-     $this->pChartObject = $Object;
32
-
33
-     $Spacing		= isset($Format["Spacing"]) ? $Format["Spacing"] : 20;
34
-     $TextPadding	= isset($Format["TextPadding"]) ? $Format["TextPadding"] : 2;
35
-     $TextPos		= isset($Format["TextPos"]) ? $Format["TextPos"] : TEXT_POS_TOP;
36
-     $Surrounding       = isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
37
-     $Force		= isset($Format["Force"]) ? $Format["Force"] : 70;
38
-     $Segments		= isset($Format["Segments"]) ? $Format["Segments"] : 15;
39
-     $FontSize		= $Object->FontSize;
40
-     $X1		= $Object->GraphAreaX1;
41
-     $Y1		= $Object->GraphAreaY1;
42
-     $X2		= $Object->GraphAreaX2;
43
-     $Y2		= $Object->GraphAreaY2;
44
-
45
-     /* Data Processing */
46
-     $Data    = $Values->getData();
47
-     $Palette = $Values->getPalette();
48
-
49
-     $LabelSerie = $Data["Abscissa"];
50
-     $DataSerie  = "";
51
-
52
-     foreach($Data["Series"] as $SerieName => $Value)
53
-      { if ( $SerieName != $LabelSerie && $DataSerie == "" ) { $DataSerie = $SerieName; } }
54
-
55
-     $DataSerieSum   = array_sum($Data["Series"][$DataSerie]["Data"]);
56
-     $DataSerieCount = count($Data["Series"][$DataSerie]["Data"]);
57
-
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;
63
-     $LeftHeight = $DataSerieSum * $YScale;
64
-
65
-     /* Re-compute graph width depending of the text mode choosen */
66
-     if ( $TextPos == TEXT_POS_RIGHT )
67
-      {
68
-       $MaxWidth = 0;
69
-       foreach($Data["Series"][$LabelSerie]["Data"] as $Key => $Label)
31
+        $this->pChartObject = $Object;
32
+
33
+        $Spacing		= isset($Format["Spacing"]) ? $Format["Spacing"] : 20;
34
+        $TextPadding	= isset($Format["TextPadding"]) ? $Format["TextPadding"] : 2;
35
+        $TextPos		= isset($Format["TextPos"]) ? $Format["TextPos"] : TEXT_POS_TOP;
36
+        $Surrounding       = isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
37
+        $Force		= isset($Format["Force"]) ? $Format["Force"] : 70;
38
+        $Segments		= isset($Format["Segments"]) ? $Format["Segments"] : 15;
39
+        $FontSize		= $Object->FontSize;
40
+        $X1		= $Object->GraphAreaX1;
41
+        $Y1		= $Object->GraphAreaY1;
42
+        $X2		= $Object->GraphAreaX2;
43
+        $Y2		= $Object->GraphAreaY2;
44
+
45
+        /* Data Processing */
46
+        $Data    = $Values->getData();
47
+        $Palette = $Values->getPalette();
48
+
49
+        $LabelSerie = $Data["Abscissa"];
50
+        $DataSerie  = "";
51
+
52
+        foreach($Data["Series"] as $SerieName => $Value)
53
+        { if ( $SerieName != $LabelSerie && $DataSerie == "" ) { $DataSerie = $SerieName; } }
54
+
55
+        $DataSerieSum   = array_sum($Data["Series"][$DataSerie]["Data"]);
56
+        $DataSerieCount = count($Data["Series"][$DataSerie]["Data"]);
57
+
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;
63
+        $LeftHeight = $DataSerieSum * $YScale;
64
+
65
+        /* Re-compute graph width depending of the text mode choosen */
66
+        if ( $TextPos == TEXT_POS_RIGHT )
67
+        {
68
+        $MaxWidth = 0;
69
+        foreach($Data["Series"][$LabelSerie]["Data"] as $Key => $Label)
70 70
         {
71
-         $Boundardies = $Object->getTextBox(0,0,$Object->FontName,$Object->FontSize,0,$Label);
72
-         if ( $Boundardies[1]["X"] > $MaxWidth ) { $MaxWidth = $Boundardies[1]["X"] + $TextPadding*2; }
71
+            $Boundardies = $Object->getTextBox(0,0,$Object->FontName,$Object->FontSize,0,$Label);
72
+            if ( $Boundardies[1]["X"] > $MaxWidth ) { $MaxWidth = $Boundardies[1]["X"] + $TextPadding*2; }
73
+        }
74
+        $X2 = $X2 - $MaxWidth;
73 75
         }
74
-       $X2 = $X2 - $MaxWidth;
75
-      }
76 76
 
77
-     /* Drawing */
78
-     $LeftY    = ((($Y2-$Y1) / 2) + $Y1) - ($LeftHeight/2);
79
-     $RightY   = $Y1;
80
-     $VectorX  = (($X2-$X1) / 2);
77
+        /* Drawing */
78
+        $LeftY    = ((($Y2-$Y1) / 2) + $Y1) - ($LeftHeight/2);
79
+        $RightY   = $Y1;
80
+        $VectorX  = (($X2-$X1) / 2);
81 81
 
82
-     foreach($Data["Series"][$DataSerie]["Data"] as $Key => $Value)
83
-      {
84
-       if ( isset($Data["Series"][$LabelSerie]["Data"][$Key]) )
82
+        foreach($Data["Series"][$DataSerie]["Data"] as $Key => $Value)
83
+        {
84
+        if ( isset($Data["Series"][$LabelSerie]["Data"][$Key]) )
85 85
         $Label = $Data["Series"][$LabelSerie]["Data"][$Key];
86
-       else
86
+        else
87 87
         $Label = "-";
88 88
 
89
-       $LeftY1 = $LeftY;
90
-       $LeftY2 = $LeftY + $Value * $YScale;
89
+        $LeftY1 = $LeftY;
90
+        $LeftY2 = $LeftY + $Value * $YScale;
91 91
 
92
-       $RightY1 = $RightY + $Spacing;
93
-       $RightY2 = $RightY + $Spacing + $Value * $YScale;;
92
+        $RightY1 = $RightY + $Spacing;
93
+        $RightY2 = $RightY + $Spacing + $Value * $YScale;;
94 94
 
95
-       $Settings = array("R"=>$Palette[$Key]["R"],"G"=>$Palette[$Key]["G"],"B"=>$Palette[$Key]["B"],"Alpha"=>$Palette[$Key]["Alpha"],"NoDraw"=>TRUE,"Segments"=>$Segments,"Surrounding"=>$Surrounding);
95
+        $Settings = array("R"=>$Palette[$Key]["R"],"G"=>$Palette[$Key]["G"],"B"=>$Palette[$Key]["B"],"Alpha"=>$Palette[$Key]["Alpha"],"NoDraw"=>TRUE,"Segments"=>$Segments,"Surrounding"=>$Surrounding);
96 96
 
97
-       $PolyGon = "";
97
+        $PolyGon = "";
98 98
 
99
-       $Angle    = $Object->getAngle($X2,$RightY1,$X1,$LeftY1);
100
-       $VectorX1 = cos(deg2rad($Angle+90)) * $Force + ($X2-$X1)/2 + $X1;
101
-       $VectorY1 = sin(deg2rad($Angle+90)) * $Force + ($RightY1-$LeftY1)/2 + $LeftY1;
102
-       $VectorX2 = cos(deg2rad($Angle-90)) * $Force + ($X2-$X1)/2 + $X1;
103
-       $VectorY2 = sin(deg2rad($Angle-90)) * $Force + ($RightY1-$LeftY1)/2 + $LeftY1;
99
+        $Angle    = $Object->getAngle($X2,$RightY1,$X1,$LeftY1);
100
+        $VectorX1 = cos(deg2rad($Angle+90)) * $Force + ($X2-$X1)/2 + $X1;
101
+        $VectorY1 = sin(deg2rad($Angle+90)) * $Force + ($RightY1-$LeftY1)/2 + $LeftY1;
102
+        $VectorX2 = cos(deg2rad($Angle-90)) * $Force + ($X2-$X1)/2 + $X1;
103
+        $VectorY2 = sin(deg2rad($Angle-90)) * $Force + ($RightY1-$LeftY1)/2 + $LeftY1;
104 104
 
105
-       $Points = $Object->drawBezier($X1,$LeftY1,$X2,$RightY1,$VectorX1,$VectorY1,$VectorX2,$VectorY2,$Settings);
106
-       foreach($Points as $Key => $Pos) { $PolyGon[] = $Pos["X"]; $PolyGon[] = $Pos["Y"]; }
105
+        $Points = $Object->drawBezier($X1,$LeftY1,$X2,$RightY1,$VectorX1,$VectorY1,$VectorX2,$VectorY2,$Settings);
106
+        foreach($Points as $Key => $Pos) { $PolyGon[] = $Pos["X"]; $PolyGon[] = $Pos["Y"]; }
107 107
 
108 108
 
109
-       $Angle    = $Object->getAngle($X2,$RightY2,$X1,$LeftY2);
110
-       $VectorX1 = cos(deg2rad($Angle+90)) * $Force + ($X2-$X1)/2 +$X1;
111
-       $VectorY1 = sin(deg2rad($Angle+90)) * $Force + ($RightY2-$LeftY2)/2 + $LeftY2;
112
-       $VectorX2 = cos(deg2rad($Angle-90)) * $Force + ($X2-$X1)/2 +$X1;
113
-       $VectorY2 = sin(deg2rad($Angle-90)) * $Force + ($RightY2-$LeftY2)/2 + $LeftY2;
109
+        $Angle    = $Object->getAngle($X2,$RightY2,$X1,$LeftY2);
110
+        $VectorX1 = cos(deg2rad($Angle+90)) * $Force + ($X2-$X1)/2 +$X1;
111
+        $VectorY1 = sin(deg2rad($Angle+90)) * $Force + ($RightY2-$LeftY2)/2 + $LeftY2;
112
+        $VectorX2 = cos(deg2rad($Angle-90)) * $Force + ($X2-$X1)/2 +$X1;
113
+        $VectorY2 = sin(deg2rad($Angle-90)) * $Force + ($RightY2-$LeftY2)/2 + $LeftY2;
114 114
 
115
-       $Points = $Object->drawBezier($X1,$LeftY2,$X2,$RightY2,$VectorX1,$VectorY1,$VectorX2,$VectorY2,$Settings);
116
-       $Points = array_reverse($Points);
117
-       foreach($Points as $Key => $Pos) { $PolyGon[] = $Pos["X"]; $PolyGon[] = $Pos["Y"]; }
115
+        $Points = $Object->drawBezier($X1,$LeftY2,$X2,$RightY2,$VectorX1,$VectorY1,$VectorX2,$VectorY2,$Settings);
116
+        $Points = array_reverse($Points);
117
+        foreach($Points as $Key => $Pos) { $PolyGon[] = $Pos["X"]; $PolyGon[] = $Pos["Y"]; }
118 118
 
119
-       $Object->drawPolygon($PolyGon,$Settings);
119
+        $Object->drawPolygon($PolyGon,$Settings);
120 120
 
121
-       if ( $TextPos == TEXT_POS_RIGHT )
121
+        if ( $TextPos == TEXT_POS_RIGHT )
122 122
         $Object->drawText($X2+$TextPadding,($RightY2-$RightY1)/2+$RightY1,$Label,array("Align"=>TEXT_ALIGN_MIDDLELEFT));
123
-       else
123
+        else
124 124
         $Object->drawText($X2,$RightY1-$TextPadding,$Label,array("Align"=>TEXT_ALIGN_BOTTOMRIGHT));
125 125
 
126
-       $LeftY  = $LeftY2;
127
-       $RightY = $RightY2;
128
-      }
126
+        $LeftY  = $LeftY2;
127
+        $RightY = $RightY2;
128
+        }
129
+    }
129 130
     }
130
-  }
131 131
 ?>
132 132
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
      You can find the whole class documentation on the pChart web site.
14 14
  */
15 15
 
16
- define("TEXT_POS_TOP"		, 690001);
17
- define("TEXT_POS_RIGHT"	, 690002);
16
+ define("TEXT_POS_TOP", 690001);
17
+ define("TEXT_POS_RIGHT", 690002);
18 18
 
19 19
  /* pSplit class definition */
20 20
  class pSplit
@@ -26,15 +26,15 @@  discard block
 block discarded – undo
26 26
     { }
27 27
 
28 28
    /* Create the encoded string */
29
-   function drawSplitPath($Object,$Values,$Format="")
29
+   function drawSplitPath($Object, $Values, $Format = "")
30 30
     {
31 31
      $this->pChartObject = $Object;
32 32
 
33 33
      $Spacing		= isset($Format["Spacing"]) ? $Format["Spacing"] : 20;
34
-     $TextPadding	= isset($Format["TextPadding"]) ? $Format["TextPadding"] : 2;
34
+     $TextPadding = isset($Format["TextPadding"]) ? $Format["TextPadding"] : 2;
35 35
      $TextPos		= isset($Format["TextPos"]) ? $Format["TextPos"] : TEXT_POS_TOP;
36
-     $Surrounding       = isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
37
-     $Force		= isset($Format["Force"]) ? $Format["Force"] : 70;
36
+     $Surrounding = isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
37
+     $Force = isset($Format["Force"]) ? $Format["Force"] : 70;
38 38
      $Segments		= isset($Format["Segments"]) ? $Format["Segments"] : 15;
39 39
      $FontSize		= $Object->FontSize;
40 40
      $X1		= $Object->GraphAreaX1;
@@ -49,79 +49,79 @@  discard block
 block discarded – undo
49 49
      $LabelSerie = $Data["Abscissa"];
50 50
      $DataSerie  = "";
51 51
 
52
-     foreach($Data["Series"] as $SerieName => $Value)
53
-      { if ( $SerieName != $LabelSerie && $DataSerie == "" ) { $DataSerie = $SerieName; } }
52
+     foreach ($Data["Series"] as $SerieName => $Value)
53
+      { if ($SerieName != $LabelSerie && $DataSerie == "") { $DataSerie = $SerieName; } }
54 54
 
55 55
      $DataSerieSum   = array_sum($Data["Series"][$DataSerie]["Data"]);
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;
59
+     if ($TextPos == TEXT_POS_RIGHT)
60
+      $YScale     = (($Y2 - $Y1) - (($DataSerieCount + 1)*$Spacing))/$DataSerieSum;
61 61
      else
62
-      $YScale     = (($Y2-$Y1) - ($DataSerieCount*$Spacing)) / $DataSerieSum;
63
-     $LeftHeight = $DataSerieSum * $YScale;
62
+      $YScale     = (($Y2 - $Y1) - ($DataSerieCount*$Spacing))/$DataSerieSum;
63
+     $LeftHeight = $DataSerieSum*$YScale;
64 64
 
65 65
      /* Re-compute graph width depending of the text mode choosen */
66
-     if ( $TextPos == TEXT_POS_RIGHT )
66
+     if ($TextPos == TEXT_POS_RIGHT)
67 67
       {
68 68
        $MaxWidth = 0;
69
-       foreach($Data["Series"][$LabelSerie]["Data"] as $Key => $Label)
69
+       foreach ($Data["Series"][$LabelSerie]["Data"] as $Key => $Label)
70 70
         {
71
-         $Boundardies = $Object->getTextBox(0,0,$Object->FontName,$Object->FontSize,0,$Label);
72
-         if ( $Boundardies[1]["X"] > $MaxWidth ) { $MaxWidth = $Boundardies[1]["X"] + $TextPadding*2; }
71
+         $Boundardies = $Object->getTextBox(0, 0, $Object->FontName, $Object->FontSize, 0, $Label);
72
+         if ($Boundardies[1]["X"] > $MaxWidth) { $MaxWidth = $Boundardies[1]["X"] + $TextPadding*2; }
73 73
         }
74 74
        $X2 = $X2 - $MaxWidth;
75 75
       }
76 76
 
77 77
      /* Drawing */
78
-     $LeftY    = ((($Y2-$Y1) / 2) + $Y1) - ($LeftHeight/2);
78
+     $LeftY    = ((($Y2 - $Y1)/2) + $Y1) - ($LeftHeight/2);
79 79
      $RightY   = $Y1;
80
-     $VectorX  = (($X2-$X1) / 2);
80
+     $VectorX  = (($X2 - $X1)/2);
81 81
 
82
-     foreach($Data["Series"][$DataSerie]["Data"] as $Key => $Value)
82
+     foreach ($Data["Series"][$DataSerie]["Data"] as $Key => $Value)
83 83
       {
84
-       if ( isset($Data["Series"][$LabelSerie]["Data"][$Key]) )
84
+       if (isset($Data["Series"][$LabelSerie]["Data"][$Key]))
85 85
         $Label = $Data["Series"][$LabelSerie]["Data"][$Key];
86 86
        else
87 87
         $Label = "-";
88 88
 
89 89
        $LeftY1 = $LeftY;
90
-       $LeftY2 = $LeftY + $Value * $YScale;
90
+       $LeftY2 = $LeftY + $Value*$YScale;
91 91
 
92 92
        $RightY1 = $RightY + $Spacing;
93
-       $RightY2 = $RightY + $Spacing + $Value * $YScale;;
93
+       $RightY2 = $RightY + $Spacing + $Value*$YScale; ;
94 94
 
95
-       $Settings = array("R"=>$Palette[$Key]["R"],"G"=>$Palette[$Key]["G"],"B"=>$Palette[$Key]["B"],"Alpha"=>$Palette[$Key]["Alpha"],"NoDraw"=>TRUE,"Segments"=>$Segments,"Surrounding"=>$Surrounding);
95
+       $Settings = array("R"=>$Palette[$Key]["R"], "G"=>$Palette[$Key]["G"], "B"=>$Palette[$Key]["B"], "Alpha"=>$Palette[$Key]["Alpha"], "NoDraw"=>TRUE, "Segments"=>$Segments, "Surrounding"=>$Surrounding);
96 96
 
97 97
        $PolyGon = "";
98 98
 
99
-       $Angle    = $Object->getAngle($X2,$RightY1,$X1,$LeftY1);
100
-       $VectorX1 = cos(deg2rad($Angle+90)) * $Force + ($X2-$X1)/2 + $X1;
101
-       $VectorY1 = sin(deg2rad($Angle+90)) * $Force + ($RightY1-$LeftY1)/2 + $LeftY1;
102
-       $VectorX2 = cos(deg2rad($Angle-90)) * $Force + ($X2-$X1)/2 + $X1;
103
-       $VectorY2 = sin(deg2rad($Angle-90)) * $Force + ($RightY1-$LeftY1)/2 + $LeftY1;
99
+       $Angle    = $Object->getAngle($X2, $RightY1, $X1, $LeftY1);
100
+       $VectorX1 = cos(deg2rad($Angle + 90))*$Force + ($X2 - $X1)/2 + $X1;
101
+       $VectorY1 = sin(deg2rad($Angle + 90))*$Force + ($RightY1 - $LeftY1)/2 + $LeftY1;
102
+       $VectorX2 = cos(deg2rad($Angle - 90))*$Force + ($X2 - $X1)/2 + $X1;
103
+       $VectorY2 = sin(deg2rad($Angle - 90))*$Force + ($RightY1 - $LeftY1)/2 + $LeftY1;
104 104
 
105
-       $Points = $Object->drawBezier($X1,$LeftY1,$X2,$RightY1,$VectorX1,$VectorY1,$VectorX2,$VectorY2,$Settings);
106
-       foreach($Points as $Key => $Pos) { $PolyGon[] = $Pos["X"]; $PolyGon[] = $Pos["Y"]; }
105
+       $Points = $Object->drawBezier($X1, $LeftY1, $X2, $RightY1, $VectorX1, $VectorY1, $VectorX2, $VectorY2, $Settings);
106
+       foreach ($Points as $Key => $Pos) { $PolyGon[] = $Pos["X"]; $PolyGon[] = $Pos["Y"]; }
107 107
 
108 108
 
109
-       $Angle    = $Object->getAngle($X2,$RightY2,$X1,$LeftY2);
110
-       $VectorX1 = cos(deg2rad($Angle+90)) * $Force + ($X2-$X1)/2 +$X1;
111
-       $VectorY1 = sin(deg2rad($Angle+90)) * $Force + ($RightY2-$LeftY2)/2 + $LeftY2;
112
-       $VectorX2 = cos(deg2rad($Angle-90)) * $Force + ($X2-$X1)/2 +$X1;
113
-       $VectorY2 = sin(deg2rad($Angle-90)) * $Force + ($RightY2-$LeftY2)/2 + $LeftY2;
109
+       $Angle    = $Object->getAngle($X2, $RightY2, $X1, $LeftY2);
110
+       $VectorX1 = cos(deg2rad($Angle + 90))*$Force + ($X2 - $X1)/2 + $X1;
111
+       $VectorY1 = sin(deg2rad($Angle + 90))*$Force + ($RightY2 - $LeftY2)/2 + $LeftY2;
112
+       $VectorX2 = cos(deg2rad($Angle - 90))*$Force + ($X2 - $X1)/2 + $X1;
113
+       $VectorY2 = sin(deg2rad($Angle - 90))*$Force + ($RightY2 - $LeftY2)/2 + $LeftY2;
114 114
 
115
-       $Points = $Object->drawBezier($X1,$LeftY2,$X2,$RightY2,$VectorX1,$VectorY1,$VectorX2,$VectorY2,$Settings);
115
+       $Points = $Object->drawBezier($X1, $LeftY2, $X2, $RightY2, $VectorX1, $VectorY1, $VectorX2, $VectorY2, $Settings);
116 116
        $Points = array_reverse($Points);
117
-       foreach($Points as $Key => $Pos) { $PolyGon[] = $Pos["X"]; $PolyGon[] = $Pos["Y"]; }
117
+       foreach ($Points as $Key => $Pos) { $PolyGon[] = $Pos["X"]; $PolyGon[] = $Pos["Y"]; }
118 118
 
119
-       $Object->drawPolygon($PolyGon,$Settings);
119
+       $Object->drawPolygon($PolyGon, $Settings);
120 120
 
121
-       if ( $TextPos == TEXT_POS_RIGHT )
122
-        $Object->drawText($X2+$TextPadding,($RightY2-$RightY1)/2+$RightY1,$Label,array("Align"=>TEXT_ALIGN_MIDDLELEFT));
121
+       if ($TextPos == TEXT_POS_RIGHT)
122
+        $Object->drawText($X2 + $TextPadding, ($RightY2 - $RightY1)/2 + $RightY1, $Label, array("Align"=>TEXT_ALIGN_MIDDLELEFT));
123 123
        else
124
-        $Object->drawText($X2,$RightY1-$TextPadding,$Label,array("Align"=>TEXT_ALIGN_BOTTOMRIGHT));
124
+        $Object->drawText($X2, $RightY1 - $TextPadding, $Label, array("Align"=>TEXT_ALIGN_BOTTOMRIGHT));
125 125
 
126 126
        $LeftY  = $LeftY2;
127 127
        $RightY = $RightY2;
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@  discard block
 block discarded – undo
17 17
  define("TEXT_POS_RIGHT"	, 690002);
18 18
 
19 19
  /* pSplit class definition */
20
- class pSplit
21
-  {
20
+ class pSplit {
22 21
    var $pChartObject;
23 22
 
24 23
    /* Class creator */
@@ -26,8 +25,7 @@  discard block
 block discarded – undo
26 25
     { }
27 26
 
28 27
    /* Create the encoded string */
29
-   function drawSplitPath($Object,$Values,$Format="")
30
-    {
28
+   function drawSplitPath($Object,$Values,$Format="") {
31 29
      $this->pChartObject = $Object;
32 30
 
33 31
      $Spacing		= isset($Format["Spacing"]) ? $Format["Spacing"] : 20;
@@ -63,11 +61,9 @@  discard block
 block discarded – undo
63 61
      $LeftHeight = $DataSerieSum * $YScale;
64 62
 
65 63
      /* Re-compute graph width depending of the text mode choosen */
66
-     if ( $TextPos == TEXT_POS_RIGHT )
67
-      {
64
+     if ( $TextPos == TEXT_POS_RIGHT ) {
68 65
        $MaxWidth = 0;
69
-       foreach($Data["Series"][$LabelSerie]["Data"] as $Key => $Label)
70
-        {
66
+       foreach($Data["Series"][$LabelSerie]["Data"] as $Key => $Label) {
71 67
          $Boundardies = $Object->getTextBox(0,0,$Object->FontName,$Object->FontSize,0,$Label);
72 68
          if ( $Boundardies[1]["X"] > $MaxWidth ) { $MaxWidth = $Boundardies[1]["X"] + $TextPadding*2; }
73 69
         }
@@ -79,8 +75,7 @@  discard block
 block discarded – undo
79 75
      $RightY   = $Y1;
80 76
      $VectorX  = (($X2-$X1) / 2);
81 77
 
82
-     foreach($Data["Series"][$DataSerie]["Data"] as $Key => $Value)
83
-      {
78
+     foreach($Data["Series"][$DataSerie]["Data"] as $Key => $Value) {
84 79
        if ( isset($Data["Series"][$LabelSerie]["Data"][$Key]) )
85 80
         $Label = $Data["Series"][$LabelSerie]["Data"][$Key];
86 81
        else
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      $Spacing		= isset($Format["Spacing"]) ? $Format["Spacing"] : 20;
34 34
      $TextPadding	= isset($Format["TextPadding"]) ? $Format["TextPadding"] : 2;
35 35
      $TextPos		= isset($Format["TextPos"]) ? $Format["TextPos"] : TEXT_POS_TOP;
36
-     $Surrounding       = isset($Format["Surrounding"]) ? $Format["Surrounding"] : NULL;
36
+     $Surrounding       = isset($Format["Surrounding"]) ? $Format["Surrounding"] : null;
37 37
      $Force		= isset($Format["Force"]) ? $Format["Force"] : 70;
38 38
      $Segments		= isset($Format["Segments"]) ? $Format["Segments"] : 15;
39 39
      $FontSize		= $Object->FontSize;
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
        $RightY1 = $RightY + $Spacing;
93 93
        $RightY2 = $RightY + $Spacing + $Value * $YScale;;
94 94
 
95
-       $Settings = array("R"=>$Palette[$Key]["R"],"G"=>$Palette[$Key]["G"],"B"=>$Palette[$Key]["B"],"Alpha"=>$Palette[$Key]["Alpha"],"NoDraw"=>TRUE,"Segments"=>$Segments,"Surrounding"=>$Surrounding);
95
+       $Settings = array("R"=>$Palette[$Key]["R"],"G"=>$Palette[$Key]["G"],"B"=>$Palette[$Key]["B"],"Alpha"=>$Palette[$Key]["Alpha"],"NoDraw"=>true,"Segments"=>$Segments,"Surrounding"=>$Surrounding);
96 96
 
97 97
        $PolyGon = "";
98 98
 
Please login to merge, or discard this patch.
default/boinc/modules/boincstats/includes/pchart/class/pStock.class.php 4 patches
Indentation   +160 added lines, -160 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
- /*
2
+    /*
3 3
      pStock - class to draw stock charts
4 4
 
5 5
      Version     : 2.1.3
@@ -13,204 +13,204 @@  discard block
 block discarded – undo
13 13
      You can find the whole class documentation on the pChart web site.
14 14
  */
15 15
 
16
- define("STOCK_MISSING_SERIE"	, 180001);
16
+    define("STOCK_MISSING_SERIE"	, 180001);
17 17
 
18
- /* pStock class definition */
19
- class pStock
20
-  {
21
-   var $pChartObject;
22
-   var $pDataObject;
18
+    /* pStock class definition */
19
+    class pStock
20
+    {
21
+    var $pChartObject;
22
+    var $pDataObject;
23 23
 
24
-   /* Class creator */
25
-   function pStock($pChartObject,$pDataObject)
24
+    /* Class creator */
25
+    function pStock($pChartObject,$pDataObject)
26 26
     {
27
-     $this->pChartObject = $pChartObject;
28
-     $this->pDataObject  = $pDataObject;
27
+        $this->pChartObject = $pChartObject;
28
+        $this->pDataObject  = $pDataObject;
29 29
     }
30 30
 
31
-   /* Draw a stock chart */
32
-   function drawStockChart($Format="")
31
+    /* Draw a stock chart */
32
+    function drawStockChart($Format="")
33 33
     {
34
-     $SerieOpen		= isset($Format["SerieOpen"]) ? $Format["SerieOpen"] : "Open";
35
-     $SerieClose	= isset($Format["SerieClose"]) ? $Format["SerieClose"] : "Close";
36
-     $SerieMin		= isset($Format["SerieMin"]) ? $Format["SerieMin"] : "Min";
37
-     $SerieMax		= isset($Format["SerieMax"]) ? $Format["SerieMax"] : "Max";
38
-     $SerieMedian	= isset($Format["SerieMedian"]) ? $Format["SerieMedian"] : NULL;
39
-     $LineWidth		= isset($Format["LineWidth"]) ? $Format["LineWidth"] : 1;
40
-     $LineR		= isset($Format["LineR"]) ? $Format["LineR"] : 0;
41
-     $LineG		= isset($Format["LineG"]) ? $Format["LineG"] : 0;
42
-     $LineB		= isset($Format["LineB"]) ? $Format["LineB"] : 0;
43
-     $LineAlpha		= isset($Format["LineAlpha"]) ? $Format["LineAlpha"] : 100;
44
-     $ExtremityWidth	= isset($Format["ExtremityWidth"]) ? $Format["ExtremityWidth"] : 1;
45
-     $ExtremityLength	= isset($Format["ExtremityLength"]) ? $Format["ExtremityLength"] : 3;
46
-     $ExtremityR	= isset($Format["ExtremityR"]) ? $Format["ExtremityR"] : 0;
47
-     $ExtremityG	= isset($Format["ExtremityG"]) ? $Format["ExtremityG"] : 0;
48
-     $ExtremityB	= isset($Format["ExtremityB"]) ? $Format["ExtremityB"] : 0;
49
-     $ExtremityAlpha	= isset($Format["ExtremityAlpha"]) ? $Format["ExtremityAlpha"] : 100;
50
-     $BoxWidth		= isset($Format["BoxWidth"]) ? $Format["BoxWidth"] : 8;
51
-     $BoxUpR		= isset($Format["BoxUpR"]) ? $Format["BoxUpR"] : 188;
52
-     $BoxUpG		= isset($Format["BoxUpG"]) ? $Format["BoxUpG"] : 224;
53
-     $BoxUpB		= isset($Format["BoxUpB"]) ? $Format["BoxUpB"] : 46;
54
-     $BoxUpAlpha	= isset($Format["BoxUpAlpha"]) ? $Format["BoxUpAlpha"] : 100;
55
-     $BoxUpSurrounding	= isset($Format["BoxUpSurrounding"]) ? $Format["BoxUpSurrounding"] : NULL;
56
-     $BoxUpBorderR	= isset($Format["BoxUpBorderR"]) ? $Format["BoxUpBorderR"] : $BoxUpR-20;
57
-     $BoxUpBorderG	= isset($Format["BoxUpBorderG"]) ? $Format["BoxUpBorderG"] : $BoxUpG-20;
58
-     $BoxUpBorderB	= isset($Format["BoxUpBorderB"]) ? $Format["BoxUpBorderB"] : $BoxUpB-20;
59
-     $BoxUpBorderAlpha	= isset($Format["BoxUpBorderAlpha"]) ? $Format["BoxUpBorderAlpha"] : 100;
60
-     $BoxDownR		= isset($Format["BoxDownR"]) ? $Format["BoxDownR"] : 224;
61
-     $BoxDownG		= isset($Format["BoxDownG"]) ? $Format["BoxDownG"] : 100;
62
-     $BoxDownB		= isset($Format["BoxDownB"]) ? $Format["BoxDownB"] : 46;
63
-     $BoxDownAlpha	= isset($Format["BoxDownAlpha"]) ? $Format["BoxDownAlpha"] : 100;
64
-     $BoxDownSurrounding= isset($Format["BoxDownSurrounding"]) ? $Format["BoxDownSurrounding"] : NULL;
65
-     $BoxDownBorderR	= isset($Format["BoxDownBorderR"]) ? $Format["BoxDownBorderR"] : $BoxDownR-20;
66
-     $BoxDownBorderG	= isset($Format["BoxDownBorderG"]) ? $Format["BoxDownBorderG"] : $BoxDownG-20;
67
-     $BoxDownBorderB	= isset($Format["BoxDownBorderB"]) ? $Format["BoxDownBorderB"] : $BoxDownB-20;
68
-     $BoxDownBorderAlpha= isset($Format["BoxDownBorderAlpha"]) ? $Format["BoxDownBorderAlpha"] : 100;
69
-     $ShadowOnBoxesOnly	= isset($Format["ShadowOnBoxesOnly"]) ? $Format["ShadowOnBoxesOnly"] : TRUE;
70
-     $MedianR		= isset($Format["MedianR"]) ? $Format["MedianR"] : 255;
71
-     $MedianG		= isset($Format["MedianG"]) ? $Format["MedianG"] : 0;
72
-     $MedianB		= isset($Format["MedianB"]) ? $Format["MedianB"] : 0;
73
-     $MedianAlpha	= isset($Format["MedianAlpha"]) ? $Format["MedianAlpha"] : 100;
74
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
75
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : "Stock Chart";
76
-
77
-
78
-     /* Data Processing */
79
-     $Data    = $this->pDataObject->getData();
80
-     $Palette = $this->pDataObject->getPalette();
81
-
82
-     if ( $BoxUpSurrounding != NULL )	{ $BoxUpBorderR = $BoxUpR + $BoxUpSurrounding; $BoxUpBorderG = $BoxUpG + $BoxUpSurrounding; $BoxUpBorderB = $BoxUpB + $BoxUpSurrounding; }
83
-     if ( $BoxDownSurrounding != NULL )	{ $BoxDownBorderR = $BoxDownR + $BoxDownSurrounding; $BoxDownBorderG = $BoxDownG + $BoxDownSurrounding; $BoxDownBorderB = $BoxDownB + $BoxDownSurrounding; }
84
-
85
-     if ( $LineWidth != 1 ) { $LineOffset = $LineWidth / 2; }
86
-     $BoxOffset = $BoxWidth / 2;
87
-
88
-     $Data = $this->pChartObject->DataSet->getData();
89
-     list($XMargin,$XDivs) = $this->pChartObject->scaleGetXSettings();
90
-
91
-     if ( !isset($Data["Series"][$SerieOpen]) || !isset($Data["Series"][$SerieClose]) || !isset($Data["Series"][$SerieMin]) || !isset($Data["Series"][$SerieMax]) )
92
-      return(STOCK_MISSING_SERIE);
93
-
94
-     $Plots = "";
95
-     foreach($Data["Series"][$SerieOpen]["Data"] as $Key => $Value)
96
-      {
97
-       $Point = "";
98
-       if ( isset($Data["Series"][$SerieClose]["Data"][$Key]) || isset($Data["Series"][$SerieMin]["Data"][$Key]) || isset($Data["Series"][$SerieMax]["Data"][$Key]) )
34
+        $SerieOpen		= isset($Format["SerieOpen"]) ? $Format["SerieOpen"] : "Open";
35
+        $SerieClose	= isset($Format["SerieClose"]) ? $Format["SerieClose"] : "Close";
36
+        $SerieMin		= isset($Format["SerieMin"]) ? $Format["SerieMin"] : "Min";
37
+        $SerieMax		= isset($Format["SerieMax"]) ? $Format["SerieMax"] : "Max";
38
+        $SerieMedian	= isset($Format["SerieMedian"]) ? $Format["SerieMedian"] : NULL;
39
+        $LineWidth		= isset($Format["LineWidth"]) ? $Format["LineWidth"] : 1;
40
+        $LineR		= isset($Format["LineR"]) ? $Format["LineR"] : 0;
41
+        $LineG		= isset($Format["LineG"]) ? $Format["LineG"] : 0;
42
+        $LineB		= isset($Format["LineB"]) ? $Format["LineB"] : 0;
43
+        $LineAlpha		= isset($Format["LineAlpha"]) ? $Format["LineAlpha"] : 100;
44
+        $ExtremityWidth	= isset($Format["ExtremityWidth"]) ? $Format["ExtremityWidth"] : 1;
45
+        $ExtremityLength	= isset($Format["ExtremityLength"]) ? $Format["ExtremityLength"] : 3;
46
+        $ExtremityR	= isset($Format["ExtremityR"]) ? $Format["ExtremityR"] : 0;
47
+        $ExtremityG	= isset($Format["ExtremityG"]) ? $Format["ExtremityG"] : 0;
48
+        $ExtremityB	= isset($Format["ExtremityB"]) ? $Format["ExtremityB"] : 0;
49
+        $ExtremityAlpha	= isset($Format["ExtremityAlpha"]) ? $Format["ExtremityAlpha"] : 100;
50
+        $BoxWidth		= isset($Format["BoxWidth"]) ? $Format["BoxWidth"] : 8;
51
+        $BoxUpR		= isset($Format["BoxUpR"]) ? $Format["BoxUpR"] : 188;
52
+        $BoxUpG		= isset($Format["BoxUpG"]) ? $Format["BoxUpG"] : 224;
53
+        $BoxUpB		= isset($Format["BoxUpB"]) ? $Format["BoxUpB"] : 46;
54
+        $BoxUpAlpha	= isset($Format["BoxUpAlpha"]) ? $Format["BoxUpAlpha"] : 100;
55
+        $BoxUpSurrounding	= isset($Format["BoxUpSurrounding"]) ? $Format["BoxUpSurrounding"] : NULL;
56
+        $BoxUpBorderR	= isset($Format["BoxUpBorderR"]) ? $Format["BoxUpBorderR"] : $BoxUpR-20;
57
+        $BoxUpBorderG	= isset($Format["BoxUpBorderG"]) ? $Format["BoxUpBorderG"] : $BoxUpG-20;
58
+        $BoxUpBorderB	= isset($Format["BoxUpBorderB"]) ? $Format["BoxUpBorderB"] : $BoxUpB-20;
59
+        $BoxUpBorderAlpha	= isset($Format["BoxUpBorderAlpha"]) ? $Format["BoxUpBorderAlpha"] : 100;
60
+        $BoxDownR		= isset($Format["BoxDownR"]) ? $Format["BoxDownR"] : 224;
61
+        $BoxDownG		= isset($Format["BoxDownG"]) ? $Format["BoxDownG"] : 100;
62
+        $BoxDownB		= isset($Format["BoxDownB"]) ? $Format["BoxDownB"] : 46;
63
+        $BoxDownAlpha	= isset($Format["BoxDownAlpha"]) ? $Format["BoxDownAlpha"] : 100;
64
+        $BoxDownSurrounding= isset($Format["BoxDownSurrounding"]) ? $Format["BoxDownSurrounding"] : NULL;
65
+        $BoxDownBorderR	= isset($Format["BoxDownBorderR"]) ? $Format["BoxDownBorderR"] : $BoxDownR-20;
66
+        $BoxDownBorderG	= isset($Format["BoxDownBorderG"]) ? $Format["BoxDownBorderG"] : $BoxDownG-20;
67
+        $BoxDownBorderB	= isset($Format["BoxDownBorderB"]) ? $Format["BoxDownBorderB"] : $BoxDownB-20;
68
+        $BoxDownBorderAlpha= isset($Format["BoxDownBorderAlpha"]) ? $Format["BoxDownBorderAlpha"] : 100;
69
+        $ShadowOnBoxesOnly	= isset($Format["ShadowOnBoxesOnly"]) ? $Format["ShadowOnBoxesOnly"] : TRUE;
70
+        $MedianR		= isset($Format["MedianR"]) ? $Format["MedianR"] : 255;
71
+        $MedianG		= isset($Format["MedianG"]) ? $Format["MedianG"] : 0;
72
+        $MedianB		= isset($Format["MedianB"]) ? $Format["MedianB"] : 0;
73
+        $MedianAlpha	= isset($Format["MedianAlpha"]) ? $Format["MedianAlpha"] : 100;
74
+        $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
75
+        $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : "Stock Chart";
76
+
77
+
78
+        /* Data Processing */
79
+        $Data    = $this->pDataObject->getData();
80
+        $Palette = $this->pDataObject->getPalette();
81
+
82
+        if ( $BoxUpSurrounding != NULL )	{ $BoxUpBorderR = $BoxUpR + $BoxUpSurrounding; $BoxUpBorderG = $BoxUpG + $BoxUpSurrounding; $BoxUpBorderB = $BoxUpB + $BoxUpSurrounding; }
83
+        if ( $BoxDownSurrounding != NULL )	{ $BoxDownBorderR = $BoxDownR + $BoxDownSurrounding; $BoxDownBorderG = $BoxDownG + $BoxDownSurrounding; $BoxDownBorderB = $BoxDownB + $BoxDownSurrounding; }
84
+
85
+        if ( $LineWidth != 1 ) { $LineOffset = $LineWidth / 2; }
86
+        $BoxOffset = $BoxWidth / 2;
87
+
88
+        $Data = $this->pChartObject->DataSet->getData();
89
+        list($XMargin,$XDivs) = $this->pChartObject->scaleGetXSettings();
90
+
91
+        if ( !isset($Data["Series"][$SerieOpen]) || !isset($Data["Series"][$SerieClose]) || !isset($Data["Series"][$SerieMin]) || !isset($Data["Series"][$SerieMax]) )
92
+        return(STOCK_MISSING_SERIE);
93
+
94
+        $Plots = "";
95
+        foreach($Data["Series"][$SerieOpen]["Data"] as $Key => $Value)
96
+        {
97
+        $Point = "";
98
+        if ( isset($Data["Series"][$SerieClose]["Data"][$Key]) || isset($Data["Series"][$SerieMin]["Data"][$Key]) || isset($Data["Series"][$SerieMax]["Data"][$Key]) )
99 99
         $Point = array($Value,$Data["Series"][$SerieClose]["Data"][$Key],$Data["Series"][$SerieMin]["Data"][$Key],$Data["Series"][$SerieMax]["Data"][$Key]);
100
-       if ( $SerieMedian != NULL && isset($Data["Series"][$SerieMedian]["Data"][$Key]) )
100
+        if ( $SerieMedian != NULL && isset($Data["Series"][$SerieMedian]["Data"][$Key]) )
101 101
         $Point[] = $Data["Series"][$SerieMedian]["Data"][$Key];
102 102
 
103
-       $Plots[] = $Point;
104
-      }
103
+        $Plots[] = $Point;
104
+        }
105 105
 
106
-     $AxisID	= $Data["Series"][$SerieOpen]["Axis"];
107
-     $Mode	= $Data["Axis"][$AxisID]["Display"];
108
-     $Format	= $Data["Axis"][$AxisID]["Format"];
109
-     $Unit	= $Data["Axis"][$AxisID]["Unit"];
106
+        $AxisID	= $Data["Series"][$SerieOpen]["Axis"];
107
+        $Mode	= $Data["Axis"][$AxisID]["Display"];
108
+        $Format	= $Data["Axis"][$AxisID]["Format"];
109
+        $Unit	= $Data["Axis"][$AxisID]["Unit"];
110 110
 
111
-     $YZero	= $this->pChartObject->scaleComputeY(0,array("AxisID"=>$AxisID));
112
-     $XStep	= ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs;
111
+        $YZero	= $this->pChartObject->scaleComputeY(0,array("AxisID"=>$AxisID));
112
+        $XStep	= ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs;
113 113
 
114
-     $X = $this->pChartObject->GraphAreaX1 + $XMargin;
115
-     $Y = $this->pChartObject->GraphAreaY1 + $XMargin;
114
+        $X = $this->pChartObject->GraphAreaX1 + $XMargin;
115
+        $Y = $this->pChartObject->GraphAreaY1 + $XMargin;
116 116
 
117
-     $LineSettings	= array("R"=>$LineR,"G"=>$LineG,"B"=>$LineB,"Alpha"=>$LineAlpha);
118
-     $ExtremitySettings	= array("R"=>$ExtremityR,"G"=>$ExtremityG,"B"=>$ExtremityB,"Alpha"=>$ExtremityAlpha);
119
-     $BoxUpSettings	= array("R"=>$BoxUpR,"G"=>$BoxUpG,"B"=>$BoxUpB,"Alpha"=>$BoxUpAlpha,"BorderR"=>$BoxUpBorderR,"BorderG"=>$BoxUpBorderG,"BorderB"=>$BoxUpBorderB,"BorderAlpha"=>$BoxUpBorderAlpha);
120
-     $BoxDownSettings	= array("R"=>$BoxDownR,"G"=>$BoxDownG,"B"=>$BoxDownB,"Alpha"=>$BoxDownAlpha,"BorderR"=>$BoxDownBorderR,"BorderG"=>$BoxDownBorderG,"BorderB"=>$BoxDownBorderB,"BorderAlpha"=>$BoxDownBorderAlpha);
121
-     $MedianSettings	= array("R"=>$MedianR,"G"=>$MedianG,"B"=>$MedianB,"Alpha"=>$MedianAlpha);
117
+        $LineSettings	= array("R"=>$LineR,"G"=>$LineG,"B"=>$LineB,"Alpha"=>$LineAlpha);
118
+        $ExtremitySettings	= array("R"=>$ExtremityR,"G"=>$ExtremityG,"B"=>$ExtremityB,"Alpha"=>$ExtremityAlpha);
119
+        $BoxUpSettings	= array("R"=>$BoxUpR,"G"=>$BoxUpG,"B"=>$BoxUpB,"Alpha"=>$BoxUpAlpha,"BorderR"=>$BoxUpBorderR,"BorderG"=>$BoxUpBorderG,"BorderB"=>$BoxUpBorderB,"BorderAlpha"=>$BoxUpBorderAlpha);
120
+        $BoxDownSettings	= array("R"=>$BoxDownR,"G"=>$BoxDownG,"B"=>$BoxDownB,"Alpha"=>$BoxDownAlpha,"BorderR"=>$BoxDownBorderR,"BorderG"=>$BoxDownBorderG,"BorderB"=>$BoxDownBorderB,"BorderAlpha"=>$BoxDownBorderAlpha);
121
+        $MedianSettings	= array("R"=>$MedianR,"G"=>$MedianG,"B"=>$MedianB,"Alpha"=>$MedianAlpha);
122 122
 
123
-     foreach($Plots as $Key =>$Points)
124
-      {
125
-       $PosArray = $this->pChartObject->scaleComputeY($Points,array("AxisID"=>$AxisID));
123
+        foreach($Plots as $Key =>$Points)
124
+        {
125
+        $PosArray = $this->pChartObject->scaleComputeY($Points,array("AxisID"=>$AxisID));
126 126
 
127
-       $Values = "Open :".$Data["Series"][$SerieOpen]["Data"][$Key]."<BR>Close : ".$Data["Series"][$SerieClose]["Data"][$Key]."<BR>Min : ".$Data["Series"][$SerieMin]["Data"][$Key]."<BR>Max : ".$Data["Series"][$SerieMax]["Data"][$Key]."<BR>";
128
-       if ( $SerieMedian != NULL ) { $Values = $Values."Median : ".$Data["Series"][$SerieMedian]["Data"][$Key]."<BR>"; }
129
-       if ( $PosArray[0] > $PosArray[1] ) { $ImageMapColor = $this->pChartObject->toHTMLColor($BoxUpR,$BoxUpG,$BoxUpB); } else { $ImageMapColor = $this->pChartObject->toHTMLColor($BoxDownR,$BoxDownG,$BoxDownB); } 
127
+        $Values = "Open :".$Data["Series"][$SerieOpen]["Data"][$Key]."<BR>Close : ".$Data["Series"][$SerieClose]["Data"][$Key]."<BR>Min : ".$Data["Series"][$SerieMin]["Data"][$Key]."<BR>Max : ".$Data["Series"][$SerieMax]["Data"][$Key]."<BR>";
128
+        if ( $SerieMedian != NULL ) { $Values = $Values."Median : ".$Data["Series"][$SerieMedian]["Data"][$Key]."<BR>"; }
129
+        if ( $PosArray[0] > $PosArray[1] ) { $ImageMapColor = $this->pChartObject->toHTMLColor($BoxUpR,$BoxUpG,$BoxUpB); } else { $ImageMapColor = $this->pChartObject->toHTMLColor($BoxDownR,$BoxDownG,$BoxDownB); } 
130 130
 
131
-       if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT )
131
+        if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT )
132 132
         {
133
-         if ( $YZero > $this->pChartObject->GraphAreaY2-1 ) { $YZero = $this->pChartObject->GraphAreaY2-1; }
134
-         if ( $YZero < $this->pChartObject->GraphAreaY1+1 ) { $YZero = $this->pChartObject->GraphAreaY1+1; }
133
+            if ( $YZero > $this->pChartObject->GraphAreaY2-1 ) { $YZero = $this->pChartObject->GraphAreaY2-1; }
134
+            if ( $YZero < $this->pChartObject->GraphAreaY1+1 ) { $YZero = $this->pChartObject->GraphAreaY1+1; }
135 135
 
136
-         if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs; }
136
+            if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs; }
137 137
 
138
-         if ( $ShadowOnBoxesOnly ) { $RestoreShadow = $this->pChartObject->Shadow; $this->pChartObject->Shadow = FALSE; }
138
+            if ( $ShadowOnBoxesOnly ) { $RestoreShadow = $this->pChartObject->Shadow; $this->pChartObject->Shadow = FALSE; }
139 139
 
140
-         if ( $LineWidth == 1 )
141
-          $this->pChartObject->drawLine($X,$PosArray[2],$X,$PosArray[3],$LineSettings);
142
-         else
143
-          $this->pChartObject->drawFilledRectangle($X-$LineOffset,$PosArray[2],$X+$LineOffset,$PosArray[3],$LineSettings);
140
+            if ( $LineWidth == 1 )
141
+            $this->pChartObject->drawLine($X,$PosArray[2],$X,$PosArray[3],$LineSettings);
142
+            else
143
+            $this->pChartObject->drawFilledRectangle($X-$LineOffset,$PosArray[2],$X+$LineOffset,$PosArray[3],$LineSettings);
144 144
 
145
-         if ( $ExtremityWidth == 1 )
146
-          {
147
-           $this->pChartObject->drawLine($X-$ExtremityLength,$PosArray[2],$X+$ExtremityLength,$PosArray[2],$ExtremitySettings);
148
-           $this->pChartObject->drawLine($X-$ExtremityLength,$PosArray[3],$X+$ExtremityLength,$PosArray[3],$ExtremitySettings);
145
+            if ( $ExtremityWidth == 1 )
146
+            {
147
+            $this->pChartObject->drawLine($X-$ExtremityLength,$PosArray[2],$X+$ExtremityLength,$PosArray[2],$ExtremitySettings);
148
+            $this->pChartObject->drawLine($X-$ExtremityLength,$PosArray[3],$X+$ExtremityLength,$PosArray[3],$ExtremitySettings);
149 149
 
150
-           if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($X-$ExtremityLength).",".floor($PosArray[2]).",".floor($X+$ExtremityLength).",".floor($PosArray[3]),$ImageMapColor,$ImageMapTitle,$Values); }
151
-          }
152
-         else
153
-          {
154
-           $this->pChartObject->drawFilledRectangle($X-$ExtremityLength,$PosArray[2],$X+$ExtremityLength,$PosArray[2]-$ExtremityWidth,$ExtremitySettings);
155
-           $this->pChartObject->drawFilledRectangle($X-$ExtremityLength,$PosArray[3],$X+$ExtremityLength,$PosArray[3]+$ExtremityWidth,$ExtremitySettings);
150
+            if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($X-$ExtremityLength).",".floor($PosArray[2]).",".floor($X+$ExtremityLength).",".floor($PosArray[3]),$ImageMapColor,$ImageMapTitle,$Values); }
151
+            }
152
+            else
153
+            {
154
+            $this->pChartObject->drawFilledRectangle($X-$ExtremityLength,$PosArray[2],$X+$ExtremityLength,$PosArray[2]-$ExtremityWidth,$ExtremitySettings);
155
+            $this->pChartObject->drawFilledRectangle($X-$ExtremityLength,$PosArray[3],$X+$ExtremityLength,$PosArray[3]+$ExtremityWidth,$ExtremitySettings);
156 156
 
157
-           if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($X-$ExtremityLength).",".floor($PosArray[2]-$ExtremityWidth).",".floor($X+$ExtremityLength).",".floor($PosArray[3]+$ExtremityWidth),$ImageMapColor,$ImageMapTitle,$Values); }
158
-          }
157
+            if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($X-$ExtremityLength).",".floor($PosArray[2]-$ExtremityWidth).",".floor($X+$ExtremityLength).",".floor($PosArray[3]+$ExtremityWidth),$ImageMapColor,$ImageMapTitle,$Values); }
158
+            }
159 159
 
160
-         if ( $ShadowOnBoxesOnly ) { $this->pChartObject->Shadow = $RestoreShadow; }
160
+            if ( $ShadowOnBoxesOnly ) { $this->pChartObject->Shadow = $RestoreShadow; }
161 161
 
162
-         if ( $PosArray[0] > $PosArray[1] )
163
-          $this->pChartObject->drawFilledRectangle($X-$BoxOffset,$PosArray[0],$X+$BoxOffset,$PosArray[1],$BoxUpSettings);
164
-         else
165
-          $this->pChartObject->drawFilledRectangle($X-$BoxOffset,$PosArray[0],$X+$BoxOffset,$PosArray[1],$BoxDownSettings);
162
+            if ( $PosArray[0] > $PosArray[1] )
163
+            $this->pChartObject->drawFilledRectangle($X-$BoxOffset,$PosArray[0],$X+$BoxOffset,$PosArray[1],$BoxUpSettings);
164
+            else
165
+            $this->pChartObject->drawFilledRectangle($X-$BoxOffset,$PosArray[0],$X+$BoxOffset,$PosArray[1],$BoxDownSettings);
166 166
 
167
-         if ( isset($PosArray[4]) )
168
-          $this->pChartObject->drawLine($X-$ExtremityLength,$PosArray[4],$X+$ExtremityLength,$PosArray[4],$MedianSettings);
167
+            if ( isset($PosArray[4]) )
168
+            $this->pChartObject->drawLine($X-$ExtremityLength,$PosArray[4],$X+$ExtremityLength,$PosArray[4],$MedianSettings);
169 169
 
170
-         $X = $X + $XStep;
170
+            $X = $X + $XStep;
171 171
         }
172
-       elseif ( $Data["Orientation"] == SCALE_POS_TOPBOTTOM )
172
+        elseif ( $Data["Orientation"] == SCALE_POS_TOPBOTTOM )
173 173
         {
174
-         if ( $YZero > $this->pChartObject->GraphAreaX2-1 ) { $YZero = $this->pChartObject->GraphAreaX2-1; }
175
-         if ( $YZero < $this->pChartObject->GraphAreaX1+1 ) { $YZero = $this->pChartObject->GraphAreaX1+1; }
174
+            if ( $YZero > $this->pChartObject->GraphAreaX2-1 ) { $YZero = $this->pChartObject->GraphAreaX2-1; }
175
+            if ( $YZero < $this->pChartObject->GraphAreaX1+1 ) { $YZero = $this->pChartObject->GraphAreaX1+1; }
176 176
 
177
-         if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1-$XMargin*2)/$XDivs; }
177
+            if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1-$XMargin*2)/$XDivs; }
178 178
 
179
-         if ( $LineWidth == 1 )
180
-          $this->pChartObject->drawLine($PosArray[2],$Y,$PosArray[3],$Y,$LineSettings);
181
-         else
182
-          $this->pChartObject->drawFilledRectangle($PosArray[2],$Y-$LineOffset,$PosArray[3],$Y+$LineOffset,$LineSettings);
179
+            if ( $LineWidth == 1 )
180
+            $this->pChartObject->drawLine($PosArray[2],$Y,$PosArray[3],$Y,$LineSettings);
181
+            else
182
+            $this->pChartObject->drawFilledRectangle($PosArray[2],$Y-$LineOffset,$PosArray[3],$Y+$LineOffset,$LineSettings);
183 183
 
184
-         if ( $ShadowOnBoxesOnly ) { $RestoreShadow = $this->pChartObject->Shadow; $this->pChartObject->Shadow = FALSE; }
184
+            if ( $ShadowOnBoxesOnly ) { $RestoreShadow = $this->pChartObject->Shadow; $this->pChartObject->Shadow = FALSE; }
185 185
 
186
-         if ( $ExtremityWidth == 1 )
187
-          {
188
-           $this->pChartObject->drawLine($PosArray[2],$Y-$ExtremityLength,$PosArray[2],$Y+$ExtremityLength,$ExtremitySettings);
189
-           $this->pChartObject->drawLine($PosArray[3],$Y-$ExtremityLength,$PosArray[3],$Y+$ExtremityLength,$ExtremitySettings);
186
+            if ( $ExtremityWidth == 1 )
187
+            {
188
+            $this->pChartObject->drawLine($PosArray[2],$Y-$ExtremityLength,$PosArray[2],$Y+$ExtremityLength,$ExtremitySettings);
189
+            $this->pChartObject->drawLine($PosArray[3],$Y-$ExtremityLength,$PosArray[3],$Y+$ExtremityLength,$ExtremitySettings);
190 190
 
191
-           if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($PosArray[2]).",".floor($Y-$ExtremityLength).",".floor($PosArray[3]).",".floor($Y+$ExtremityLength),$ImageMapColor,$ImageMapTitle,$Values); }
192
-          }
193
-         else
194
-          {
195
-           $this->pChartObject->drawFilledRectangle($PosArray[2],$Y-$ExtremityLength,$PosArray[2]-$ExtremityWidth,$Y+$ExtremityLength,$ExtremitySettings);
196
-           $this->pChartObject->drawFilledRectangle($PosArray[3],$Y-$ExtremityLength,$PosArray[3]+$ExtremityWidth,$Y+$ExtremityLength,$ExtremitySettings);
191
+            if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($PosArray[2]).",".floor($Y-$ExtremityLength).",".floor($PosArray[3]).",".floor($Y+$ExtremityLength),$ImageMapColor,$ImageMapTitle,$Values); }
192
+            }
193
+            else
194
+            {
195
+            $this->pChartObject->drawFilledRectangle($PosArray[2],$Y-$ExtremityLength,$PosArray[2]-$ExtremityWidth,$Y+$ExtremityLength,$ExtremitySettings);
196
+            $this->pChartObject->drawFilledRectangle($PosArray[3],$Y-$ExtremityLength,$PosArray[3]+$ExtremityWidth,$Y+$ExtremityLength,$ExtremitySettings);
197 197
 
198
-           if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($PosArray[2]-$ExtremityWidth).",".floor($Y-$ExtremityLength).",".floor($PosArray[3]+$ExtremityWidth).",".floor($Y+$ExtremityLength),$ImageMapColor,$ImageMapTitle,$Values); }
199
-          }
198
+            if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($PosArray[2]-$ExtremityWidth).",".floor($Y-$ExtremityLength).",".floor($PosArray[3]+$ExtremityWidth).",".floor($Y+$ExtremityLength),$ImageMapColor,$ImageMapTitle,$Values); }
199
+            }
200 200
 
201
-         if ( $ShadowOnBoxesOnly ) { $this->pChartObject->Shadow = $RestoreShadow; }
201
+            if ( $ShadowOnBoxesOnly ) { $this->pChartObject->Shadow = $RestoreShadow; }
202 202
 
203
-         if ( $PosArray[0] < $PosArray[1] )
204
-          $this->pChartObject->drawFilledRectangle($PosArray[0],$Y-$BoxOffset,$PosArray[1],$Y+$BoxOffset,$BoxUpSettings);
205
-         else
206
-          $this->pChartObject->drawFilledRectangle($PosArray[0],$Y-$BoxOffset,$PosArray[1],$Y+$BoxOffset,$BoxDownSettings);
203
+            if ( $PosArray[0] < $PosArray[1] )
204
+            $this->pChartObject->drawFilledRectangle($PosArray[0],$Y-$BoxOffset,$PosArray[1],$Y+$BoxOffset,$BoxUpSettings);
205
+            else
206
+            $this->pChartObject->drawFilledRectangle($PosArray[0],$Y-$BoxOffset,$PosArray[1],$Y+$BoxOffset,$BoxDownSettings);
207 207
 
208
-         if ( isset($PosArray[4]) )
209
-          $this->pChartObject->drawLine($PosArray[4],$Y-$ExtremityLength,$PosArray[4],$Y+$ExtremityLength,$MedianSettings);
208
+            if ( isset($PosArray[4]) )
209
+            $this->pChartObject->drawLine($PosArray[4],$Y-$ExtremityLength,$PosArray[4],$Y+$ExtremityLength,$MedianSettings);
210 210
 
211
-         $Y = $Y + $XStep;
211
+            $Y = $Y + $XStep;
212
+        }
212 213
         }
213
-      }
214 214
     }
215
-  }
215
+    }
216 216
 ?>
217 217
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      You can find the whole class documentation on the pChart web site.
14 14
  */
15 15
 
16
- define("STOCK_MISSING_SERIE"	, 180001);
16
+ define("STOCK_MISSING_SERIE", 180001);
17 17
 
18 18
  /* pStock class definition */
19 19
  class pStock
@@ -22,82 +22,82 @@  discard block
 block discarded – undo
22 22
    var $pDataObject;
23 23
 
24 24
    /* Class creator */
25
-   function pStock($pChartObject,$pDataObject)
25
+   function pStock($pChartObject, $pDataObject)
26 26
     {
27 27
      $this->pChartObject = $pChartObject;
28 28
      $this->pDataObject  = $pDataObject;
29 29
     }
30 30
 
31 31
    /* Draw a stock chart */
32
-   function drawStockChart($Format="")
32
+   function drawStockChart($Format = "")
33 33
     {
34 34
      $SerieOpen		= isset($Format["SerieOpen"]) ? $Format["SerieOpen"] : "Open";
35 35
      $SerieClose	= isset($Format["SerieClose"]) ? $Format["SerieClose"] : "Close";
36 36
      $SerieMin		= isset($Format["SerieMin"]) ? $Format["SerieMin"] : "Min";
37 37
      $SerieMax		= isset($Format["SerieMax"]) ? $Format["SerieMax"] : "Max";
38
-     $SerieMedian	= isset($Format["SerieMedian"]) ? $Format["SerieMedian"] : NULL;
39
-     $LineWidth		= isset($Format["LineWidth"]) ? $Format["LineWidth"] : 1;
38
+     $SerieMedian = isset($Format["SerieMedian"]) ? $Format["SerieMedian"] : NULL;
39
+     $LineWidth = isset($Format["LineWidth"]) ? $Format["LineWidth"] : 1;
40 40
      $LineR		= isset($Format["LineR"]) ? $Format["LineR"] : 0;
41 41
      $LineG		= isset($Format["LineG"]) ? $Format["LineG"] : 0;
42 42
      $LineB		= isset($Format["LineB"]) ? $Format["LineB"] : 0;
43 43
      $LineAlpha		= isset($Format["LineAlpha"]) ? $Format["LineAlpha"] : 100;
44
-     $ExtremityWidth	= isset($Format["ExtremityWidth"]) ? $Format["ExtremityWidth"] : 1;
45
-     $ExtremityLength	= isset($Format["ExtremityLength"]) ? $Format["ExtremityLength"] : 3;
44
+     $ExtremityWidth = isset($Format["ExtremityWidth"]) ? $Format["ExtremityWidth"] : 1;
45
+     $ExtremityLength = isset($Format["ExtremityLength"]) ? $Format["ExtremityLength"] : 3;
46 46
      $ExtremityR	= isset($Format["ExtremityR"]) ? $Format["ExtremityR"] : 0;
47 47
      $ExtremityG	= isset($Format["ExtremityG"]) ? $Format["ExtremityG"] : 0;
48 48
      $ExtremityB	= isset($Format["ExtremityB"]) ? $Format["ExtremityB"] : 0;
49
-     $ExtremityAlpha	= isset($Format["ExtremityAlpha"]) ? $Format["ExtremityAlpha"] : 100;
50
-     $BoxWidth		= isset($Format["BoxWidth"]) ? $Format["BoxWidth"] : 8;
49
+     $ExtremityAlpha = isset($Format["ExtremityAlpha"]) ? $Format["ExtremityAlpha"] : 100;
50
+     $BoxWidth = isset($Format["BoxWidth"]) ? $Format["BoxWidth"] : 8;
51 51
      $BoxUpR		= isset($Format["BoxUpR"]) ? $Format["BoxUpR"] : 188;
52 52
      $BoxUpG		= isset($Format["BoxUpG"]) ? $Format["BoxUpG"] : 224;
53 53
      $BoxUpB		= isset($Format["BoxUpB"]) ? $Format["BoxUpB"] : 46;
54
-     $BoxUpAlpha	= isset($Format["BoxUpAlpha"]) ? $Format["BoxUpAlpha"] : 100;
55
-     $BoxUpSurrounding	= isset($Format["BoxUpSurrounding"]) ? $Format["BoxUpSurrounding"] : NULL;
56
-     $BoxUpBorderR	= isset($Format["BoxUpBorderR"]) ? $Format["BoxUpBorderR"] : $BoxUpR-20;
57
-     $BoxUpBorderG	= isset($Format["BoxUpBorderG"]) ? $Format["BoxUpBorderG"] : $BoxUpG-20;
58
-     $BoxUpBorderB	= isset($Format["BoxUpBorderB"]) ? $Format["BoxUpBorderB"] : $BoxUpB-20;
59
-     $BoxUpBorderAlpha	= isset($Format["BoxUpBorderAlpha"]) ? $Format["BoxUpBorderAlpha"] : 100;
54
+     $BoxUpAlpha = isset($Format["BoxUpAlpha"]) ? $Format["BoxUpAlpha"] : 100;
55
+     $BoxUpSurrounding = isset($Format["BoxUpSurrounding"]) ? $Format["BoxUpSurrounding"] : NULL;
56
+     $BoxUpBorderR	= isset($Format["BoxUpBorderR"]) ? $Format["BoxUpBorderR"] : $BoxUpR - 20;
57
+     $BoxUpBorderG	= isset($Format["BoxUpBorderG"]) ? $Format["BoxUpBorderG"] : $BoxUpG - 20;
58
+     $BoxUpBorderB	= isset($Format["BoxUpBorderB"]) ? $Format["BoxUpBorderB"] : $BoxUpB - 20;
59
+     $BoxUpBorderAlpha = isset($Format["BoxUpBorderAlpha"]) ? $Format["BoxUpBorderAlpha"] : 100;
60 60
      $BoxDownR		= isset($Format["BoxDownR"]) ? $Format["BoxDownR"] : 224;
61 61
      $BoxDownG		= isset($Format["BoxDownG"]) ? $Format["BoxDownG"] : 100;
62 62
      $BoxDownB		= isset($Format["BoxDownB"]) ? $Format["BoxDownB"] : 46;
63
-     $BoxDownAlpha	= isset($Format["BoxDownAlpha"]) ? $Format["BoxDownAlpha"] : 100;
64
-     $BoxDownSurrounding= isset($Format["BoxDownSurrounding"]) ? $Format["BoxDownSurrounding"] : NULL;
65
-     $BoxDownBorderR	= isset($Format["BoxDownBorderR"]) ? $Format["BoxDownBorderR"] : $BoxDownR-20;
66
-     $BoxDownBorderG	= isset($Format["BoxDownBorderG"]) ? $Format["BoxDownBorderG"] : $BoxDownG-20;
67
-     $BoxDownBorderB	= isset($Format["BoxDownBorderB"]) ? $Format["BoxDownBorderB"] : $BoxDownB-20;
68
-     $BoxDownBorderAlpha= isset($Format["BoxDownBorderAlpha"]) ? $Format["BoxDownBorderAlpha"] : 100;
63
+     $BoxDownAlpha = isset($Format["BoxDownAlpha"]) ? $Format["BoxDownAlpha"] : 100;
64
+     $BoxDownSurrounding = isset($Format["BoxDownSurrounding"]) ? $Format["BoxDownSurrounding"] : NULL;
65
+     $BoxDownBorderR	= isset($Format["BoxDownBorderR"]) ? $Format["BoxDownBorderR"] : $BoxDownR - 20;
66
+     $BoxDownBorderG	= isset($Format["BoxDownBorderG"]) ? $Format["BoxDownBorderG"] : $BoxDownG - 20;
67
+     $BoxDownBorderB	= isset($Format["BoxDownBorderB"]) ? $Format["BoxDownBorderB"] : $BoxDownB - 20;
68
+     $BoxDownBorderAlpha = isset($Format["BoxDownBorderAlpha"]) ? $Format["BoxDownBorderAlpha"] : 100;
69 69
      $ShadowOnBoxesOnly	= isset($Format["ShadowOnBoxesOnly"]) ? $Format["ShadowOnBoxesOnly"] : TRUE;
70 70
      $MedianR		= isset($Format["MedianR"]) ? $Format["MedianR"] : 255;
71 71
      $MedianG		= isset($Format["MedianG"]) ? $Format["MedianG"] : 0;
72 72
      $MedianB		= isset($Format["MedianB"]) ? $Format["MedianB"] : 0;
73
-     $MedianAlpha	= isset($Format["MedianAlpha"]) ? $Format["MedianAlpha"] : 100;
74
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
75
-     $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : "Stock Chart";
73
+     $MedianAlpha = isset($Format["MedianAlpha"]) ? $Format["MedianAlpha"] : 100;
74
+     $RecordImageMap = isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
75
+     $ImageMapTitle = isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : "Stock Chart";
76 76
 
77 77
 
78 78
      /* Data Processing */
79 79
      $Data    = $this->pDataObject->getData();
80 80
      $Palette = $this->pDataObject->getPalette();
81 81
 
82
-     if ( $BoxUpSurrounding != NULL )	{ $BoxUpBorderR = $BoxUpR + $BoxUpSurrounding; $BoxUpBorderG = $BoxUpG + $BoxUpSurrounding; $BoxUpBorderB = $BoxUpB + $BoxUpSurrounding; }
83
-     if ( $BoxDownSurrounding != NULL )	{ $BoxDownBorderR = $BoxDownR + $BoxDownSurrounding; $BoxDownBorderG = $BoxDownG + $BoxDownSurrounding; $BoxDownBorderB = $BoxDownB + $BoxDownSurrounding; }
82
+     if ($BoxUpSurrounding != NULL) { $BoxUpBorderR = $BoxUpR + $BoxUpSurrounding; $BoxUpBorderG = $BoxUpG + $BoxUpSurrounding; $BoxUpBorderB = $BoxUpB + $BoxUpSurrounding; }
83
+     if ($BoxDownSurrounding != NULL) { $BoxDownBorderR = $BoxDownR + $BoxDownSurrounding; $BoxDownBorderG = $BoxDownG + $BoxDownSurrounding; $BoxDownBorderB = $BoxDownB + $BoxDownSurrounding; }
84 84
 
85
-     if ( $LineWidth != 1 ) { $LineOffset = $LineWidth / 2; }
86
-     $BoxOffset = $BoxWidth / 2;
85
+     if ($LineWidth != 1) { $LineOffset = $LineWidth/2; }
86
+     $BoxOffset = $BoxWidth/2;
87 87
 
88 88
      $Data = $this->pChartObject->DataSet->getData();
89
-     list($XMargin,$XDivs) = $this->pChartObject->scaleGetXSettings();
89
+     list($XMargin, $XDivs) = $this->pChartObject->scaleGetXSettings();
90 90
 
91
-     if ( !isset($Data["Series"][$SerieOpen]) || !isset($Data["Series"][$SerieClose]) || !isset($Data["Series"][$SerieMin]) || !isset($Data["Series"][$SerieMax]) )
91
+     if (!isset($Data["Series"][$SerieOpen]) || !isset($Data["Series"][$SerieClose]) || !isset($Data["Series"][$SerieMin]) || !isset($Data["Series"][$SerieMax]))
92 92
       return(STOCK_MISSING_SERIE);
93 93
 
94 94
      $Plots = "";
95
-     foreach($Data["Series"][$SerieOpen]["Data"] as $Key => $Value)
95
+     foreach ($Data["Series"][$SerieOpen]["Data"] as $Key => $Value)
96 96
       {
97 97
        $Point = "";
98
-       if ( isset($Data["Series"][$SerieClose]["Data"][$Key]) || isset($Data["Series"][$SerieMin]["Data"][$Key]) || isset($Data["Series"][$SerieMax]["Data"][$Key]) )
99
-        $Point = array($Value,$Data["Series"][$SerieClose]["Data"][$Key],$Data["Series"][$SerieMin]["Data"][$Key],$Data["Series"][$SerieMax]["Data"][$Key]);
100
-       if ( $SerieMedian != NULL && isset($Data["Series"][$SerieMedian]["Data"][$Key]) )
98
+       if (isset($Data["Series"][$SerieClose]["Data"][$Key]) || isset($Data["Series"][$SerieMin]["Data"][$Key]) || isset($Data["Series"][$SerieMax]["Data"][$Key]))
99
+        $Point = array($Value, $Data["Series"][$SerieClose]["Data"][$Key], $Data["Series"][$SerieMin]["Data"][$Key], $Data["Series"][$SerieMax]["Data"][$Key]);
100
+       if ($SerieMedian != NULL && isset($Data["Series"][$SerieMedian]["Data"][$Key]))
101 101
         $Point[] = $Data["Series"][$SerieMedian]["Data"][$Key];
102 102
 
103 103
        $Plots[] = $Point;
@@ -108,105 +108,105 @@  discard block
 block discarded – undo
108 108
      $Format	= $Data["Axis"][$AxisID]["Format"];
109 109
      $Unit	= $Data["Axis"][$AxisID]["Unit"];
110 110
 
111
-     $YZero	= $this->pChartObject->scaleComputeY(0,array("AxisID"=>$AxisID));
112
-     $XStep	= ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs;
111
+     $YZero	= $this->pChartObject->scaleComputeY(0, array("AxisID"=>$AxisID));
112
+     $XStep	= ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1 - $XMargin*2)/$XDivs;
113 113
 
114 114
      $X = $this->pChartObject->GraphAreaX1 + $XMargin;
115 115
      $Y = $this->pChartObject->GraphAreaY1 + $XMargin;
116 116
 
117
-     $LineSettings	= array("R"=>$LineR,"G"=>$LineG,"B"=>$LineB,"Alpha"=>$LineAlpha);
118
-     $ExtremitySettings	= array("R"=>$ExtremityR,"G"=>$ExtremityG,"B"=>$ExtremityB,"Alpha"=>$ExtremityAlpha);
119
-     $BoxUpSettings	= array("R"=>$BoxUpR,"G"=>$BoxUpG,"B"=>$BoxUpB,"Alpha"=>$BoxUpAlpha,"BorderR"=>$BoxUpBorderR,"BorderG"=>$BoxUpBorderG,"BorderB"=>$BoxUpBorderB,"BorderAlpha"=>$BoxUpBorderAlpha);
120
-     $BoxDownSettings	= array("R"=>$BoxDownR,"G"=>$BoxDownG,"B"=>$BoxDownB,"Alpha"=>$BoxDownAlpha,"BorderR"=>$BoxDownBorderR,"BorderG"=>$BoxDownBorderG,"BorderB"=>$BoxDownBorderB,"BorderAlpha"=>$BoxDownBorderAlpha);
121
-     $MedianSettings	= array("R"=>$MedianR,"G"=>$MedianG,"B"=>$MedianB,"Alpha"=>$MedianAlpha);
117
+     $LineSettings = array("R"=>$LineR, "G"=>$LineG, "B"=>$LineB, "Alpha"=>$LineAlpha);
118
+     $ExtremitySettings = array("R"=>$ExtremityR, "G"=>$ExtremityG, "B"=>$ExtremityB, "Alpha"=>$ExtremityAlpha);
119
+     $BoxUpSettings = array("R"=>$BoxUpR, "G"=>$BoxUpG, "B"=>$BoxUpB, "Alpha"=>$BoxUpAlpha, "BorderR"=>$BoxUpBorderR, "BorderG"=>$BoxUpBorderG, "BorderB"=>$BoxUpBorderB, "BorderAlpha"=>$BoxUpBorderAlpha);
120
+     $BoxDownSettings = array("R"=>$BoxDownR, "G"=>$BoxDownG, "B"=>$BoxDownB, "Alpha"=>$BoxDownAlpha, "BorderR"=>$BoxDownBorderR, "BorderG"=>$BoxDownBorderG, "BorderB"=>$BoxDownBorderB, "BorderAlpha"=>$BoxDownBorderAlpha);
121
+     $MedianSettings = array("R"=>$MedianR, "G"=>$MedianG, "B"=>$MedianB, "Alpha"=>$MedianAlpha);
122 122
 
123
-     foreach($Plots as $Key =>$Points)
123
+     foreach ($Plots as $Key =>$Points)
124 124
       {
125
-       $PosArray = $this->pChartObject->scaleComputeY($Points,array("AxisID"=>$AxisID));
125
+       $PosArray = $this->pChartObject->scaleComputeY($Points, array("AxisID"=>$AxisID));
126 126
 
127 127
        $Values = "Open :".$Data["Series"][$SerieOpen]["Data"][$Key]."<BR>Close : ".$Data["Series"][$SerieClose]["Data"][$Key]."<BR>Min : ".$Data["Series"][$SerieMin]["Data"][$Key]."<BR>Max : ".$Data["Series"][$SerieMax]["Data"][$Key]."<BR>";
128
-       if ( $SerieMedian != NULL ) { $Values = $Values."Median : ".$Data["Series"][$SerieMedian]["Data"][$Key]."<BR>"; }
129
-       if ( $PosArray[0] > $PosArray[1] ) { $ImageMapColor = $this->pChartObject->toHTMLColor($BoxUpR,$BoxUpG,$BoxUpB); } else { $ImageMapColor = $this->pChartObject->toHTMLColor($BoxDownR,$BoxDownG,$BoxDownB); } 
128
+       if ($SerieMedian != NULL) { $Values = $Values."Median : ".$Data["Series"][$SerieMedian]["Data"][$Key]."<BR>"; }
129
+       if ($PosArray[0] > $PosArray[1]) { $ImageMapColor = $this->pChartObject->toHTMLColor($BoxUpR, $BoxUpG, $BoxUpB); } else { $ImageMapColor = $this->pChartObject->toHTMLColor($BoxDownR, $BoxDownG, $BoxDownB); } 
130 130
 
131
-       if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT )
131
+       if ($Data["Orientation"] == SCALE_POS_LEFTRIGHT)
132 132
         {
133
-         if ( $YZero > $this->pChartObject->GraphAreaY2-1 ) { $YZero = $this->pChartObject->GraphAreaY2-1; }
134
-         if ( $YZero < $this->pChartObject->GraphAreaY1+1 ) { $YZero = $this->pChartObject->GraphAreaY1+1; }
133
+         if ($YZero > $this->pChartObject->GraphAreaY2 - 1) { $YZero = $this->pChartObject->GraphAreaY2 - 1; }
134
+         if ($YZero < $this->pChartObject->GraphAreaY1 + 1) { $YZero = $this->pChartObject->GraphAreaY1 + 1; }
135 135
 
136
-         if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs; }
136
+         if ($XDivs == 0) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1 - $XMargin*2)/$XDivs; }
137 137
 
138
-         if ( $ShadowOnBoxesOnly ) { $RestoreShadow = $this->pChartObject->Shadow; $this->pChartObject->Shadow = FALSE; }
138
+         if ($ShadowOnBoxesOnly) { $RestoreShadow = $this->pChartObject->Shadow; $this->pChartObject->Shadow = FALSE; }
139 139
 
140
-         if ( $LineWidth == 1 )
141
-          $this->pChartObject->drawLine($X,$PosArray[2],$X,$PosArray[3],$LineSettings);
140
+         if ($LineWidth == 1)
141
+          $this->pChartObject->drawLine($X, $PosArray[2], $X, $PosArray[3], $LineSettings);
142 142
          else
143
-          $this->pChartObject->drawFilledRectangle($X-$LineOffset,$PosArray[2],$X+$LineOffset,$PosArray[3],$LineSettings);
143
+          $this->pChartObject->drawFilledRectangle($X - $LineOffset, $PosArray[2], $X + $LineOffset, $PosArray[3], $LineSettings);
144 144
 
145
-         if ( $ExtremityWidth == 1 )
145
+         if ($ExtremityWidth == 1)
146 146
           {
147
-           $this->pChartObject->drawLine($X-$ExtremityLength,$PosArray[2],$X+$ExtremityLength,$PosArray[2],$ExtremitySettings);
148
-           $this->pChartObject->drawLine($X-$ExtremityLength,$PosArray[3],$X+$ExtremityLength,$PosArray[3],$ExtremitySettings);
147
+           $this->pChartObject->drawLine($X - $ExtremityLength, $PosArray[2], $X + $ExtremityLength, $PosArray[2], $ExtremitySettings);
148
+           $this->pChartObject->drawLine($X - $ExtremityLength, $PosArray[3], $X + $ExtremityLength, $PosArray[3], $ExtremitySettings);
149 149
 
150
-           if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($X-$ExtremityLength).",".floor($PosArray[2]).",".floor($X+$ExtremityLength).",".floor($PosArray[3]),$ImageMapColor,$ImageMapTitle,$Values); }
150
+           if ($RecordImageMap) { $this->pChartObject->addToImageMap("RECT", floor($X - $ExtremityLength).",".floor($PosArray[2]).",".floor($X + $ExtremityLength).",".floor($PosArray[3]), $ImageMapColor, $ImageMapTitle, $Values); }
151 151
           }
152 152
          else
153 153
           {
154
-           $this->pChartObject->drawFilledRectangle($X-$ExtremityLength,$PosArray[2],$X+$ExtremityLength,$PosArray[2]-$ExtremityWidth,$ExtremitySettings);
155
-           $this->pChartObject->drawFilledRectangle($X-$ExtremityLength,$PosArray[3],$X+$ExtremityLength,$PosArray[3]+$ExtremityWidth,$ExtremitySettings);
154
+           $this->pChartObject->drawFilledRectangle($X - $ExtremityLength, $PosArray[2], $X + $ExtremityLength, $PosArray[2] - $ExtremityWidth, $ExtremitySettings);
155
+           $this->pChartObject->drawFilledRectangle($X - $ExtremityLength, $PosArray[3], $X + $ExtremityLength, $PosArray[3] + $ExtremityWidth, $ExtremitySettings);
156 156
 
157
-           if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($X-$ExtremityLength).",".floor($PosArray[2]-$ExtremityWidth).",".floor($X+$ExtremityLength).",".floor($PosArray[3]+$ExtremityWidth),$ImageMapColor,$ImageMapTitle,$Values); }
157
+           if ($RecordImageMap) { $this->pChartObject->addToImageMap("RECT", floor($X - $ExtremityLength).",".floor($PosArray[2] - $ExtremityWidth).",".floor($X + $ExtremityLength).",".floor($PosArray[3] + $ExtremityWidth), $ImageMapColor, $ImageMapTitle, $Values); }
158 158
           }
159 159
 
160
-         if ( $ShadowOnBoxesOnly ) { $this->pChartObject->Shadow = $RestoreShadow; }
160
+         if ($ShadowOnBoxesOnly) { $this->pChartObject->Shadow = $RestoreShadow; }
161 161
 
162
-         if ( $PosArray[0] > $PosArray[1] )
163
-          $this->pChartObject->drawFilledRectangle($X-$BoxOffset,$PosArray[0],$X+$BoxOffset,$PosArray[1],$BoxUpSettings);
162
+         if ($PosArray[0] > $PosArray[1])
163
+          $this->pChartObject->drawFilledRectangle($X - $BoxOffset, $PosArray[0], $X + $BoxOffset, $PosArray[1], $BoxUpSettings);
164 164
          else
165
-          $this->pChartObject->drawFilledRectangle($X-$BoxOffset,$PosArray[0],$X+$BoxOffset,$PosArray[1],$BoxDownSettings);
165
+          $this->pChartObject->drawFilledRectangle($X - $BoxOffset, $PosArray[0], $X + $BoxOffset, $PosArray[1], $BoxDownSettings);
166 166
 
167
-         if ( isset($PosArray[4]) )
168
-          $this->pChartObject->drawLine($X-$ExtremityLength,$PosArray[4],$X+$ExtremityLength,$PosArray[4],$MedianSettings);
167
+         if (isset($PosArray[4]))
168
+          $this->pChartObject->drawLine($X - $ExtremityLength, $PosArray[4], $X + $ExtremityLength, $PosArray[4], $MedianSettings);
169 169
 
170 170
          $X = $X + $XStep;
171 171
         }
172
-       elseif ( $Data["Orientation"] == SCALE_POS_TOPBOTTOM )
172
+       elseif ($Data["Orientation"] == SCALE_POS_TOPBOTTOM)
173 173
         {
174
-         if ( $YZero > $this->pChartObject->GraphAreaX2-1 ) { $YZero = $this->pChartObject->GraphAreaX2-1; }
175
-         if ( $YZero < $this->pChartObject->GraphAreaX1+1 ) { $YZero = $this->pChartObject->GraphAreaX1+1; }
174
+         if ($YZero > $this->pChartObject->GraphAreaX2 - 1) { $YZero = $this->pChartObject->GraphAreaX2 - 1; }
175
+         if ($YZero < $this->pChartObject->GraphAreaX1 + 1) { $YZero = $this->pChartObject->GraphAreaX1 + 1; }
176 176
 
177
-         if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaY2-$this->pChartObject->GraphAreaY1-$XMargin*2)/$XDivs; }
177
+         if ($XDivs == 0) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1 - $XMargin*2)/$XDivs; }
178 178
 
179
-         if ( $LineWidth == 1 )
180
-          $this->pChartObject->drawLine($PosArray[2],$Y,$PosArray[3],$Y,$LineSettings);
179
+         if ($LineWidth == 1)
180
+          $this->pChartObject->drawLine($PosArray[2], $Y, $PosArray[3], $Y, $LineSettings);
181 181
          else
182
-          $this->pChartObject->drawFilledRectangle($PosArray[2],$Y-$LineOffset,$PosArray[3],$Y+$LineOffset,$LineSettings);
182
+          $this->pChartObject->drawFilledRectangle($PosArray[2], $Y - $LineOffset, $PosArray[3], $Y + $LineOffset, $LineSettings);
183 183
 
184
-         if ( $ShadowOnBoxesOnly ) { $RestoreShadow = $this->pChartObject->Shadow; $this->pChartObject->Shadow = FALSE; }
184
+         if ($ShadowOnBoxesOnly) { $RestoreShadow = $this->pChartObject->Shadow; $this->pChartObject->Shadow = FALSE; }
185 185
 
186
-         if ( $ExtremityWidth == 1 )
186
+         if ($ExtremityWidth == 1)
187 187
           {
188
-           $this->pChartObject->drawLine($PosArray[2],$Y-$ExtremityLength,$PosArray[2],$Y+$ExtremityLength,$ExtremitySettings);
189
-           $this->pChartObject->drawLine($PosArray[3],$Y-$ExtremityLength,$PosArray[3],$Y+$ExtremityLength,$ExtremitySettings);
188
+           $this->pChartObject->drawLine($PosArray[2], $Y - $ExtremityLength, $PosArray[2], $Y + $ExtremityLength, $ExtremitySettings);
189
+           $this->pChartObject->drawLine($PosArray[3], $Y - $ExtremityLength, $PosArray[3], $Y + $ExtremityLength, $ExtremitySettings);
190 190
 
191
-           if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($PosArray[2]).",".floor($Y-$ExtremityLength).",".floor($PosArray[3]).",".floor($Y+$ExtremityLength),$ImageMapColor,$ImageMapTitle,$Values); }
191
+           if ($RecordImageMap) { $this->pChartObject->addToImageMap("RECT", floor($PosArray[2]).",".floor($Y - $ExtremityLength).",".floor($PosArray[3]).",".floor($Y + $ExtremityLength), $ImageMapColor, $ImageMapTitle, $Values); }
192 192
           }
193 193
          else
194 194
           {
195
-           $this->pChartObject->drawFilledRectangle($PosArray[2],$Y-$ExtremityLength,$PosArray[2]-$ExtremityWidth,$Y+$ExtremityLength,$ExtremitySettings);
196
-           $this->pChartObject->drawFilledRectangle($PosArray[3],$Y-$ExtremityLength,$PosArray[3]+$ExtremityWidth,$Y+$ExtremityLength,$ExtremitySettings);
195
+           $this->pChartObject->drawFilledRectangle($PosArray[2], $Y - $ExtremityLength, $PosArray[2] - $ExtremityWidth, $Y + $ExtremityLength, $ExtremitySettings);
196
+           $this->pChartObject->drawFilledRectangle($PosArray[3], $Y - $ExtremityLength, $PosArray[3] + $ExtremityWidth, $Y + $ExtremityLength, $ExtremitySettings);
197 197
 
198
-           if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($PosArray[2]-$ExtremityWidth).",".floor($Y-$ExtremityLength).",".floor($PosArray[3]+$ExtremityWidth).",".floor($Y+$ExtremityLength),$ImageMapColor,$ImageMapTitle,$Values); }
198
+           if ($RecordImageMap) { $this->pChartObject->addToImageMap("RECT", floor($PosArray[2] - $ExtremityWidth).",".floor($Y - $ExtremityLength).",".floor($PosArray[3] + $ExtremityWidth).",".floor($Y + $ExtremityLength), $ImageMapColor, $ImageMapTitle, $Values); }
199 199
           }
200 200
 
201
-         if ( $ShadowOnBoxesOnly ) { $this->pChartObject->Shadow = $RestoreShadow; }
201
+         if ($ShadowOnBoxesOnly) { $this->pChartObject->Shadow = $RestoreShadow; }
202 202
 
203
-         if ( $PosArray[0] < $PosArray[1] )
204
-          $this->pChartObject->drawFilledRectangle($PosArray[0],$Y-$BoxOffset,$PosArray[1],$Y+$BoxOffset,$BoxUpSettings);
203
+         if ($PosArray[0] < $PosArray[1])
204
+          $this->pChartObject->drawFilledRectangle($PosArray[0], $Y - $BoxOffset, $PosArray[1], $Y + $BoxOffset, $BoxUpSettings);
205 205
          else
206
-          $this->pChartObject->drawFilledRectangle($PosArray[0],$Y-$BoxOffset,$PosArray[1],$Y+$BoxOffset,$BoxDownSettings);
206
+          $this->pChartObject->drawFilledRectangle($PosArray[0], $Y - $BoxOffset, $PosArray[1], $Y + $BoxOffset, $BoxDownSettings);
207 207
 
208
-         if ( isset($PosArray[4]) )
209
-          $this->pChartObject->drawLine($PosArray[4],$Y-$ExtremityLength,$PosArray[4],$Y+$ExtremityLength,$MedianSettings);
208
+         if (isset($PosArray[4]))
209
+          $this->pChartObject->drawLine($PosArray[4], $Y - $ExtremityLength, $PosArray[4], $Y + $ExtremityLength, $MedianSettings);
210 210
 
211 211
          $Y = $Y + $XStep;
212 212
         }
Please login to merge, or discard this patch.
Braces   +11 added lines, -25 removed lines patch added patch discarded remove patch
@@ -16,21 +16,18 @@  discard block
 block discarded – undo
16 16
  define("STOCK_MISSING_SERIE"	, 180001);
17 17
 
18 18
  /* pStock class definition */
19
- class pStock
20
-  {
19
+ class pStock {
21 20
    var $pChartObject;
22 21
    var $pDataObject;
23 22
 
24 23
    /* Class creator */
25
-   function pStock($pChartObject,$pDataObject)
26
-    {
24
+   function pStock($pChartObject,$pDataObject) {
27 25
      $this->pChartObject = $pChartObject;
28 26
      $this->pDataObject  = $pDataObject;
29 27
     }
30 28
 
31 29
    /* Draw a stock chart */
32
-   function drawStockChart($Format="")
33
-    {
30
+   function drawStockChart($Format="") {
34 31
      $SerieOpen		= isset($Format["SerieOpen"]) ? $Format["SerieOpen"] : "Open";
35 32
      $SerieClose	= isset($Format["SerieClose"]) ? $Format["SerieClose"] : "Close";
36 33
      $SerieMin		= isset($Format["SerieMin"]) ? $Format["SerieMin"] : "Min";
@@ -92,8 +89,7 @@  discard block
 block discarded – undo
92 89
       return(STOCK_MISSING_SERIE);
93 90
 
94 91
      $Plots = "";
95
-     foreach($Data["Series"][$SerieOpen]["Data"] as $Key => $Value)
96
-      {
92
+     foreach($Data["Series"][$SerieOpen]["Data"] as $Key => $Value) {
97 93
        $Point = "";
98 94
        if ( isset($Data["Series"][$SerieClose]["Data"][$Key]) || isset($Data["Series"][$SerieMin]["Data"][$Key]) || isset($Data["Series"][$SerieMax]["Data"][$Key]) )
99 95
         $Point = array($Value,$Data["Series"][$SerieClose]["Data"][$Key],$Data["Series"][$SerieMin]["Data"][$Key],$Data["Series"][$SerieMax]["Data"][$Key]);
@@ -120,16 +116,14 @@  discard block
 block discarded – undo
120 116
      $BoxDownSettings	= array("R"=>$BoxDownR,"G"=>$BoxDownG,"B"=>$BoxDownB,"Alpha"=>$BoxDownAlpha,"BorderR"=>$BoxDownBorderR,"BorderG"=>$BoxDownBorderG,"BorderB"=>$BoxDownBorderB,"BorderAlpha"=>$BoxDownBorderAlpha);
121 117
      $MedianSettings	= array("R"=>$MedianR,"G"=>$MedianG,"B"=>$MedianB,"Alpha"=>$MedianAlpha);
122 118
 
123
-     foreach($Plots as $Key =>$Points)
124
-      {
119
+     foreach($Plots as $Key =>$Points) {
125 120
        $PosArray = $this->pChartObject->scaleComputeY($Points,array("AxisID"=>$AxisID));
126 121
 
127 122
        $Values = "Open :".$Data["Series"][$SerieOpen]["Data"][$Key]."<BR>Close : ".$Data["Series"][$SerieClose]["Data"][$Key]."<BR>Min : ".$Data["Series"][$SerieMin]["Data"][$Key]."<BR>Max : ".$Data["Series"][$SerieMax]["Data"][$Key]."<BR>";
128 123
        if ( $SerieMedian != NULL ) { $Values = $Values."Median : ".$Data["Series"][$SerieMedian]["Data"][$Key]."<BR>"; }
129 124
        if ( $PosArray[0] > $PosArray[1] ) { $ImageMapColor = $this->pChartObject->toHTMLColor($BoxUpR,$BoxUpG,$BoxUpB); } else { $ImageMapColor = $this->pChartObject->toHTMLColor($BoxDownR,$BoxDownG,$BoxDownB); } 
130 125
 
131
-       if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT )
132
-        {
126
+       if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT ) {
133 127
          if ( $YZero > $this->pChartObject->GraphAreaY2-1 ) { $YZero = $this->pChartObject->GraphAreaY2-1; }
134 128
          if ( $YZero < $this->pChartObject->GraphAreaY1+1 ) { $YZero = $this->pChartObject->GraphAreaY1+1; }
135 129
 
@@ -142,15 +136,12 @@  discard block
 block discarded – undo
142 136
          else
143 137
           $this->pChartObject->drawFilledRectangle($X-$LineOffset,$PosArray[2],$X+$LineOffset,$PosArray[3],$LineSettings);
144 138
 
145
-         if ( $ExtremityWidth == 1 )
146
-          {
139
+         if ( $ExtremityWidth == 1 ) {
147 140
            $this->pChartObject->drawLine($X-$ExtremityLength,$PosArray[2],$X+$ExtremityLength,$PosArray[2],$ExtremitySettings);
148 141
            $this->pChartObject->drawLine($X-$ExtremityLength,$PosArray[3],$X+$ExtremityLength,$PosArray[3],$ExtremitySettings);
149 142
 
150 143
            if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($X-$ExtremityLength).",".floor($PosArray[2]).",".floor($X+$ExtremityLength).",".floor($PosArray[3]),$ImageMapColor,$ImageMapTitle,$Values); }
151
-          }
152
-         else
153
-          {
144
+          } else {
154 145
            $this->pChartObject->drawFilledRectangle($X-$ExtremityLength,$PosArray[2],$X+$ExtremityLength,$PosArray[2]-$ExtremityWidth,$ExtremitySettings);
155 146
            $this->pChartObject->drawFilledRectangle($X-$ExtremityLength,$PosArray[3],$X+$ExtremityLength,$PosArray[3]+$ExtremityWidth,$ExtremitySettings);
156 147
 
@@ -168,9 +159,7 @@  discard block
 block discarded – undo
168 159
           $this->pChartObject->drawLine($X-$ExtremityLength,$PosArray[4],$X+$ExtremityLength,$PosArray[4],$MedianSettings);
169 160
 
170 161
          $X = $X + $XStep;
171
-        }
172
-       elseif ( $Data["Orientation"] == SCALE_POS_TOPBOTTOM )
173
-        {
162
+        } elseif ( $Data["Orientation"] == SCALE_POS_TOPBOTTOM ) {
174 163
          if ( $YZero > $this->pChartObject->GraphAreaX2-1 ) { $YZero = $this->pChartObject->GraphAreaX2-1; }
175 164
          if ( $YZero < $this->pChartObject->GraphAreaX1+1 ) { $YZero = $this->pChartObject->GraphAreaX1+1; }
176 165
 
@@ -183,15 +172,12 @@  discard block
 block discarded – undo
183 172
 
184 173
          if ( $ShadowOnBoxesOnly ) { $RestoreShadow = $this->pChartObject->Shadow; $this->pChartObject->Shadow = FALSE; }
185 174
 
186
-         if ( $ExtremityWidth == 1 )
187
-          {
175
+         if ( $ExtremityWidth == 1 ) {
188 176
            $this->pChartObject->drawLine($PosArray[2],$Y-$ExtremityLength,$PosArray[2],$Y+$ExtremityLength,$ExtremitySettings);
189 177
            $this->pChartObject->drawLine($PosArray[3],$Y-$ExtremityLength,$PosArray[3],$Y+$ExtremityLength,$ExtremitySettings);
190 178
 
191 179
            if ( $RecordImageMap ) { $this->pChartObject->addToImageMap("RECT",floor($PosArray[2]).",".floor($Y-$ExtremityLength).",".floor($PosArray[3]).",".floor($Y+$ExtremityLength),$ImageMapColor,$ImageMapTitle,$Values); }
192
-          }
193
-         else
194
-          {
180
+          } else {
195 181
            $this->pChartObject->drawFilledRectangle($PosArray[2],$Y-$ExtremityLength,$PosArray[2]-$ExtremityWidth,$Y+$ExtremityLength,$ExtremitySettings);
196 182
            $this->pChartObject->drawFilledRectangle($PosArray[3],$Y-$ExtremityLength,$PosArray[3]+$ExtremityWidth,$Y+$ExtremityLength,$ExtremitySettings);
197 183
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      $SerieClose	= isset($Format["SerieClose"]) ? $Format["SerieClose"] : "Close";
36 36
      $SerieMin		= isset($Format["SerieMin"]) ? $Format["SerieMin"] : "Min";
37 37
      $SerieMax		= isset($Format["SerieMax"]) ? $Format["SerieMax"] : "Max";
38
-     $SerieMedian	= isset($Format["SerieMedian"]) ? $Format["SerieMedian"] : NULL;
38
+     $SerieMedian	= isset($Format["SerieMedian"]) ? $Format["SerieMedian"] : null;
39 39
      $LineWidth		= isset($Format["LineWidth"]) ? $Format["LineWidth"] : 1;
40 40
      $LineR		= isset($Format["LineR"]) ? $Format["LineR"] : 0;
41 41
      $LineG		= isset($Format["LineG"]) ? $Format["LineG"] : 0;
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      $BoxUpG		= isset($Format["BoxUpG"]) ? $Format["BoxUpG"] : 224;
53 53
      $BoxUpB		= isset($Format["BoxUpB"]) ? $Format["BoxUpB"] : 46;
54 54
      $BoxUpAlpha	= isset($Format["BoxUpAlpha"]) ? $Format["BoxUpAlpha"] : 100;
55
-     $BoxUpSurrounding	= isset($Format["BoxUpSurrounding"]) ? $Format["BoxUpSurrounding"] : NULL;
55
+     $BoxUpSurrounding	= isset($Format["BoxUpSurrounding"]) ? $Format["BoxUpSurrounding"] : null;
56 56
      $BoxUpBorderR	= isset($Format["BoxUpBorderR"]) ? $Format["BoxUpBorderR"] : $BoxUpR-20;
57 57
      $BoxUpBorderG	= isset($Format["BoxUpBorderG"]) ? $Format["BoxUpBorderG"] : $BoxUpG-20;
58 58
      $BoxUpBorderB	= isset($Format["BoxUpBorderB"]) ? $Format["BoxUpBorderB"] : $BoxUpB-20;
@@ -61,17 +61,17 @@  discard block
 block discarded – undo
61 61
      $BoxDownG		= isset($Format["BoxDownG"]) ? $Format["BoxDownG"] : 100;
62 62
      $BoxDownB		= isset($Format["BoxDownB"]) ? $Format["BoxDownB"] : 46;
63 63
      $BoxDownAlpha	= isset($Format["BoxDownAlpha"]) ? $Format["BoxDownAlpha"] : 100;
64
-     $BoxDownSurrounding= isset($Format["BoxDownSurrounding"]) ? $Format["BoxDownSurrounding"] : NULL;
64
+     $BoxDownSurrounding= isset($Format["BoxDownSurrounding"]) ? $Format["BoxDownSurrounding"] : null;
65 65
      $BoxDownBorderR	= isset($Format["BoxDownBorderR"]) ? $Format["BoxDownBorderR"] : $BoxDownR-20;
66 66
      $BoxDownBorderG	= isset($Format["BoxDownBorderG"]) ? $Format["BoxDownBorderG"] : $BoxDownG-20;
67 67
      $BoxDownBorderB	= isset($Format["BoxDownBorderB"]) ? $Format["BoxDownBorderB"] : $BoxDownB-20;
68 68
      $BoxDownBorderAlpha= isset($Format["BoxDownBorderAlpha"]) ? $Format["BoxDownBorderAlpha"] : 100;
69
-     $ShadowOnBoxesOnly	= isset($Format["ShadowOnBoxesOnly"]) ? $Format["ShadowOnBoxesOnly"] : TRUE;
69
+     $ShadowOnBoxesOnly	= isset($Format["ShadowOnBoxesOnly"]) ? $Format["ShadowOnBoxesOnly"] : true;
70 70
      $MedianR		= isset($Format["MedianR"]) ? $Format["MedianR"] : 255;
71 71
      $MedianG		= isset($Format["MedianG"]) ? $Format["MedianG"] : 0;
72 72
      $MedianB		= isset($Format["MedianB"]) ? $Format["MedianB"] : 0;
73 73
      $MedianAlpha	= isset($Format["MedianAlpha"]) ? $Format["MedianAlpha"] : 100;
74
-     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
74
+     $RecordImageMap	= isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : false;
75 75
      $ImageMapTitle	= isset($Format["ImageMapTitle"]) ? $Format["ImageMapTitle"] : "Stock Chart";
76 76
 
77 77
 
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
      $Data    = $this->pDataObject->getData();
80 80
      $Palette = $this->pDataObject->getPalette();
81 81
 
82
-     if ( $BoxUpSurrounding != NULL )	{ $BoxUpBorderR = $BoxUpR + $BoxUpSurrounding; $BoxUpBorderG = $BoxUpG + $BoxUpSurrounding; $BoxUpBorderB = $BoxUpB + $BoxUpSurrounding; }
83
-     if ( $BoxDownSurrounding != NULL )	{ $BoxDownBorderR = $BoxDownR + $BoxDownSurrounding; $BoxDownBorderG = $BoxDownG + $BoxDownSurrounding; $BoxDownBorderB = $BoxDownB + $BoxDownSurrounding; }
82
+     if ( $BoxUpSurrounding != null )	{ $BoxUpBorderR = $BoxUpR + $BoxUpSurrounding; $BoxUpBorderG = $BoxUpG + $BoxUpSurrounding; $BoxUpBorderB = $BoxUpB + $BoxUpSurrounding; }
83
+     if ( $BoxDownSurrounding != null )	{ $BoxDownBorderR = $BoxDownR + $BoxDownSurrounding; $BoxDownBorderG = $BoxDownG + $BoxDownSurrounding; $BoxDownBorderB = $BoxDownB + $BoxDownSurrounding; }
84 84
 
85 85
      if ( $LineWidth != 1 ) { $LineOffset = $LineWidth / 2; }
86 86
      $BoxOffset = $BoxWidth / 2;
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
        $Point = "";
98 98
        if ( isset($Data["Series"][$SerieClose]["Data"][$Key]) || isset($Data["Series"][$SerieMin]["Data"][$Key]) || isset($Data["Series"][$SerieMax]["Data"][$Key]) )
99 99
         $Point = array($Value,$Data["Series"][$SerieClose]["Data"][$Key],$Data["Series"][$SerieMin]["Data"][$Key],$Data["Series"][$SerieMax]["Data"][$Key]);
100
-       if ( $SerieMedian != NULL && isset($Data["Series"][$SerieMedian]["Data"][$Key]) )
100
+       if ( $SerieMedian != null && isset($Data["Series"][$SerieMedian]["Data"][$Key]) )
101 101
         $Point[] = $Data["Series"][$SerieMedian]["Data"][$Key];
102 102
 
103 103
        $Plots[] = $Point;
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
        $PosArray = $this->pChartObject->scaleComputeY($Points,array("AxisID"=>$AxisID));
126 126
 
127 127
        $Values = "Open :".$Data["Series"][$SerieOpen]["Data"][$Key]."<BR>Close : ".$Data["Series"][$SerieClose]["Data"][$Key]."<BR>Min : ".$Data["Series"][$SerieMin]["Data"][$Key]."<BR>Max : ".$Data["Series"][$SerieMax]["Data"][$Key]."<BR>";
128
-       if ( $SerieMedian != NULL ) { $Values = $Values."Median : ".$Data["Series"][$SerieMedian]["Data"][$Key]."<BR>"; }
128
+       if ( $SerieMedian != null ) { $Values = $Values."Median : ".$Data["Series"][$SerieMedian]["Data"][$Key]."<BR>"; }
129 129
        if ( $PosArray[0] > $PosArray[1] ) { $ImageMapColor = $this->pChartObject->toHTMLColor($BoxUpR,$BoxUpG,$BoxUpB); } else { $ImageMapColor = $this->pChartObject->toHTMLColor($BoxDownR,$BoxDownG,$BoxDownB); } 
130 130
 
131 131
        if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT )
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
          if ( $XDivs == 0 ) { $XStep = 0; } else { $XStep = ($this->pChartObject->GraphAreaX2-$this->pChartObject->GraphAreaX1-$XMargin*2)/$XDivs; }
137 137
 
138
-         if ( $ShadowOnBoxesOnly ) { $RestoreShadow = $this->pChartObject->Shadow; $this->pChartObject->Shadow = FALSE; }
138
+         if ( $ShadowOnBoxesOnly ) { $RestoreShadow = $this->pChartObject->Shadow; $this->pChartObject->Shadow = false; }
139 139
 
140 140
          if ( $LineWidth == 1 )
141 141
           $this->pChartObject->drawLine($X,$PosArray[2],$X,$PosArray[3],$LineSettings);
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
          else
182 182
           $this->pChartObject->drawFilledRectangle($PosArray[2],$Y-$LineOffset,$PosArray[3],$Y+$LineOffset,$LineSettings);
183 183
 
184
-         if ( $ShadowOnBoxesOnly ) { $RestoreShadow = $this->pChartObject->Shadow; $this->pChartObject->Shadow = FALSE; }
184
+         if ( $ShadowOnBoxesOnly ) { $RestoreShadow = $this->pChartObject->Shadow; $this->pChartObject->Shadow = false; }
185 185
 
186 186
          if ( $ExtremityWidth == 1 )
187 187
           {
Please login to merge, or discard this patch.
default/boinc/modules/boincstats/includes/pchart/class/pSurface.class.php 4 patches
Indentation   +234 added lines, -234 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
- /*
2
+    /*
3 3
      pSurface - class to draw surface charts
4 4
 
5 5
      Version     : 2.1.3
@@ -13,303 +13,303 @@  discard block
 block discarded – undo
13 13
      You can find the whole class documentation on the pChart web site.
14 14
  */
15 15
 
16
- define("UNKNOWN"		, 0.123456789);
17
- define("IGNORED"		, -1);
16
+    define("UNKNOWN"		, 0.123456789);
17
+    define("IGNORED"		, -1);
18 18
 
19
- define("LABEL_POSITION_LEFT"	, 880001);
20
- define("LABEL_POSITION_RIGHT"	, 880002);
21
- define("LABEL_POSITION_TOP"	, 880003);
22
- define("LABEL_POSITION_BOTTOM"	, 880004);
19
+    define("LABEL_POSITION_LEFT"	, 880001);
20
+    define("LABEL_POSITION_RIGHT"	, 880002);
21
+    define("LABEL_POSITION_TOP"	, 880003);
22
+    define("LABEL_POSITION_BOTTOM"	, 880004);
23 23
 
24
- /* pStock class definition */
25
- class pSurface
26
-  {
27
-   var $pChartObject;
28
-   var $GridSizeX;
29
-   var $GridSizeY;
30
-   var $Points;
24
+    /* pStock class definition */
25
+    class pSurface
26
+    {
27
+    var $pChartObject;
28
+    var $GridSizeX;
29
+    var $GridSizeY;
30
+    var $Points;
31 31
 
32
-   /* Class creator */
33
-   function pSurface($pChartObject)
32
+    /* Class creator */
33
+    function pSurface($pChartObject)
34 34
     {
35
-     $this->pChartObject = $pChartObject;
36
-     $this->GridSize     = 10;
37
-     $this->Points       = "";
35
+        $this->pChartObject = $pChartObject;
36
+        $this->GridSize     = 10;
37
+        $this->Points       = "";
38 38
     }
39 39
 
40
-   /* Define the grid size and initialise the 2D matrix */
41
-   function setGrid($XSize=10,$YSize=10)
40
+    /* Define the grid size and initialise the 2D matrix */
41
+    function setGrid($XSize=10,$YSize=10)
42 42
     {
43
-     for($X=0; $X<=$XSize; $X++) { for($Y=0; $Y<=$YSize; $Y++) { $this->Points[$X][$Y]=UNKNOWN; } } 
43
+        for($X=0; $X<=$XSize; $X++) { for($Y=0; $Y<=$YSize; $Y++) { $this->Points[$X][$Y]=UNKNOWN; } } 
44 44
 
45
-     $this->GridSizeX = $XSize;
46
-     $this->GridSizeY = $YSize;
45
+        $this->GridSizeX = $XSize;
46
+        $this->GridSizeY = $YSize;
47 47
     }
48 48
 
49
-   /* Add a point on the grid */
50
-   function addPoint($X,$Y,$Value,$Force=TRUE)
49
+    /* Add a point on the grid */
50
+    function addPoint($X,$Y,$Value,$Force=TRUE)
51 51
     {
52
-     if ( $X < 0 || $X >$this->GridSizeX ) { return(0); }
53
-     if ( $Y < 0 || $Y >$this->GridSizeY ) { return(0); }
54
-
55
-     if ( $this->Points[$X][$Y] == UNKNOWN || $Force )
56
-      $this->Points[$X][$Y] = $Value;
57
-     elseif ( $this->Points[$X][$Y] == UNKNOWN )
58
-      $this->Points[$X][$Y] = $Value;
59
-     else
60
-      $this->Points[$X][$Y] = ($this->Points[$X][$Y] + $Value)/2;
52
+        if ( $X < 0 || $X >$this->GridSizeX ) { return(0); }
53
+        if ( $Y < 0 || $Y >$this->GridSizeY ) { return(0); }
54
+
55
+        if ( $this->Points[$X][$Y] == UNKNOWN || $Force )
56
+        $this->Points[$X][$Y] = $Value;
57
+        elseif ( $this->Points[$X][$Y] == UNKNOWN )
58
+        $this->Points[$X][$Y] = $Value;
59
+        else
60
+        $this->Points[$X][$Y] = ($this->Points[$X][$Y] + $Value)/2;
61 61
     }
62 62
 
63
-   /* Write the X labels */
64
-   function writeXLabels($Format="")
63
+    /* Write the X labels */
64
+    function writeXLabels($Format="")
65 65
     {
66
-     $R			= isset($Format["R"]) ? $Format["R"] : $this->pChartObject->FontColorR;
67
-     $G			= isset($Format["G"]) ? $Format["G"] : $this->pChartObject->FontColorG;
68
-     $B			= isset($Format["B"]) ? $Format["B"] : $this->pChartObject->FontColorB;
69
-     $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : $this->pChartObject->FontColorA;
70
-     $Angle		= isset($Format["Angle"]) ? $Format["Angle"] : 0;
71
-     $Padding		= isset($Format["Padding"]) ? $Format["Padding"] : 5;
72
-     $Position		= isset($Format["Position"]) ? $Format["Position"] : LABEL_POSITION_TOP;
73
-     $Labels		= isset($Format["Labels"]) ? $Format["Labels"] : NULL;
74
-     $CountOffset	= isset($Format["CountOffset"]) ? $Format["CountOffset"] : 0;
75
-
76
-     if ( $Labels != NULL && !is_array($Labels) ) { $Label = $Labels; $Labels = ""; $Labels[] = $Label; }
77
-
78
-     $X0    = $this->pChartObject->GraphAreaX1;
79
-     $XSize = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) / ($this->GridSizeX+1);
80
-
81
-     $Settings = array("Angle"=>$Angle,"R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha);
82
-     if ( $Position == LABEL_POSITION_TOP )
83
-      {
84
-       $YPos  = $this->pChartObject->GraphAreaY1 - $Padding;
85
-       if ($Angle == 0 ) { $Settings["Align"] = TEXT_ALIGN_BOTTOMMIDDLE; }
86
-       if ($Angle != 0 ) { $Settings["Align"] = TEXT_ALIGN_MIDDLELEFT; }
87
-      }
88
-     elseif ( $Position == LABEL_POSITION_BOTTOM )
89
-      {
90
-       $YPos  = $this->pChartObject->GraphAreaY2 + $Padding;
91
-       if ($Angle == 0 ) { $Settings["Align"] = TEXT_ALIGN_TOPMIDDLE; }
92
-       if ($Angle != 0 ) { $Settings["Align"] = TEXT_ALIGN_MIDDLERIGHT; }
93
-      }
94
-     else
95
-      return(-1);
96
-
97
-     for($X=0;$X<=$this->GridSizeX;$X++)
98
-      {
99
-       $XPos = floor($X0+$X*$XSize + $XSize/2);
100
-
101
-       if( $Labels == NULL || !isset($Labels[$X]) )
66
+        $R			= isset($Format["R"]) ? $Format["R"] : $this->pChartObject->FontColorR;
67
+        $G			= isset($Format["G"]) ? $Format["G"] : $this->pChartObject->FontColorG;
68
+        $B			= isset($Format["B"]) ? $Format["B"] : $this->pChartObject->FontColorB;
69
+        $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : $this->pChartObject->FontColorA;
70
+        $Angle		= isset($Format["Angle"]) ? $Format["Angle"] : 0;
71
+        $Padding		= isset($Format["Padding"]) ? $Format["Padding"] : 5;
72
+        $Position		= isset($Format["Position"]) ? $Format["Position"] : LABEL_POSITION_TOP;
73
+        $Labels		= isset($Format["Labels"]) ? $Format["Labels"] : NULL;
74
+        $CountOffset	= isset($Format["CountOffset"]) ? $Format["CountOffset"] : 0;
75
+
76
+        if ( $Labels != NULL && !is_array($Labels) ) { $Label = $Labels; $Labels = ""; $Labels[] = $Label; }
77
+
78
+        $X0    = $this->pChartObject->GraphAreaX1;
79
+        $XSize = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) / ($this->GridSizeX+1);
80
+
81
+        $Settings = array("Angle"=>$Angle,"R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha);
82
+        if ( $Position == LABEL_POSITION_TOP )
83
+        {
84
+        $YPos  = $this->pChartObject->GraphAreaY1 - $Padding;
85
+        if ($Angle == 0 ) { $Settings["Align"] = TEXT_ALIGN_BOTTOMMIDDLE; }
86
+        if ($Angle != 0 ) { $Settings["Align"] = TEXT_ALIGN_MIDDLELEFT; }
87
+        }
88
+        elseif ( $Position == LABEL_POSITION_BOTTOM )
89
+        {
90
+        $YPos  = $this->pChartObject->GraphAreaY2 + $Padding;
91
+        if ($Angle == 0 ) { $Settings["Align"] = TEXT_ALIGN_TOPMIDDLE; }
92
+        if ($Angle != 0 ) { $Settings["Align"] = TEXT_ALIGN_MIDDLERIGHT; }
93
+        }
94
+        else
95
+        return(-1);
96
+
97
+        for($X=0;$X<=$this->GridSizeX;$X++)
98
+        {
99
+        $XPos = floor($X0+$X*$XSize + $XSize/2);
100
+
101
+        if( $Labels == NULL || !isset($Labels[$X]) )
102 102
         $Value = $X+$CountOffset;
103
-       else
103
+        else
104 104
         $Value = $Labels[$X];
105 105
 
106
-       $this->pChartObject->drawText($XPos,$YPos,$Value,$Settings);
107
-      }
106
+        $this->pChartObject->drawText($XPos,$YPos,$Value,$Settings);
107
+        }
108 108
     }
109 109
 
110
-   /* Write the Y labels */
111
-   function writeYLabels($Format="")
110
+    /* Write the Y labels */
111
+    function writeYLabels($Format="")
112 112
     {
113
-     $R			= isset($Format["R"]) ? $Format["R"] : $this->pChartObject->FontColorR;
114
-     $G			= isset($Format["G"]) ? $Format["G"] : $this->pChartObject->FontColorG;
115
-     $B			= isset($Format["B"]) ? $Format["B"] : $this->pChartObject->FontColorB;
116
-     $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : $this->pChartObject->FontColorA;
117
-     $Angle		= isset($Format["Angle"]) ? $Format["Angle"] : 0;
118
-     $Padding		= isset($Format["Padding"]) ? $Format["Padding"] : 5;
119
-     $Position		= isset($Format["Position"]) ? $Format["Position"] : LABEL_POSITION_LEFT;
120
-     $Labels		= isset($Format["Labels"]) ? $Format["Labels"] : NULL;
121
-     $CountOffset	= isset($Format["CountOffset"]) ? $Format["CountOffset"] : 0;
122
-
123
-     if ( $Labels != NULL && !is_array($Labels) ) { $Label = $Labels; $Labels = ""; $Labels[] = $Label; }
124
-
125
-     $Y0    = $this->pChartObject->GraphAreaY1;
126
-     $YSize = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) / ($this->GridSizeY+1);
127
-
128
-     $Settings = array("Angle"=>$Angle,"R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha);
129
-     if ( $Position == LABEL_POSITION_LEFT )
130
-      { $XPos  = $this->pChartObject->GraphAreaX1 - $Padding; $Settings["Align"] = TEXT_ALIGN_MIDDLERIGHT; }
131
-     elseif ( $Position == LABEL_POSITION_RIGHT )
132
-      { $XPos  = $this->pChartObject->GraphAreaX2 + $Padding; $Settings["Align"] = TEXT_ALIGN_MIDDLELEFT; }
133
-     else
134
-      return(-1);
135
-
136
-     for($Y=0;$Y<=$this->GridSizeY;$Y++)
137
-      {
138
-       $YPos = floor($Y0+$Y*$YSize + $YSize/2);
139
-
140
-       if( $Labels == NULL || !isset($Labels[$Y]) )
113
+        $R			= isset($Format["R"]) ? $Format["R"] : $this->pChartObject->FontColorR;
114
+        $G			= isset($Format["G"]) ? $Format["G"] : $this->pChartObject->FontColorG;
115
+        $B			= isset($Format["B"]) ? $Format["B"] : $this->pChartObject->FontColorB;
116
+        $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : $this->pChartObject->FontColorA;
117
+        $Angle		= isset($Format["Angle"]) ? $Format["Angle"] : 0;
118
+        $Padding		= isset($Format["Padding"]) ? $Format["Padding"] : 5;
119
+        $Position		= isset($Format["Position"]) ? $Format["Position"] : LABEL_POSITION_LEFT;
120
+        $Labels		= isset($Format["Labels"]) ? $Format["Labels"] : NULL;
121
+        $CountOffset	= isset($Format["CountOffset"]) ? $Format["CountOffset"] : 0;
122
+
123
+        if ( $Labels != NULL && !is_array($Labels) ) { $Label = $Labels; $Labels = ""; $Labels[] = $Label; }
124
+
125
+        $Y0    = $this->pChartObject->GraphAreaY1;
126
+        $YSize = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) / ($this->GridSizeY+1);
127
+
128
+        $Settings = array("Angle"=>$Angle,"R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha);
129
+        if ( $Position == LABEL_POSITION_LEFT )
130
+        { $XPos  = $this->pChartObject->GraphAreaX1 - $Padding; $Settings["Align"] = TEXT_ALIGN_MIDDLERIGHT; }
131
+        elseif ( $Position == LABEL_POSITION_RIGHT )
132
+        { $XPos  = $this->pChartObject->GraphAreaX2 + $Padding; $Settings["Align"] = TEXT_ALIGN_MIDDLELEFT; }
133
+        else
134
+        return(-1);
135
+
136
+        for($Y=0;$Y<=$this->GridSizeY;$Y++)
137
+        {
138
+        $YPos = floor($Y0+$Y*$YSize + $YSize/2);
139
+
140
+        if( $Labels == NULL || !isset($Labels[$Y]) )
141 141
         $Value = $Y+$CountOffset;
142
-       else
142
+        else
143 143
         $Value = $Labels[$Y];
144 144
 
145
-       $this->pChartObject->drawText($XPos,$YPos,$Value,$Settings);
146
-      }
145
+        $this->pChartObject->drawText($XPos,$YPos,$Value,$Settings);
146
+        }
147 147
     }
148 148
 
149
-   /* Draw the area arround the specified Threshold */
150
-   function drawContour($Threshold,$Format="")
149
+    /* Draw the area arround the specified Threshold */
150
+    function drawContour($Threshold,$Format="")
151 151
     {
152
-     $R		= isset($Format["R"]) ? $Format["R"] : 0;
153
-     $G		= isset($Format["G"]) ? $Format["G"] : 0;
154
-     $B		= isset($Format["B"]) ? $Format["B"] : 0;
155
-     $Alpha	= isset($Format["Alpha"]) ? $Format["Alpha"] : 100;
156
-     $Ticks	= isset($Format["Ticks"]) ? $Format["Ticks"] : 3;
157
-     $Padding	= isset($Format["Padding"]) ? $Format["Padding"] : 0;
158
-
159
-     $X0    = $this->pChartObject->GraphAreaX1;
160
-     $Y0    = $this->pChartObject->GraphAreaY1;
161
-     $XSize = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) / ($this->GridSizeX+1);
162
-     $YSize = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) / ($this->GridSizeY+1);
163
-
164
-     $Color = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks);
165
-
166
-     for($X=0;$X<=$this->GridSizeX;$X++)
167
-      {
168
-       for($Y=0;$Y<=$this->GridSizeY;$Y++)
152
+        $R		= isset($Format["R"]) ? $Format["R"] : 0;
153
+        $G		= isset($Format["G"]) ? $Format["G"] : 0;
154
+        $B		= isset($Format["B"]) ? $Format["B"] : 0;
155
+        $Alpha	= isset($Format["Alpha"]) ? $Format["Alpha"] : 100;
156
+        $Ticks	= isset($Format["Ticks"]) ? $Format["Ticks"] : 3;
157
+        $Padding	= isset($Format["Padding"]) ? $Format["Padding"] : 0;
158
+
159
+        $X0    = $this->pChartObject->GraphAreaX1;
160
+        $Y0    = $this->pChartObject->GraphAreaY1;
161
+        $XSize = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) / ($this->GridSizeX+1);
162
+        $YSize = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) / ($this->GridSizeY+1);
163
+
164
+        $Color = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks);
165
+
166
+        for($X=0;$X<=$this->GridSizeX;$X++)
169 167
         {
170
-         $Value = $this->Points[$X][$Y];
168
+        for($Y=0;$Y<=$this->GridSizeY;$Y++)
169
+        {
170
+            $Value = $this->Points[$X][$Y];
171 171
 
172
-         if ( $Value != UNKNOWN && $Value != IGNORED && $Value >= $Threshold)
173
-          {
174
-           $X1 = floor($X0+$X*$XSize)+$Padding;
175
-           $Y1 = floor($Y0+$Y*$YSize)+$Padding;
176
-           $X2 = floor($X0+$X*$XSize+$XSize);
177
-           $Y2 = floor($Y0+$Y*$YSize+$YSize);
172
+            if ( $Value != UNKNOWN && $Value != IGNORED && $Value >= $Threshold)
173
+            {
174
+            $X1 = floor($X0+$X*$XSize)+$Padding;
175
+            $Y1 = floor($Y0+$Y*$YSize)+$Padding;
176
+            $X2 = floor($X0+$X*$XSize+$XSize);
177
+            $Y2 = floor($Y0+$Y*$YSize+$YSize);
178 178
 
179
-           if ( $X > 0 && $this->Points[$X-1][$Y] != UNKNOWN && $this->Points[$X-1][$Y] != IGNORED && $this->Points[$X-1][$Y] < $Threshold)
179
+            if ( $X > 0 && $this->Points[$X-1][$Y] != UNKNOWN && $this->Points[$X-1][$Y] != IGNORED && $this->Points[$X-1][$Y] < $Threshold)
180 180
             $this->pChartObject->drawLine($X1,$Y1,$X1,$Y2,$Color);
181
-           if ( $Y > 0 && $this->Points[$X][$Y-1] != UNKNOWN && $this->Points[$X][$Y-1] != IGNORED && $this->Points[$X][$Y-1] < $Threshold)
181
+            if ( $Y > 0 && $this->Points[$X][$Y-1] != UNKNOWN && $this->Points[$X][$Y-1] != IGNORED && $this->Points[$X][$Y-1] < $Threshold)
182 182
             $this->pChartObject->drawLine($X1,$Y1,$X2,$Y1,$Color);
183
-           if ( $X < $this->GridSizeX && $this->Points[$X+1][$Y] != UNKNOWN && $this->Points[$X+1][$Y] != IGNORED && $this->Points[$X+1][$Y] < $Threshold)
183
+            if ( $X < $this->GridSizeX && $this->Points[$X+1][$Y] != UNKNOWN && $this->Points[$X+1][$Y] != IGNORED && $this->Points[$X+1][$Y] < $Threshold)
184 184
             $this->pChartObject->drawLine($X2,$Y1,$X2,$Y2,$Color);
185
-           if ( $Y < $this->GridSizeY && $this->Points[$X][$Y+1] != UNKNOWN && $this->Points[$X][$Y+1] != IGNORED && $this->Points[$X][$Y+1] < $Threshold)
185
+            if ( $Y < $this->GridSizeY && $this->Points[$X][$Y+1] != UNKNOWN && $this->Points[$X][$Y+1] != IGNORED && $this->Points[$X][$Y+1] < $Threshold)
186 186
             $this->pChartObject->drawLine($X1,$Y2,$X2,$Y2,$Color);
187
-          }
187
+            }
188
+        }
188 189
         }
189
-      }
190 190
     }
191 191
 
192
-   /* Draw the surface chart */
193
-   function drawSurface($Format="")
192
+    /* Draw the surface chart */
193
+    function drawSurface($Format="")
194 194
     {
195
-     $Palette		= isset($Format["Palette"]) ? $Format["Palette"] : NULL;
196
-     $ShadeR1		= isset($Format["ShadeR1"]) ? $Format["ShadeR1"] : 77;
197
-     $ShadeG1		= isset($Format["ShadeG1"]) ? $Format["ShadeG1"] : 205;
198
-     $ShadeB1		= isset($Format["ShadeB1"]) ? $Format["ShadeB1"] : 21;
199
-     $ShadeA1		= isset($Format["ShadeA1"]) ? $Format["ShadeA1"] : 40;
200
-     $ShadeR2		= isset($Format["ShadeR2"]) ? $Format["ShadeR2"] : 227;
201
-     $ShadeG2		= isset($Format["ShadeG2"]) ? $Format["ShadeG2"] : 135;
202
-     $ShadeB2		= isset($Format["ShadeB2"]) ? $Format["ShadeB2"] : 61;
203
-     $ShadeA2		= isset($Format["ShadeA2"]) ? $Format["ShadeA2"] : 100;
204
-     $Border		= isset($Format["Border"]) ? $Format["Border"] : FALSE;
205
-     $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 0;
206
-     $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 0;
207
-     $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 0;
208
-     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : -1;
209
-     $Padding		= isset($Format["Padding"]) ? $Format["Padding"] : 1;
210
-
211
-     $X0    = $this->pChartObject->GraphAreaX1;
212
-     $Y0    = $this->pChartObject->GraphAreaY1;
213
-     $XSize = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) / ($this->GridSizeX+1);
214
-     $YSize = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) / ($this->GridSizeY+1);
215
-
216
-     for($X=0;$X<=$this->GridSizeX;$X++)
217
-      {
218
-       for($Y=0;$Y<=$this->GridSizeY;$Y++)
195
+        $Palette		= isset($Format["Palette"]) ? $Format["Palette"] : NULL;
196
+        $ShadeR1		= isset($Format["ShadeR1"]) ? $Format["ShadeR1"] : 77;
197
+        $ShadeG1		= isset($Format["ShadeG1"]) ? $Format["ShadeG1"] : 205;
198
+        $ShadeB1		= isset($Format["ShadeB1"]) ? $Format["ShadeB1"] : 21;
199
+        $ShadeA1		= isset($Format["ShadeA1"]) ? $Format["ShadeA1"] : 40;
200
+        $ShadeR2		= isset($Format["ShadeR2"]) ? $Format["ShadeR2"] : 227;
201
+        $ShadeG2		= isset($Format["ShadeG2"]) ? $Format["ShadeG2"] : 135;
202
+        $ShadeB2		= isset($Format["ShadeB2"]) ? $Format["ShadeB2"] : 61;
203
+        $ShadeA2		= isset($Format["ShadeA2"]) ? $Format["ShadeA2"] : 100;
204
+        $Border		= isset($Format["Border"]) ? $Format["Border"] : FALSE;
205
+        $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 0;
206
+        $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 0;
207
+        $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 0;
208
+        $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : -1;
209
+        $Padding		= isset($Format["Padding"]) ? $Format["Padding"] : 1;
210
+
211
+        $X0    = $this->pChartObject->GraphAreaX1;
212
+        $Y0    = $this->pChartObject->GraphAreaY1;
213
+        $XSize = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) / ($this->GridSizeX+1);
214
+        $YSize = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) / ($this->GridSizeY+1);
215
+
216
+        for($X=0;$X<=$this->GridSizeX;$X++)
217
+        {
218
+        for($Y=0;$Y<=$this->GridSizeY;$Y++)
219 219
         {
220
-         $Value = $this->Points[$X][$Y];
220
+            $Value = $this->Points[$X][$Y];
221 221
 
222
-         if ( $Value != UNKNOWN && $Value != IGNORED )
223
-          {
224
-           $X1 = floor($X0+$X*$XSize)+$Padding;
225
-           $Y1 = floor($Y0+$Y*$YSize)+$Padding;
226
-           $X2 = floor($X0+$X*$XSize+$XSize);
227
-           $Y2 = floor($Y0+$Y*$YSize+$YSize);
222
+            if ( $Value != UNKNOWN && $Value != IGNORED )
223
+            {
224
+            $X1 = floor($X0+$X*$XSize)+$Padding;
225
+            $Y1 = floor($Y0+$Y*$YSize)+$Padding;
226
+            $X2 = floor($X0+$X*$XSize+$XSize);
227
+            $Y2 = floor($Y0+$Y*$YSize+$YSize);
228 228
 
229
-           if ( $Palette != NULL )
229
+            if ( $Palette != NULL )
230 230
             {
231
-             if ( isset($Palette[$Value]) && isset($Palette[$Value]["R"]) ) { $R = $Palette[$Value]["R"]; } else { $R = 0; }
232
-             if ( isset($Palette[$Value]) && isset($Palette[$Value]["G"]) ) { $G = $Palette[$Value]["G"]; } else { $G = 0; }
233
-             if ( isset($Palette[$Value]) && isset($Palette[$Value]["B"]) ) { $B = $Palette[$Value]["B"]; } else { $B = 0; }
234
-             if ( isset($Palette[$Value]) && isset($Palette[$Value]["Alpha"]) ) { $Alpha = $Palette[$Value]["Alpha"]; } else { $Alpha = 1000; }
231
+                if ( isset($Palette[$Value]) && isset($Palette[$Value]["R"]) ) { $R = $Palette[$Value]["R"]; } else { $R = 0; }
232
+                if ( isset($Palette[$Value]) && isset($Palette[$Value]["G"]) ) { $G = $Palette[$Value]["G"]; } else { $G = 0; }
233
+                if ( isset($Palette[$Value]) && isset($Palette[$Value]["B"]) ) { $B = $Palette[$Value]["B"]; } else { $B = 0; }
234
+                if ( isset($Palette[$Value]) && isset($Palette[$Value]["Alpha"]) ) { $Alpha = $Palette[$Value]["Alpha"]; } else { $Alpha = 1000; }
235 235
             }
236
-           else
236
+            else
237 237
             {
238
-             $R = (($ShadeR2-$ShadeR1)/100)*$Value + $ShadeR1;
239
-             $G = (($ShadeG2-$ShadeG1)/100)*$Value + $ShadeG1;
240
-             $B = (($ShadeB2-$ShadeB1)/100)*$Value + $ShadeB1;
241
-             $Alpha = (($ShadeA2-$ShadeA1)/100)*$Value + $ShadeA1;
238
+                $R = (($ShadeR2-$ShadeR1)/100)*$Value + $ShadeR1;
239
+                $G = (($ShadeG2-$ShadeG1)/100)*$Value + $ShadeG1;
240
+                $B = (($ShadeB2-$ShadeB1)/100)*$Value + $ShadeB1;
241
+                $Alpha = (($ShadeA2-$ShadeA1)/100)*$Value + $ShadeA1;
242 242
             }
243 243
 
244
-           $Settings = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha);
245
-           if ( $Border ) { $Settings["BorderR"] = $BorderR; $Settings["BorderG"] = $BorderG; $Settings["BorderB"] = $BorderB; }
246
-           if ( $Surrounding != -1 ) { $Settings["BorderR"] = $R+$Surrounding; $Settings["BorderG"] = $G+$Surrounding; $Settings["BorderB"] = $B+$Surrounding; }
244
+            $Settings = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha);
245
+            if ( $Border ) { $Settings["BorderR"] = $BorderR; $Settings["BorderG"] = $BorderG; $Settings["BorderB"] = $BorderB; }
246
+            if ( $Surrounding != -1 ) { $Settings["BorderR"] = $R+$Surrounding; $Settings["BorderG"] = $G+$Surrounding; $Settings["BorderB"] = $B+$Surrounding; }
247 247
 
248
-           $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2-1,$Y2-1,$Settings);
249
-          }
248
+            $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2-1,$Y2-1,$Settings);
249
+            }
250
+        }
250 251
         }
251
-      }
252 252
     }
253 253
 
254
-   /* Compute the missing points */
255
-   function computeMissing()
254
+    /* Compute the missing points */
255
+    function computeMissing()
256 256
     {
257
-     $Missing = "";
258
-     for($X=0;$X<=$this->GridSizeX;$X++)
259
-      {
260
-       for($Y=0;$Y<=$this->GridSizeY;$Y++)
257
+        $Missing = "";
258
+        for($X=0;$X<=$this->GridSizeX;$X++)
259
+        {
260
+        for($Y=0;$Y<=$this->GridSizeY;$Y++)
261 261
         {
262
-         if ( $this->Points[$X][$Y] == UNKNOWN )
263
-          $Missing[] = $X.",".$Y;
262
+            if ( $this->Points[$X][$Y] == UNKNOWN )
263
+            $Missing[] = $X.",".$Y;
264 264
         }
265
-      }
266
-     shuffle($Missing);
265
+        }
266
+        shuffle($Missing);
267 267
      
268
-     foreach($Missing as $Key => $Pos)
269
-      {
270
-       $Pos = preg_split("/,/",$Pos);
271
-       $X   = $Pos[0];
272
-       $Y   = $Pos[1];
268
+        foreach($Missing as $Key => $Pos)
269
+        {
270
+        $Pos = preg_split("/,/",$Pos);
271
+        $X   = $Pos[0];
272
+        $Y   = $Pos[1];
273 273
 
274
-       if ( $this->Points[$X][$Y] == UNKNOWN )
274
+        if ( $this->Points[$X][$Y] == UNKNOWN )
275 275
         {
276
-         $NearestNeighbor = $this->getNearestNeighbor($X,$Y);
276
+            $NearestNeighbor = $this->getNearestNeighbor($X,$Y);
277 277
 
278
-         $Value = 0; $Points = 0;
279
-         for($Xi=$X-$NearestNeighbor;$Xi<=$X+$NearestNeighbor;$Xi++)
280
-          {
281
-           for($Yi=$Y-$NearestNeighbor;$Yi<=$Y+$NearestNeighbor;$Yi++)
278
+            $Value = 0; $Points = 0;
279
+            for($Xi=$X-$NearestNeighbor;$Xi<=$X+$NearestNeighbor;$Xi++)
282 280
             {
283
-             if ($Xi >=0 && $Yi >= 0 && $Xi <= $this->GridSizeX && $Yi <= $this->GridSizeY && $this->Points[$Xi][$Yi] != UNKNOWN && $this->Points[$Xi][$Yi] != IGNORED)
284
-              {
285
-               $Value = $Value + $this->Points[$Xi][$Yi]; $Points++;
286
-              }
281
+            for($Yi=$Y-$NearestNeighbor;$Yi<=$Y+$NearestNeighbor;$Yi++)
282
+            {
283
+                if ($Xi >=0 && $Yi >= 0 && $Xi <= $this->GridSizeX && $Yi <= $this->GridSizeY && $this->Points[$Xi][$Yi] != UNKNOWN && $this->Points[$Xi][$Yi] != IGNORED)
284
+                {
285
+                $Value = $Value + $this->Points[$Xi][$Yi]; $Points++;
286
+                }
287
+            }
287 288
             }
288
-          }
289 289
 
290
-         if ( $Points != 0 ) { $this->Points[$X][$Y] = $Value / $Points; }
290
+            if ( $Points != 0 ) { $this->Points[$X][$Y] = $Value / $Points; }
291
+        }
291 292
         }
292
-      }
293 293
     }
294 294
 
295
-   /* Return the nearest Neighbor distance of a point */
296
-   function getNearestNeighbor($Xp,$Yp)
295
+    /* Return the nearest Neighbor distance of a point */
296
+    function getNearestNeighbor($Xp,$Yp)
297 297
     {
298
-     $Nearest = UNKNOWN;
299
-     for($X=0;$X<=$this->GridSizeX;$X++)
300
-      {
301
-       for($Y=0;$Y<=$this->GridSizeY;$Y++)
298
+        $Nearest = UNKNOWN;
299
+        for($X=0;$X<=$this->GridSizeX;$X++)
300
+        {
301
+        for($Y=0;$Y<=$this->GridSizeY;$Y++)
302 302
         {
303
-         if ( $this->Points[$X][$Y] != UNKNOWN && $this->Points[$X][$Y] != IGNORED )
304
-          {
305
-           $DistanceX = max($Xp,$X)-min($Xp,$X);
306
-           $DistanceY = max($Yp,$Y)-min($Yp,$Y);
307
-           $Distance  = max($DistanceX,$DistanceY);
308
-           if ( $Distance < $Nearest || $Nearest == UNKNOWN ) { $Nearest = $Distance; }
309
-          }
303
+            if ( $this->Points[$X][$Y] != UNKNOWN && $this->Points[$X][$Y] != IGNORED )
304
+            {
305
+            $DistanceX = max($Xp,$X)-min($Xp,$X);
306
+            $DistanceY = max($Yp,$Y)-min($Yp,$Y);
307
+            $Distance  = max($DistanceX,$DistanceY);
308
+            if ( $Distance < $Nearest || $Nearest == UNKNOWN ) { $Nearest = $Distance; }
309
+            }
310 310
         }
311
-      }
312
-     return($Nearest);
311
+        }
312
+        return($Nearest);
313
+    }
313 314
     }
314
-  }
315 315
 ?>
316 316
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +114 added lines, -114 removed lines patch added patch discarded remove patch
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
13 13
      You can find the whole class documentation on the pChart web site.
14 14
  */
15 15
 
16
- define("UNKNOWN"		, 0.123456789);
17
- define("IGNORED"		, -1);
16
+ define("UNKNOWN", 0.123456789);
17
+ define("IGNORED", -1);
18 18
 
19
- define("LABEL_POSITION_LEFT"	, 880001);
20
- define("LABEL_POSITION_RIGHT"	, 880002);
21
- define("LABEL_POSITION_TOP"	, 880003);
22
- define("LABEL_POSITION_BOTTOM"	, 880004);
19
+ define("LABEL_POSITION_LEFT", 880001);
20
+ define("LABEL_POSITION_RIGHT", 880002);
21
+ define("LABEL_POSITION_TOP", 880003);
22
+ define("LABEL_POSITION_BOTTOM", 880004);
23 23
 
24 24
  /* pStock class definition */
25 25
  class pSurface
@@ -38,159 +38,159 @@  discard block
 block discarded – undo
38 38
     }
39 39
 
40 40
    /* Define the grid size and initialise the 2D matrix */
41
-   function setGrid($XSize=10,$YSize=10)
41
+   function setGrid($XSize = 10, $YSize = 10)
42 42
     {
43
-     for($X=0; $X<=$XSize; $X++) { for($Y=0; $Y<=$YSize; $Y++) { $this->Points[$X][$Y]=UNKNOWN; } } 
43
+     for ($X = 0; $X <= $XSize; $X++) { for ($Y = 0; $Y <= $YSize; $Y++) { $this->Points[$X][$Y] = UNKNOWN; } } 
44 44
 
45 45
      $this->GridSizeX = $XSize;
46 46
      $this->GridSizeY = $YSize;
47 47
     }
48 48
 
49 49
    /* Add a point on the grid */
50
-   function addPoint($X,$Y,$Value,$Force=TRUE)
50
+   function addPoint($X, $Y, $Value, $Force = TRUE)
51 51
     {
52
-     if ( $X < 0 || $X >$this->GridSizeX ) { return(0); }
53
-     if ( $Y < 0 || $Y >$this->GridSizeY ) { return(0); }
52
+     if ($X < 0 || $X > $this->GridSizeX) { return(0); }
53
+     if ($Y < 0 || $Y > $this->GridSizeY) { return(0); }
54 54
 
55
-     if ( $this->Points[$X][$Y] == UNKNOWN || $Force )
55
+     if ($this->Points[$X][$Y] == UNKNOWN || $Force)
56 56
       $this->Points[$X][$Y] = $Value;
57
-     elseif ( $this->Points[$X][$Y] == UNKNOWN )
57
+     elseif ($this->Points[$X][$Y] == UNKNOWN)
58 58
       $this->Points[$X][$Y] = $Value;
59 59
      else
60 60
       $this->Points[$X][$Y] = ($this->Points[$X][$Y] + $Value)/2;
61 61
     }
62 62
 
63 63
    /* Write the X labels */
64
-   function writeXLabels($Format="")
64
+   function writeXLabels($Format = "")
65 65
     {
66 66
      $R			= isset($Format["R"]) ? $Format["R"] : $this->pChartObject->FontColorR;
67 67
      $G			= isset($Format["G"]) ? $Format["G"] : $this->pChartObject->FontColorG;
68 68
      $B			= isset($Format["B"]) ? $Format["B"] : $this->pChartObject->FontColorB;
69 69
      $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : $this->pChartObject->FontColorA;
70 70
      $Angle		= isset($Format["Angle"]) ? $Format["Angle"] : 0;
71
-     $Padding		= isset($Format["Padding"]) ? $Format["Padding"] : 5;
72
-     $Position		= isset($Format["Position"]) ? $Format["Position"] : LABEL_POSITION_TOP;
73
-     $Labels		= isset($Format["Labels"]) ? $Format["Labels"] : NULL;
74
-     $CountOffset	= isset($Format["CountOffset"]) ? $Format["CountOffset"] : 0;
71
+     $Padding = isset($Format["Padding"]) ? $Format["Padding"] : 5;
72
+     $Position = isset($Format["Position"]) ? $Format["Position"] : LABEL_POSITION_TOP;
73
+     $Labels = isset($Format["Labels"]) ? $Format["Labels"] : NULL;
74
+     $CountOffset = isset($Format["CountOffset"]) ? $Format["CountOffset"] : 0;
75 75
 
76
-     if ( $Labels != NULL && !is_array($Labels) ) { $Label = $Labels; $Labels = ""; $Labels[] = $Label; }
76
+     if ($Labels != NULL && !is_array($Labels)) { $Label = $Labels; $Labels = ""; $Labels[] = $Label; }
77 77
 
78 78
      $X0    = $this->pChartObject->GraphAreaX1;
79
-     $XSize = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) / ($this->GridSizeX+1);
79
+     $XSize = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1)/($this->GridSizeX + 1);
80 80
 
81
-     $Settings = array("Angle"=>$Angle,"R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha);
82
-     if ( $Position == LABEL_POSITION_TOP )
81
+     $Settings = array("Angle"=>$Angle, "R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha);
82
+     if ($Position == LABEL_POSITION_TOP)
83 83
       {
84
-       $YPos  = $this->pChartObject->GraphAreaY1 - $Padding;
85
-       if ($Angle == 0 ) { $Settings["Align"] = TEXT_ALIGN_BOTTOMMIDDLE; }
86
-       if ($Angle != 0 ) { $Settings["Align"] = TEXT_ALIGN_MIDDLELEFT; }
84
+       $YPos = $this->pChartObject->GraphAreaY1 - $Padding;
85
+       if ($Angle == 0) { $Settings["Align"] = TEXT_ALIGN_BOTTOMMIDDLE; }
86
+       if ($Angle != 0) { $Settings["Align"] = TEXT_ALIGN_MIDDLELEFT; }
87 87
       }
88
-     elseif ( $Position == LABEL_POSITION_BOTTOM )
88
+     elseif ($Position == LABEL_POSITION_BOTTOM)
89 89
       {
90
-       $YPos  = $this->pChartObject->GraphAreaY2 + $Padding;
91
-       if ($Angle == 0 ) { $Settings["Align"] = TEXT_ALIGN_TOPMIDDLE; }
92
-       if ($Angle != 0 ) { $Settings["Align"] = TEXT_ALIGN_MIDDLERIGHT; }
90
+       $YPos = $this->pChartObject->GraphAreaY2 + $Padding;
91
+       if ($Angle == 0) { $Settings["Align"] = TEXT_ALIGN_TOPMIDDLE; }
92
+       if ($Angle != 0) { $Settings["Align"] = TEXT_ALIGN_MIDDLERIGHT; }
93 93
       }
94 94
      else
95 95
       return(-1);
96 96
 
97
-     for($X=0;$X<=$this->GridSizeX;$X++)
97
+     for ($X = 0; $X <= $this->GridSizeX; $X++)
98 98
       {
99
-       $XPos = floor($X0+$X*$XSize + $XSize/2);
99
+       $XPos = floor($X0 + $X*$XSize + $XSize/2);
100 100
 
101
-       if( $Labels == NULL || !isset($Labels[$X]) )
102
-        $Value = $X+$CountOffset;
101
+       if ($Labels == NULL || !isset($Labels[$X]))
102
+        $Value = $X + $CountOffset;
103 103
        else
104 104
         $Value = $Labels[$X];
105 105
 
106
-       $this->pChartObject->drawText($XPos,$YPos,$Value,$Settings);
106
+       $this->pChartObject->drawText($XPos, $YPos, $Value, $Settings);
107 107
       }
108 108
     }
109 109
 
110 110
    /* Write the Y labels */
111
-   function writeYLabels($Format="")
111
+   function writeYLabels($Format = "")
112 112
     {
113 113
      $R			= isset($Format["R"]) ? $Format["R"] : $this->pChartObject->FontColorR;
114 114
      $G			= isset($Format["G"]) ? $Format["G"] : $this->pChartObject->FontColorG;
115 115
      $B			= isset($Format["B"]) ? $Format["B"] : $this->pChartObject->FontColorB;
116 116
      $Alpha		= isset($Format["Alpha"]) ? $Format["Alpha"] : $this->pChartObject->FontColorA;
117 117
      $Angle		= isset($Format["Angle"]) ? $Format["Angle"] : 0;
118
-     $Padding		= isset($Format["Padding"]) ? $Format["Padding"] : 5;
119
-     $Position		= isset($Format["Position"]) ? $Format["Position"] : LABEL_POSITION_LEFT;
120
-     $Labels		= isset($Format["Labels"]) ? $Format["Labels"] : NULL;
121
-     $CountOffset	= isset($Format["CountOffset"]) ? $Format["CountOffset"] : 0;
118
+     $Padding = isset($Format["Padding"]) ? $Format["Padding"] : 5;
119
+     $Position = isset($Format["Position"]) ? $Format["Position"] : LABEL_POSITION_LEFT;
120
+     $Labels = isset($Format["Labels"]) ? $Format["Labels"] : NULL;
121
+     $CountOffset = isset($Format["CountOffset"]) ? $Format["CountOffset"] : 0;
122 122
 
123
-     if ( $Labels != NULL && !is_array($Labels) ) { $Label = $Labels; $Labels = ""; $Labels[] = $Label; }
123
+     if ($Labels != NULL && !is_array($Labels)) { $Label = $Labels; $Labels = ""; $Labels[] = $Label; }
124 124
 
125 125
      $Y0    = $this->pChartObject->GraphAreaY1;
126
-     $YSize = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) / ($this->GridSizeY+1);
126
+     $YSize = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1)/($this->GridSizeY + 1);
127 127
 
128
-     $Settings = array("Angle"=>$Angle,"R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha);
129
-     if ( $Position == LABEL_POSITION_LEFT )
128
+     $Settings = array("Angle"=>$Angle, "R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha);
129
+     if ($Position == LABEL_POSITION_LEFT)
130 130
       { $XPos  = $this->pChartObject->GraphAreaX1 - $Padding; $Settings["Align"] = TEXT_ALIGN_MIDDLERIGHT; }
131
-     elseif ( $Position == LABEL_POSITION_RIGHT )
131
+     elseif ($Position == LABEL_POSITION_RIGHT)
132 132
       { $XPos  = $this->pChartObject->GraphAreaX2 + $Padding; $Settings["Align"] = TEXT_ALIGN_MIDDLELEFT; }
133 133
      else
134 134
       return(-1);
135 135
 
136
-     for($Y=0;$Y<=$this->GridSizeY;$Y++)
136
+     for ($Y = 0; $Y <= $this->GridSizeY; $Y++)
137 137
       {
138
-       $YPos = floor($Y0+$Y*$YSize + $YSize/2);
138
+       $YPos = floor($Y0 + $Y*$YSize + $YSize/2);
139 139
 
140
-       if( $Labels == NULL || !isset($Labels[$Y]) )
141
-        $Value = $Y+$CountOffset;
140
+       if ($Labels == NULL || !isset($Labels[$Y]))
141
+        $Value = $Y + $CountOffset;
142 142
        else
143 143
         $Value = $Labels[$Y];
144 144
 
145
-       $this->pChartObject->drawText($XPos,$YPos,$Value,$Settings);
145
+       $this->pChartObject->drawText($XPos, $YPos, $Value, $Settings);
146 146
       }
147 147
     }
148 148
 
149 149
    /* Draw the area arround the specified Threshold */
150
-   function drawContour($Threshold,$Format="")
150
+   function drawContour($Threshold, $Format = "")
151 151
     {
152 152
      $R		= isset($Format["R"]) ? $Format["R"] : 0;
153 153
      $G		= isset($Format["G"]) ? $Format["G"] : 0;
154 154
      $B		= isset($Format["B"]) ? $Format["B"] : 0;
155 155
      $Alpha	= isset($Format["Alpha"]) ? $Format["Alpha"] : 100;
156 156
      $Ticks	= isset($Format["Ticks"]) ? $Format["Ticks"] : 3;
157
-     $Padding	= isset($Format["Padding"]) ? $Format["Padding"] : 0;
157
+     $Padding = isset($Format["Padding"]) ? $Format["Padding"] : 0;
158 158
 
159 159
      $X0    = $this->pChartObject->GraphAreaX1;
160 160
      $Y0    = $this->pChartObject->GraphAreaY1;
161
-     $XSize = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) / ($this->GridSizeX+1);
162
-     $YSize = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) / ($this->GridSizeY+1);
161
+     $XSize = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1)/($this->GridSizeX + 1);
162
+     $YSize = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1)/($this->GridSizeY + 1);
163 163
 
164
-     $Color = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks);
164
+     $Color = array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha, "Ticks"=>$Ticks);
165 165
 
166
-     for($X=0;$X<=$this->GridSizeX;$X++)
166
+     for ($X = 0; $X <= $this->GridSizeX; $X++)
167 167
       {
168
-       for($Y=0;$Y<=$this->GridSizeY;$Y++)
168
+       for ($Y = 0; $Y <= $this->GridSizeY; $Y++)
169 169
         {
170 170
          $Value = $this->Points[$X][$Y];
171 171
 
172
-         if ( $Value != UNKNOWN && $Value != IGNORED && $Value >= $Threshold)
172
+         if ($Value != UNKNOWN && $Value != IGNORED && $Value >= $Threshold)
173 173
           {
174
-           $X1 = floor($X0+$X*$XSize)+$Padding;
175
-           $Y1 = floor($Y0+$Y*$YSize)+$Padding;
176
-           $X2 = floor($X0+$X*$XSize+$XSize);
177
-           $Y2 = floor($Y0+$Y*$YSize+$YSize);
178
-
179
-           if ( $X > 0 && $this->Points[$X-1][$Y] != UNKNOWN && $this->Points[$X-1][$Y] != IGNORED && $this->Points[$X-1][$Y] < $Threshold)
180
-            $this->pChartObject->drawLine($X1,$Y1,$X1,$Y2,$Color);
181
-           if ( $Y > 0 && $this->Points[$X][$Y-1] != UNKNOWN && $this->Points[$X][$Y-1] != IGNORED && $this->Points[$X][$Y-1] < $Threshold)
182
-            $this->pChartObject->drawLine($X1,$Y1,$X2,$Y1,$Color);
183
-           if ( $X < $this->GridSizeX && $this->Points[$X+1][$Y] != UNKNOWN && $this->Points[$X+1][$Y] != IGNORED && $this->Points[$X+1][$Y] < $Threshold)
184
-            $this->pChartObject->drawLine($X2,$Y1,$X2,$Y2,$Color);
185
-           if ( $Y < $this->GridSizeY && $this->Points[$X][$Y+1] != UNKNOWN && $this->Points[$X][$Y+1] != IGNORED && $this->Points[$X][$Y+1] < $Threshold)
186
-            $this->pChartObject->drawLine($X1,$Y2,$X2,$Y2,$Color);
174
+           $X1 = floor($X0 + $X*$XSize) + $Padding;
175
+           $Y1 = floor($Y0 + $Y*$YSize) + $Padding;
176
+           $X2 = floor($X0 + $X*$XSize + $XSize);
177
+           $Y2 = floor($Y0 + $Y*$YSize + $YSize);
178
+
179
+           if ($X > 0 && $this->Points[$X - 1][$Y] != UNKNOWN && $this->Points[$X - 1][$Y] != IGNORED && $this->Points[$X - 1][$Y] < $Threshold)
180
+            $this->pChartObject->drawLine($X1, $Y1, $X1, $Y2, $Color);
181
+           if ($Y > 0 && $this->Points[$X][$Y - 1] != UNKNOWN && $this->Points[$X][$Y - 1] != IGNORED && $this->Points[$X][$Y - 1] < $Threshold)
182
+            $this->pChartObject->drawLine($X1, $Y1, $X2, $Y1, $Color);
183
+           if ($X < $this->GridSizeX && $this->Points[$X + 1][$Y] != UNKNOWN && $this->Points[$X + 1][$Y] != IGNORED && $this->Points[$X + 1][$Y] < $Threshold)
184
+            $this->pChartObject->drawLine($X2, $Y1, $X2, $Y2, $Color);
185
+           if ($Y < $this->GridSizeY && $this->Points[$X][$Y + 1] != UNKNOWN && $this->Points[$X][$Y + 1] != IGNORED && $this->Points[$X][$Y + 1] < $Threshold)
186
+            $this->pChartObject->drawLine($X1, $Y2, $X2, $Y2, $Color);
187 187
           }
188 188
         }
189 189
       }
190 190
     }
191 191
 
192 192
    /* Draw the surface chart */
193
-   function drawSurface($Format="")
193
+   function drawSurface($Format = "")
194 194
     {
195 195
      $Palette		= isset($Format["Palette"]) ? $Format["Palette"] : NULL;
196 196
      $ShadeR1		= isset($Format["ShadeR1"]) ? $Format["ShadeR1"] : 77;
@@ -201,51 +201,51 @@  discard block
 block discarded – undo
201 201
      $ShadeG2		= isset($Format["ShadeG2"]) ? $Format["ShadeG2"] : 135;
202 202
      $ShadeB2		= isset($Format["ShadeB2"]) ? $Format["ShadeB2"] : 61;
203 203
      $ShadeA2		= isset($Format["ShadeA2"]) ? $Format["ShadeA2"] : 100;
204
-     $Border		= isset($Format["Border"]) ? $Format["Border"] : FALSE;
204
+     $Border = isset($Format["Border"]) ? $Format["Border"] : FALSE;
205 205
      $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 0;
206 206
      $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 0;
207 207
      $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 0;
208
-     $Surrounding	= isset($Format["Surrounding"]) ? $Format["Surrounding"] : -1;
208
+     $Surrounding = isset($Format["Surrounding"]) ? $Format["Surrounding"] : -1;
209 209
      $Padding		= isset($Format["Padding"]) ? $Format["Padding"] : 1;
210 210
 
211 211
      $X0    = $this->pChartObject->GraphAreaX1;
212 212
      $Y0    = $this->pChartObject->GraphAreaY1;
213
-     $XSize = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) / ($this->GridSizeX+1);
214
-     $YSize = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) / ($this->GridSizeY+1);
213
+     $XSize = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1)/($this->GridSizeX + 1);
214
+     $YSize = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1)/($this->GridSizeY + 1);
215 215
 
216
-     for($X=0;$X<=$this->GridSizeX;$X++)
216
+     for ($X = 0; $X <= $this->GridSizeX; $X++)
217 217
       {
218
-       for($Y=0;$Y<=$this->GridSizeY;$Y++)
218
+       for ($Y = 0; $Y <= $this->GridSizeY; $Y++)
219 219
         {
220 220
          $Value = $this->Points[$X][$Y];
221 221
 
222
-         if ( $Value != UNKNOWN && $Value != IGNORED )
222
+         if ($Value != UNKNOWN && $Value != IGNORED)
223 223
           {
224
-           $X1 = floor($X0+$X*$XSize)+$Padding;
225
-           $Y1 = floor($Y0+$Y*$YSize)+$Padding;
226
-           $X2 = floor($X0+$X*$XSize+$XSize);
227
-           $Y2 = floor($Y0+$Y*$YSize+$YSize);
224
+           $X1 = floor($X0 + $X*$XSize) + $Padding;
225
+           $Y1 = floor($Y0 + $Y*$YSize) + $Padding;
226
+           $X2 = floor($X0 + $X*$XSize + $XSize);
227
+           $Y2 = floor($Y0 + $Y*$YSize + $YSize);
228 228
 
229
-           if ( $Palette != NULL )
229
+           if ($Palette != NULL)
230 230
             {
231
-             if ( isset($Palette[$Value]) && isset($Palette[$Value]["R"]) ) { $R = $Palette[$Value]["R"]; } else { $R = 0; }
232
-             if ( isset($Palette[$Value]) && isset($Palette[$Value]["G"]) ) { $G = $Palette[$Value]["G"]; } else { $G = 0; }
233
-             if ( isset($Palette[$Value]) && isset($Palette[$Value]["B"]) ) { $B = $Palette[$Value]["B"]; } else { $B = 0; }
234
-             if ( isset($Palette[$Value]) && isset($Palette[$Value]["Alpha"]) ) { $Alpha = $Palette[$Value]["Alpha"]; } else { $Alpha = 1000; }
231
+             if (isset($Palette[$Value]) && isset($Palette[$Value]["R"])) { $R = $Palette[$Value]["R"]; } else { $R = 0; }
232
+             if (isset($Palette[$Value]) && isset($Palette[$Value]["G"])) { $G = $Palette[$Value]["G"]; } else { $G = 0; }
233
+             if (isset($Palette[$Value]) && isset($Palette[$Value]["B"])) { $B = $Palette[$Value]["B"]; } else { $B = 0; }
234
+             if (isset($Palette[$Value]) && isset($Palette[$Value]["Alpha"])) { $Alpha = $Palette[$Value]["Alpha"]; } else { $Alpha = 1000; }
235 235
             }
236 236
            else
237 237
             {
238
-             $R = (($ShadeR2-$ShadeR1)/100)*$Value + $ShadeR1;
239
-             $G = (($ShadeG2-$ShadeG1)/100)*$Value + $ShadeG1;
240
-             $B = (($ShadeB2-$ShadeB1)/100)*$Value + $ShadeB1;
241
-             $Alpha = (($ShadeA2-$ShadeA1)/100)*$Value + $ShadeA1;
238
+             $R = (($ShadeR2 - $ShadeR1)/100)*$Value + $ShadeR1;
239
+             $G = (($ShadeG2 - $ShadeG1)/100)*$Value + $ShadeG1;
240
+             $B = (($ShadeB2 - $ShadeB1)/100)*$Value + $ShadeB1;
241
+             $Alpha = (($ShadeA2 - $ShadeA1)/100)*$Value + $ShadeA1;
242 242
             }
243 243
 
244
-           $Settings = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha);
245
-           if ( $Border ) { $Settings["BorderR"] = $BorderR; $Settings["BorderG"] = $BorderG; $Settings["BorderB"] = $BorderB; }
246
-           if ( $Surrounding != -1 ) { $Settings["BorderR"] = $R+$Surrounding; $Settings["BorderG"] = $G+$Surrounding; $Settings["BorderB"] = $B+$Surrounding; }
244
+           $Settings = array("R"=>$R, "G"=>$G, "B"=>$B, "Alpha"=>$Alpha);
245
+           if ($Border) { $Settings["BorderR"] = $BorderR; $Settings["BorderG"] = $BorderG; $Settings["BorderB"] = $BorderB; }
246
+           if ($Surrounding != -1) { $Settings["BorderR"] = $R + $Surrounding; $Settings["BorderG"] = $G + $Surrounding; $Settings["BorderB"] = $B + $Surrounding; }
247 247
 
248
-           $this->pChartObject->drawFilledRectangle($X1,$Y1,$X2-1,$Y2-1,$Settings);
248
+           $this->pChartObject->drawFilledRectangle($X1, $Y1, $X2 - 1, $Y2 - 1, $Settings);
249 249
           }
250 250
         }
251 251
       }
@@ -255,57 +255,57 @@  discard block
 block discarded – undo
255 255
    function computeMissing()
256 256
     {
257 257
      $Missing = "";
258
-     for($X=0;$X<=$this->GridSizeX;$X++)
258
+     for ($X = 0; $X <= $this->GridSizeX; $X++)
259 259
       {
260
-       for($Y=0;$Y<=$this->GridSizeY;$Y++)
260
+       for ($Y = 0; $Y <= $this->GridSizeY; $Y++)
261 261
         {
262
-         if ( $this->Points[$X][$Y] == UNKNOWN )
262
+         if ($this->Points[$X][$Y] == UNKNOWN)
263 263
           $Missing[] = $X.",".$Y;
264 264
         }
265 265
       }
266 266
      shuffle($Missing);
267 267
      
268
-     foreach($Missing as $Key => $Pos)
268
+     foreach ($Missing as $Key => $Pos)
269 269
       {
270
-       $Pos = preg_split("/,/",$Pos);
270
+       $Pos = preg_split("/,/", $Pos);
271 271
        $X   = $Pos[0];
272 272
        $Y   = $Pos[1];
273 273
 
274
-       if ( $this->Points[$X][$Y] == UNKNOWN )
274
+       if ($this->Points[$X][$Y] == UNKNOWN)
275 275
         {
276
-         $NearestNeighbor = $this->getNearestNeighbor($X,$Y);
276
+         $NearestNeighbor = $this->getNearestNeighbor($X, $Y);
277 277
 
278 278
          $Value = 0; $Points = 0;
279
-         for($Xi=$X-$NearestNeighbor;$Xi<=$X+$NearestNeighbor;$Xi++)
279
+         for ($Xi = $X - $NearestNeighbor; $Xi <= $X + $NearestNeighbor; $Xi++)
280 280
           {
281
-           for($Yi=$Y-$NearestNeighbor;$Yi<=$Y+$NearestNeighbor;$Yi++)
281
+           for ($Yi = $Y - $NearestNeighbor; $Yi <= $Y + $NearestNeighbor; $Yi++)
282 282
             {
283
-             if ($Xi >=0 && $Yi >= 0 && $Xi <= $this->GridSizeX && $Yi <= $this->GridSizeY && $this->Points[$Xi][$Yi] != UNKNOWN && $this->Points[$Xi][$Yi] != IGNORED)
283
+             if ($Xi >= 0 && $Yi >= 0 && $Xi <= $this->GridSizeX && $Yi <= $this->GridSizeY && $this->Points[$Xi][$Yi] != UNKNOWN && $this->Points[$Xi][$Yi] != IGNORED)
284 284
               {
285 285
                $Value = $Value + $this->Points[$Xi][$Yi]; $Points++;
286 286
               }
287 287
             }
288 288
           }
289 289
 
290
-         if ( $Points != 0 ) { $this->Points[$X][$Y] = $Value / $Points; }
290
+         if ($Points != 0) { $this->Points[$X][$Y] = $Value/$Points; }
291 291
         }
292 292
       }
293 293
     }
294 294
 
295 295
    /* Return the nearest Neighbor distance of a point */
296
-   function getNearestNeighbor($Xp,$Yp)
296
+   function getNearestNeighbor($Xp, $Yp)
297 297
     {
298 298
      $Nearest = UNKNOWN;
299
-     for($X=0;$X<=$this->GridSizeX;$X++)
299
+     for ($X = 0; $X <= $this->GridSizeX; $X++)
300 300
       {
301
-       for($Y=0;$Y<=$this->GridSizeY;$Y++)
301
+       for ($Y = 0; $Y <= $this->GridSizeY; $Y++)
302 302
         {
303
-         if ( $this->Points[$X][$Y] != UNKNOWN && $this->Points[$X][$Y] != IGNORED )
303
+         if ($this->Points[$X][$Y] != UNKNOWN && $this->Points[$X][$Y] != IGNORED)
304 304
           {
305
-           $DistanceX = max($Xp,$X)-min($Xp,$X);
306
-           $DistanceY = max($Yp,$Y)-min($Yp,$Y);
307
-           $Distance  = max($DistanceX,$DistanceY);
308
-           if ( $Distance < $Nearest || $Nearest == UNKNOWN ) { $Nearest = $Distance; }
305
+           $DistanceX = max($Xp, $X) - min($Xp, $X);
306
+           $DistanceY = max($Yp, $Y) - min($Yp, $Y);
307
+           $Distance  = max($DistanceX, $DistanceY);
308
+           if ($Distance < $Nearest || $Nearest == UNKNOWN) { $Nearest = $Distance; }
309 309
           }
310 310
         }
311 311
       }
Please login to merge, or discard this patch.
Braces   +35 added lines, -72 removed lines patch added patch discarded remove patch
@@ -22,24 +22,21 @@  discard block
 block discarded – undo
22 22
  define("LABEL_POSITION_BOTTOM"	, 880004);
23 23
 
24 24
  /* pStock class definition */
25
- class pSurface
26
-  {
25
+ class pSurface {
27 26
    var $pChartObject;
28 27
    var $GridSizeX;
29 28
    var $GridSizeY;
30 29
    var $Points;
31 30
 
32 31
    /* Class creator */
33
-   function pSurface($pChartObject)
34
-    {
32
+   function pSurface($pChartObject) {
35 33
      $this->pChartObject = $pChartObject;
36 34
      $this->GridSize     = 10;
37 35
      $this->Points       = "";
38 36
     }
39 37
 
40 38
    /* Define the grid size and initialise the 2D matrix */
41
-   function setGrid($XSize=10,$YSize=10)
42
-    {
39
+   function setGrid($XSize=10,$YSize=10) {
43 40
      for($X=0; $X<=$XSize; $X++) { for($Y=0; $Y<=$YSize; $Y++) { $this->Points[$X][$Y]=UNKNOWN; } } 
44 41
 
45 42
      $this->GridSizeX = $XSize;
@@ -47,8 +44,7 @@  discard block
 block discarded – undo
47 44
     }
48 45
 
49 46
    /* Add a point on the grid */
50
-   function addPoint($X,$Y,$Value,$Force=TRUE)
51
-    {
47
+   function addPoint($X,$Y,$Value,$Force=TRUE) {
52 48
      if ( $X < 0 || $X >$this->GridSizeX ) { return(0); }
53 49
      if ( $Y < 0 || $Y >$this->GridSizeY ) { return(0); }
54 50
 
@@ -61,8 +57,7 @@  discard block
 block discarded – undo
61 57
     }
62 58
 
63 59
    /* Write the X labels */
64
-   function writeXLabels($Format="")
65
-    {
60
+   function writeXLabels($Format="") {
66 61
      $R			= isset($Format["R"]) ? $Format["R"] : $this->pChartObject->FontColorR;
67 62
      $G			= isset($Format["G"]) ? $Format["G"] : $this->pChartObject->FontColorG;
68 63
      $B			= isset($Format["B"]) ? $Format["B"] : $this->pChartObject->FontColorB;
@@ -79,23 +74,18 @@  discard block
 block discarded – undo
79 74
      $XSize = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) / ($this->GridSizeX+1);
80 75
 
81 76
      $Settings = array("Angle"=>$Angle,"R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha);
82
-     if ( $Position == LABEL_POSITION_TOP )
83
-      {
77
+     if ( $Position == LABEL_POSITION_TOP ) {
84 78
        $YPos  = $this->pChartObject->GraphAreaY1 - $Padding;
85 79
        if ($Angle == 0 ) { $Settings["Align"] = TEXT_ALIGN_BOTTOMMIDDLE; }
86 80
        if ($Angle != 0 ) { $Settings["Align"] = TEXT_ALIGN_MIDDLELEFT; }
87
-      }
88
-     elseif ( $Position == LABEL_POSITION_BOTTOM )
89
-      {
81
+      } elseif ( $Position == LABEL_POSITION_BOTTOM ) {
90 82
        $YPos  = $this->pChartObject->GraphAreaY2 + $Padding;
91 83
        if ($Angle == 0 ) { $Settings["Align"] = TEXT_ALIGN_TOPMIDDLE; }
92 84
        if ($Angle != 0 ) { $Settings["Align"] = TEXT_ALIGN_MIDDLERIGHT; }
93
-      }
94
-     else
85
+      } else
95 86
       return(-1);
96 87
 
97
-     for($X=0;$X<=$this->GridSizeX;$X++)
98
-      {
88
+     for($X=0;$X<=$this->GridSizeX;$X++) {
99 89
        $XPos = floor($X0+$X*$XSize + $XSize/2);
100 90
 
101 91
        if( $Labels == NULL || !isset($Labels[$X]) )
@@ -108,8 +98,7 @@  discard block
 block discarded – undo
108 98
     }
109 99
 
110 100
    /* Write the Y labels */
111
-   function writeYLabels($Format="")
112
-    {
101
+   function writeYLabels($Format="") {
113 102
      $R			= isset($Format["R"]) ? $Format["R"] : $this->pChartObject->FontColorR;
114 103
      $G			= isset($Format["G"]) ? $Format["G"] : $this->pChartObject->FontColorG;
115 104
      $B			= isset($Format["B"]) ? $Format["B"] : $this->pChartObject->FontColorB;
@@ -127,14 +116,11 @@  discard block
 block discarded – undo
127 116
 
128 117
      $Settings = array("Angle"=>$Angle,"R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha);
129 118
      if ( $Position == LABEL_POSITION_LEFT )
130
-      { $XPos  = $this->pChartObject->GraphAreaX1 - $Padding; $Settings["Align"] = TEXT_ALIGN_MIDDLERIGHT; }
131
-     elseif ( $Position == LABEL_POSITION_RIGHT )
132
-      { $XPos  = $this->pChartObject->GraphAreaX2 + $Padding; $Settings["Align"] = TEXT_ALIGN_MIDDLELEFT; }
133
-     else
119
+      { $XPos  = $this->pChartObject->GraphAreaX1 - $Padding; $Settings["Align"] = TEXT_ALIGN_MIDDLERIGHT; } elseif ( $Position == LABEL_POSITION_RIGHT )
120
+      { $XPos  = $this->pChartObject->GraphAreaX2 + $Padding; $Settings["Align"] = TEXT_ALIGN_MIDDLELEFT; } else
134 121
       return(-1);
135 122
 
136
-     for($Y=0;$Y<=$this->GridSizeY;$Y++)
137
-      {
123
+     for($Y=0;$Y<=$this->GridSizeY;$Y++) {
138 124
        $YPos = floor($Y0+$Y*$YSize + $YSize/2);
139 125
 
140 126
        if( $Labels == NULL || !isset($Labels[$Y]) )
@@ -147,8 +133,7 @@  discard block
 block discarded – undo
147 133
     }
148 134
 
149 135
    /* Draw the area arround the specified Threshold */
150
-   function drawContour($Threshold,$Format="")
151
-    {
136
+   function drawContour($Threshold,$Format="") {
152 137
      $R		= isset($Format["R"]) ? $Format["R"] : 0;
153 138
      $G		= isset($Format["G"]) ? $Format["G"] : 0;
154 139
      $B		= isset($Format["B"]) ? $Format["B"] : 0;
@@ -163,14 +148,11 @@  discard block
 block discarded – undo
163 148
 
164 149
      $Color = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha,"Ticks"=>$Ticks);
165 150
 
166
-     for($X=0;$X<=$this->GridSizeX;$X++)
167
-      {
168
-       for($Y=0;$Y<=$this->GridSizeY;$Y++)
169
-        {
151
+     for($X=0;$X<=$this->GridSizeX;$X++) {
152
+       for($Y=0;$Y<=$this->GridSizeY;$Y++) {
170 153
          $Value = $this->Points[$X][$Y];
171 154
 
172
-         if ( $Value != UNKNOWN && $Value != IGNORED && $Value >= $Threshold)
173
-          {
155
+         if ( $Value != UNKNOWN && $Value != IGNORED && $Value >= $Threshold) {
174 156
            $X1 = floor($X0+$X*$XSize)+$Padding;
175 157
            $Y1 = floor($Y0+$Y*$YSize)+$Padding;
176 158
            $X2 = floor($X0+$X*$XSize+$XSize);
@@ -190,8 +172,7 @@  discard block
 block discarded – undo
190 172
     }
191 173
 
192 174
    /* Draw the surface chart */
193
-   function drawSurface($Format="")
194
-    {
175
+   function drawSurface($Format="") {
195 176
      $Palette		= isset($Format["Palette"]) ? $Format["Palette"] : NULL;
196 177
      $ShadeR1		= isset($Format["ShadeR1"]) ? $Format["ShadeR1"] : 77;
197 178
      $ShadeG1		= isset($Format["ShadeG1"]) ? $Format["ShadeG1"] : 205;
@@ -213,28 +194,22 @@  discard block
 block discarded – undo
213 194
      $XSize = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) / ($this->GridSizeX+1);
214 195
      $YSize = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) / ($this->GridSizeY+1);
215 196
 
216
-     for($X=0;$X<=$this->GridSizeX;$X++)
217
-      {
218
-       for($Y=0;$Y<=$this->GridSizeY;$Y++)
219
-        {
197
+     for($X=0;$X<=$this->GridSizeX;$X++) {
198
+       for($Y=0;$Y<=$this->GridSizeY;$Y++) {
220 199
          $Value = $this->Points[$X][$Y];
221 200
 
222
-         if ( $Value != UNKNOWN && $Value != IGNORED )
223
-          {
201
+         if ( $Value != UNKNOWN && $Value != IGNORED ) {
224 202
            $X1 = floor($X0+$X*$XSize)+$Padding;
225 203
            $Y1 = floor($Y0+$Y*$YSize)+$Padding;
226 204
            $X2 = floor($X0+$X*$XSize+$XSize);
227 205
            $Y2 = floor($Y0+$Y*$YSize+$YSize);
228 206
 
229
-           if ( $Palette != NULL )
230
-            {
207
+           if ( $Palette != NULL ) {
231 208
              if ( isset($Palette[$Value]) && isset($Palette[$Value]["R"]) ) { $R = $Palette[$Value]["R"]; } else { $R = 0; }
232 209
              if ( isset($Palette[$Value]) && isset($Palette[$Value]["G"]) ) { $G = $Palette[$Value]["G"]; } else { $G = 0; }
233 210
              if ( isset($Palette[$Value]) && isset($Palette[$Value]["B"]) ) { $B = $Palette[$Value]["B"]; } else { $B = 0; }
234 211
              if ( isset($Palette[$Value]) && isset($Palette[$Value]["Alpha"]) ) { $Alpha = $Palette[$Value]["Alpha"]; } else { $Alpha = 1000; }
235
-            }
236
-           else
237
-            {
212
+            } else {
238 213
              $R = (($ShadeR2-$ShadeR1)/100)*$Value + $ShadeR1;
239 214
              $G = (($ShadeG2-$ShadeG1)/100)*$Value + $ShadeG1;
240 215
              $B = (($ShadeB2-$ShadeB1)/100)*$Value + $ShadeB1;
@@ -252,36 +227,28 @@  discard block
 block discarded – undo
252 227
     }
253 228
 
254 229
    /* Compute the missing points */
255
-   function computeMissing()
256
-    {
230
+   function computeMissing() {
257 231
      $Missing = "";
258
-     for($X=0;$X<=$this->GridSizeX;$X++)
259
-      {
260
-       for($Y=0;$Y<=$this->GridSizeY;$Y++)
261
-        {
232
+     for($X=0;$X<=$this->GridSizeX;$X++) {
233
+       for($Y=0;$Y<=$this->GridSizeY;$Y++) {
262 234
          if ( $this->Points[$X][$Y] == UNKNOWN )
263 235
           $Missing[] = $X.",".$Y;
264 236
         }
265 237
       }
266 238
      shuffle($Missing);
267 239
      
268
-     foreach($Missing as $Key => $Pos)
269
-      {
240
+     foreach($Missing as $Key => $Pos) {
270 241
        $Pos = preg_split("/,/",$Pos);
271 242
        $X   = $Pos[0];
272 243
        $Y   = $Pos[1];
273 244
 
274
-       if ( $this->Points[$X][$Y] == UNKNOWN )
275
-        {
245
+       if ( $this->Points[$X][$Y] == UNKNOWN ) {
276 246
          $NearestNeighbor = $this->getNearestNeighbor($X,$Y);
277 247
 
278 248
          $Value = 0; $Points = 0;
279
-         for($Xi=$X-$NearestNeighbor;$Xi<=$X+$NearestNeighbor;$Xi++)
280
-          {
281
-           for($Yi=$Y-$NearestNeighbor;$Yi<=$Y+$NearestNeighbor;$Yi++)
282
-            {
283
-             if ($Xi >=0 && $Yi >= 0 && $Xi <= $this->GridSizeX && $Yi <= $this->GridSizeY && $this->Points[$Xi][$Yi] != UNKNOWN && $this->Points[$Xi][$Yi] != IGNORED)
284
-              {
249
+         for($Xi=$X-$NearestNeighbor;$Xi<=$X+$NearestNeighbor;$Xi++) {
250
+           for($Yi=$Y-$NearestNeighbor;$Yi<=$Y+$NearestNeighbor;$Yi++) {
251
+             if ($Xi >=0 && $Yi >= 0 && $Xi <= $this->GridSizeX && $Yi <= $this->GridSizeY && $this->Points[$Xi][$Yi] != UNKNOWN && $this->Points[$Xi][$Yi] != IGNORED) {
285 252
                $Value = $Value + $this->Points[$Xi][$Yi]; $Points++;
286 253
               }
287 254
             }
@@ -293,15 +260,11 @@  discard block
 block discarded – undo
293 260
     }
294 261
 
295 262
    /* Return the nearest Neighbor distance of a point */
296
-   function getNearestNeighbor($Xp,$Yp)
297
-    {
263
+   function getNearestNeighbor($Xp,$Yp) {
298 264
      $Nearest = UNKNOWN;
299
-     for($X=0;$X<=$this->GridSizeX;$X++)
300
-      {
301
-       for($Y=0;$Y<=$this->GridSizeY;$Y++)
302
-        {
303
-         if ( $this->Points[$X][$Y] != UNKNOWN && $this->Points[$X][$Y] != IGNORED )
304
-          {
265
+     for($X=0;$X<=$this->GridSizeX;$X++) {
266
+       for($Y=0;$Y<=$this->GridSizeY;$Y++) {
267
+         if ( $this->Points[$X][$Y] != UNKNOWN && $this->Points[$X][$Y] != IGNORED ) {
305 268
            $DistanceX = max($Xp,$X)-min($Xp,$X);
306 269
            $DistanceY = max($Yp,$Y)-min($Yp,$Y);
307 270
            $Distance  = max($DistanceX,$DistanceY);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     }
48 48
 
49 49
    /* Add a point on the grid */
50
-   function addPoint($X,$Y,$Value,$Force=TRUE)
50
+   function addPoint($X,$Y,$Value,$Force=true)
51 51
     {
52 52
      if ( $X < 0 || $X >$this->GridSizeX ) { return(0); }
53 53
      if ( $Y < 0 || $Y >$this->GridSizeY ) { return(0); }
@@ -70,10 +70,10 @@  discard block
 block discarded – undo
70 70
      $Angle		= isset($Format["Angle"]) ? $Format["Angle"] : 0;
71 71
      $Padding		= isset($Format["Padding"]) ? $Format["Padding"] : 5;
72 72
      $Position		= isset($Format["Position"]) ? $Format["Position"] : LABEL_POSITION_TOP;
73
-     $Labels		= isset($Format["Labels"]) ? $Format["Labels"] : NULL;
73
+     $Labels		= isset($Format["Labels"]) ? $Format["Labels"] : null;
74 74
      $CountOffset	= isset($Format["CountOffset"]) ? $Format["CountOffset"] : 0;
75 75
 
76
-     if ( $Labels != NULL && !is_array($Labels) ) { $Label = $Labels; $Labels = ""; $Labels[] = $Label; }
76
+     if ( $Labels != null && !is_array($Labels) ) { $Label = $Labels; $Labels = ""; $Labels[] = $Label; }
77 77
 
78 78
      $X0    = $this->pChartObject->GraphAreaX1;
79 79
      $XSize = ($this->pChartObject->GraphAreaX2 - $this->pChartObject->GraphAreaX1) / ($this->GridSizeX+1);
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
       {
99 99
        $XPos = floor($X0+$X*$XSize + $XSize/2);
100 100
 
101
-       if( $Labels == NULL || !isset($Labels[$X]) )
101
+       if( $Labels == null || !isset($Labels[$X]) )
102 102
         $Value = $X+$CountOffset;
103 103
        else
104 104
         $Value = $Labels[$X];
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
      $Angle		= isset($Format["Angle"]) ? $Format["Angle"] : 0;
118 118
      $Padding		= isset($Format["Padding"]) ? $Format["Padding"] : 5;
119 119
      $Position		= isset($Format["Position"]) ? $Format["Position"] : LABEL_POSITION_LEFT;
120
-     $Labels		= isset($Format["Labels"]) ? $Format["Labels"] : NULL;
120
+     $Labels		= isset($Format["Labels"]) ? $Format["Labels"] : null;
121 121
      $CountOffset	= isset($Format["CountOffset"]) ? $Format["CountOffset"] : 0;
122 122
 
123
-     if ( $Labels != NULL && !is_array($Labels) ) { $Label = $Labels; $Labels = ""; $Labels[] = $Label; }
123
+     if ( $Labels != null && !is_array($Labels) ) { $Label = $Labels; $Labels = ""; $Labels[] = $Label; }
124 124
 
125 125
      $Y0    = $this->pChartObject->GraphAreaY1;
126 126
      $YSize = ($this->pChartObject->GraphAreaY2 - $this->pChartObject->GraphAreaY1) / ($this->GridSizeY+1);
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
       {
138 138
        $YPos = floor($Y0+$Y*$YSize + $YSize/2);
139 139
 
140
-       if( $Labels == NULL || !isset($Labels[$Y]) )
140
+       if( $Labels == null || !isset($Labels[$Y]) )
141 141
         $Value = $Y+$CountOffset;
142 142
        else
143 143
         $Value = $Labels[$Y];
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
    /* Draw the surface chart */
193 193
    function drawSurface($Format="")
194 194
     {
195
-     $Palette		= isset($Format["Palette"]) ? $Format["Palette"] : NULL;
195
+     $Palette		= isset($Format["Palette"]) ? $Format["Palette"] : null;
196 196
      $ShadeR1		= isset($Format["ShadeR1"]) ? $Format["ShadeR1"] : 77;
197 197
      $ShadeG1		= isset($Format["ShadeG1"]) ? $Format["ShadeG1"] : 205;
198 198
      $ShadeB1		= isset($Format["ShadeB1"]) ? $Format["ShadeB1"] : 21;
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
      $ShadeG2		= isset($Format["ShadeG2"]) ? $Format["ShadeG2"] : 135;
202 202
      $ShadeB2		= isset($Format["ShadeB2"]) ? $Format["ShadeB2"] : 61;
203 203
      $ShadeA2		= isset($Format["ShadeA2"]) ? $Format["ShadeA2"] : 100;
204
-     $Border		= isset($Format["Border"]) ? $Format["Border"] : FALSE;
204
+     $Border		= isset($Format["Border"]) ? $Format["Border"] : false;
205 205
      $BorderR		= isset($Format["BorderR"]) ? $Format["BorderR"] : 0;
206 206
      $BorderG		= isset($Format["BorderG"]) ? $Format["BorderG"] : 0;
207 207
      $BorderB		= isset($Format["BorderB"]) ? $Format["BorderB"] : 0;
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
            $X2 = floor($X0+$X*$XSize+$XSize);
227 227
            $Y2 = floor($Y0+$Y*$YSize+$YSize);
228 228
 
229
-           if ( $Palette != NULL )
229
+           if ( $Palette != null )
230 230
             {
231 231
              if ( isset($Palette[$Value]) && isset($Palette[$Value]["R"]) ) { $R = $Palette[$Value]["R"]; } else { $R = 0; }
232 232
              if ( isset($Palette[$Value]) && isset($Palette[$Value]["G"]) ) { $G = $Palette[$Value]["G"]; } else { $G = 0; }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincstats/boincstats.admin.inc 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -8,38 +8,38 @@  discard block
 block discarded – undo
8 8
 
9 9
 
10 10
 /**
11
-  * The BOINC stats configuration determines where statistics are sourced
12
-  */
11
+ * The BOINC stats configuration determines where statistics are sourced
12
+ */
13 13
 function boincstats_admin_stats_system(&$form_state) {
14
-  $form = array();
15
-  $default = array(
14
+    $form = array();
15
+    $default = array(
16 16
     'boinc_stats_server' => variable_get('boinc_stats_server', 'stats.gridrepublic.org'),
17 17
     'boinc_stats_project_list_rpc' => variable_get('boinc_stats_project_list_rpc', 'rpc/get_projects.php'),
18 18
     'boinc_stats_project_credit_history_rpc' => variable_get('boinc_stats_project_credit_history_rpc', 'rpc/get_project_tc_history.php'),
19 19
     'boinc_stats_user_credit_history_rpc' => variable_get('boinc_stats_user_credit_history_rpc', 'rpc/get_user_credit_history_by_project.php'),
20 20
     'boinc_stats_remote_project_id' => variable_get('boinc_stats_remote_project_id', ''),
21
-  );
22
-  // Define the form
23
-  $form['boinc_stats_server'] = array(
21
+    );
22
+    // Define the form
23
+    $form['boinc_stats_server'] = array(
24 24
     '#type' => 'value',
25 25
     '#value' => $default['boinc_stats_server']
26
-  );
27
-  $form['boinc_stats_project_list_rpc'] = array(
26
+    );
27
+    $form['boinc_stats_project_list_rpc'] = array(
28 28
     '#type' => 'value',
29 29
     '#value' => $default['boinc_stats_project_list_rpc']
30
-  );
31
-  $form['boinc_stats_project_credit_history_rpc'] = array(
30
+    );
31
+    $form['boinc_stats_project_credit_history_rpc'] = array(
32 32
     '#type' => 'value',
33 33
     '#value' => $default['boinc_stats_project_credit_history_rpc']
34
-  );
35
-  $form['boinc_stats_user_credit_history_rpc'] = array(
34
+    );
35
+    $form['boinc_stats_user_credit_history_rpc'] = array(
36 36
     '#type' => 'value',
37 37
     '#value' => $default['boinc_stats_user_credit_history_rpc']
38
-  );
39
-  $form['boinc_stats_remote_project_id'] = array(
38
+    );
39
+    $form['boinc_stats_remote_project_id'] = array(
40 40
     '#type' => 'textfield',
41 41
     '#title' => t('Stats ID for @project', array(
42
-      '@project' => variable_get('site_name', t('this project')))),
42
+        '@project' => variable_get('site_name', t('this project')))),
43 43
     '#default_value' => $default['boinc_stats_remote_project_id'], 
44 44
     '#description' => t('This project must be registered with a stats system in
45 45
       order for some statistics to be available. Currently only one system is
@@ -47,26 +47,26 @@  discard block
 block discarded – undo
47 47
         '!find_project_id' => l(t('Find your project ID'),
48 48
         "http://{$default['boinc_stats_server']}/{$default['boinc_stats_project_list_rpc']}",
49 49
         array('attributes' => array('target' => 'external')))
50
-      )
50
+        )
51 51
     )
52
-  );
53
-  return system_settings_form($form);
52
+    );
53
+    return system_settings_form($form);
54 54
 }
55 55
 
56 56
 /**
57
-  * Validate the BOINC stats form.
58
-  */
57
+ * Validate the BOINC stats form.
58
+ */
59 59
 function boincstats_admin_stats_system_validate($form, &$form_state) {
60
-  $values = $form_state['values'];
61
-  if (!$values['boinc_stats_remote_project_id']) {
60
+    $values = $form_state['values'];
61
+    if (!$values['boinc_stats_remote_project_id']) {
62 62
     form_set_error('boinc_stats_remote_project_id',
63
-      t('Stats may not work without a valid stats ID configured!'));
64
-  }
63
+        t('Stats may not work without a valid stats ID configured!'));
64
+    }
65 65
 }
66 66
 
67 67
 /**
68
-  * Handle post-validation submission of BOINC stats form.
69
-  */
68
+ * Handle post-validation submission of BOINC stats form.
69
+ */
70 70
 function boincstats_admin_stats_system_submit($form, &$form_state) {
71
-  drupal_set_message(t('Stats system configuration has been updated.'));
71
+    drupal_set_message(t('Stats system configuration has been updated.'));
72 72
 }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincteam/includes/boincteam.forms.inc 4 patches
Indentation   +234 added lines, -234 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@  discard block
 block discarded – undo
14 14
  * The definition of the create team form
15 15
  */
16 16
 function boincteam_create_form(&$form_state) {
17
-  $form = array();
17
+    $form = array();
18 18
   
19
-  $default = array(
19
+    $default = array(
20 20
     'name' => '',
21 21
     'name_html' => '',
22 22
     'website' => '',
@@ -24,105 +24,105 @@  discard block
 block discarded – undo
24 24
     'country' => 0,
25 25
     'joinable' => TRUE,
26 26
     'description' => '',
27
-  );
27
+    );
28 28
   
29
-  // Standard option sets
30
-  $form['boolean_options'] = array(
29
+    // Standard option sets
30
+    $form['boolean_options'] = array(
31 31
     '#type' => 'value',
32 32
     '#value' => array(1 => bts('yes'), 0 => bts('no')),
33
-  );
33
+    );
34 34
   
35
-  // Vocabulary based option sets
36
-  $form['type_options'] = array(
35
+    // Vocabulary based option sets
36
+    $form['type_options'] = array(
37 37
     '#type' => 'value',
38 38
     '#value' => array(0 => bts('Choose type'))
39
-  );
40
-  $vocabs = taxonomy_get_vocabularies(NULL);
41
-  foreach ($vocabs as $vocab) {
39
+    );
40
+    $vocabs = taxonomy_get_vocabularies(NULL);
41
+    foreach ($vocabs as $vocab) {
42 42
     switch ($vocab->name) {
43 43
     case 'Teams':
44 44
       $team_types = taxonomy_get_tree($vocab->vid);
45
-      if (module_exists('internationalization')) {
45
+        if (module_exists('internationalization')) {
46 46
         $team_types = i18ntaxonomy_localize_terms($team_types);
47
-      }
48
-      foreach ($team_types as $team_type) {
47
+        }
48
+        foreach ($team_types as $team_type) {
49 49
         $form['type_options']['#value'][$team_type->tid] = $team_type->name;
50
-      }
51
-      break;
50
+        }
51
+        break;
52 52
     default:
53 53
     }
54
-  }
55
-  $form['country_options'] = array(
54
+    }
55
+    $form['country_options'] = array(
56 56
     '#type' => 'value',
57 57
     '#value' => boinccore_get_country_list(),
58
-  );
58
+    );
59 59
   
60
-  // Form elements
61
-  $form['name'] = array(
60
+    // Form elements
61
+    $form['name'] = array(
62 62
     '#title' => bts('Team name'),
63 63
     '#type' => 'textfield',
64 64
     '#default_value' => $default['name'],
65 65
     '#size' => 34,
66 66
     '#description' => bts('Text only, no HTML tags'),
67
-  );
68
-  $form['name_html'] = array(
67
+    );
68
+    $form['name_html'] = array(
69 69
     '#title' => bts('Team name -- HTML version (optional)'),
70 70
     '#type' => 'textfield',
71 71
     '#default_value' => $default['name_html'],
72 72
     '#size' => 34,
73 73
     '#description' => bts('You may use limited HTML tags'),
74
-  );
75
-  $form['website'] = array(
74
+    );
75
+    $form['website'] = array(
76 76
     '#title' => bts('Team website (optional)'),
77 77
     '#type' => 'textfield',
78 78
     '#default_value' => $default['website'],
79 79
     '#size' => 34,
80 80
     '#description' => bts("Displayed on the team's page"),
81
-  );
82
-  $form['type'] = array(
81
+    );
82
+    $form['type'] = array(
83 83
     '#title' => bts('Type of team'),
84 84
     '#type' => 'select',
85 85
     '#options' => $form['type_options']['#value'],
86 86
     '#default_value' => $default['type'],
87
-  );
88
-  $form['country'] = array(
87
+    );
88
+    $form['country'] = array(
89 89
     '#title' => bts('Country'),
90 90
     '#type' => 'select',
91 91
     '#options' => $form['country_options']['#value'],
92 92
     '#default_value' => $default['country'],
93
-  );
94
-  $form['joinable'] = array(
93
+    );
94
+    $form['joinable'] = array(
95 95
     '#title' => bts('Accept new members?'),
96 96
     '#type' => 'radios',
97 97
     '#options' => $form['boolean_options']['#value'],
98 98
     '#attributes' => array('class' => 'fancy'),
99 99
     '#default_value' => $default['joinable'],
100 100
     '#size' => 34,
101
-  );
102
-  $form['description'] = array(
101
+    );
102
+    $form['description'] = array(
103 103
     '#title' => bts('Description of team'),
104 104
     '#type' => 'textarea',
105 105
     '#default_value' => $default['description'],
106 106
     '#size' => 5,
107 107
     '#description' => NULL,
108
-  );
109
-  $form['format'] = filter_form();
108
+    );
109
+    $form['format'] = filter_form();
110 110
   
111
-  // Form control
112
-  $form['form control tabs prefix'] = array(
111
+    // Form control
112
+    $form['form control tabs prefix'] = array(
113 113
     '#value' => '<ul class="form-control tab-list">'
114
-  );
115
-  $form['submit'] = array(
114
+    );
115
+    $form['submit'] = array(
116 116
     '#prefix' => '<li class="first tab">',
117 117
     '#type' => 'submit',
118 118
     '#value' => bts('Save team'),
119 119
     '#suffix' => '</li>',
120
-  );
121
-  $form['form control tabs'] = array(
120
+    );
121
+    $form['form control tabs'] = array(
122 122
     '#value' => '<li class="tab">' . l(bts('Cancel'), $_GET['q']) . '</li>'
123
-  );
123
+    );
124 124
   
125
-  return $form;
125
+    return $form;
126 126
 }
127 127
 
128 128
 /**
@@ -130,41 +130,41 @@  discard block
 block discarded – undo
130 130
  */
131 131
 function boincteam_create_form_validate($form, &$form_state) {
132 132
 
133
-  $values = $form_state['values'];
134
-  $name = $values['name'];
133
+    $values = $form_state['values'];
134
+    $name = $values['name'];
135 135
   
136
-  if (!$name) {
136
+    if (!$name) {
137 137
     form_set_error('name', bts('Team name is required.'));
138
-  }
139
-  else {
138
+    }
139
+    else {
140 140
     require_boinc('boinc_db');
141 141
     if (BoincTeam::lookup_name($name)) {
142
-      form_set_error('name', bts('A team named "@name" already exists.',
142
+        form_set_error('name', bts('A team named "@name" already exists.',
143 143
         array('@name' => $name)));
144 144
     }
145
-  }
145
+    }
146 146
   
147
-  if (!$values['type'] OR !isset($values['type_options'][$values['type']])) {
147
+    if (!$values['type'] OR !isset($values['type_options'][$values['type']])) {
148 148
     form_set_error('type', bts('Please select a team type.'));
149
-  }
149
+    }
150 150
 }
151 151
 
152 152
 /**
153 153
  * The create team submit handler
154 154
  */
155 155
 function boincteam_create_form_submit($form, &$form_state) {
156
-  global $user;
157
-  $account = user_load($user->uid);
158
-  $values = $form_state['values'];
159
-  //drupal_set_message('<pre>' . print_r($values,true) . '</pre>');
156
+    global $user;
157
+    $account = user_load($user->uid);
158
+    $values = $form_state['values'];
159
+    //drupal_set_message('<pre>' . print_r($values,true) . '</pre>');
160 160
   
161
-  $input_format = !empty($values['format']) ? $values['format'] : 4;
162
-  $values['description'] = check_markup($values['description'], $input_format);
161
+    $input_format = !empty($values['format']) ? $values['format'] : 4;
162
+    $values['description'] = check_markup($values['description'], $input_format);
163 163
   
164
-  // Create the team in the BOINC db
164
+    // Create the team in the BOINC db
165 165
   
166
-  require_boinc(array('user','team'));
167
-  $boinc_team = make_team(
166
+    require_boinc(array('user','team'));
167
+    $boinc_team = make_team(
168 168
     $account->boincuser_id,
169 169
     $values['name'],
170 170
     $values['website'],
@@ -172,27 +172,27 @@  discard block
 block discarded – undo
172 172
     $values['name_html'],
173 173
     $values['description'],
174 174
     $values['country']
175
-  );
175
+    );
176 176
 
177
-  if ($boinc_team) {
177
+    if ($boinc_team) {
178 178
     $boinc_user = BoincUser::lookup_id($account->boincuser_id);
179 179
     user_join_team($boinc_team, $boinc_user);
180
-  }
181
-  else {
180
+    }
181
+    else {
182 182
     drupal_set_message(t('Teams cannot be created at this time. Please 
183 183
       contact the @project administrators!', array('@project' => PROJECT)));
184 184
     watchdog('BOINC team', 'BOINC teams cannot be created for an unknown
185 185
       reason.', 'error');
186 186
     return FALSE;
187
-  }
187
+    }
188 188
   
189
-  // Create the team node in Drupal
189
+    // Create the team node in Drupal
190 190
   
191
-  $teaser = node_teaser($values['description']);
192
-  $created_time = time();
193
-  $input_format = variable_get('filter_default_format', 1);
191
+    $teaser = node_teaser($values['description']);
192
+    $created_time = time();
193
+    $input_format = variable_get('filter_default_format', 1);
194 194
   
195
-  $node = array(
195
+    $node = array(
196 196
     'type' => 'team',
197 197
     'title' => $values['name'],
198 198
     'body' => $values['description'],
@@ -206,21 +206,21 @@  discard block
 block discarded – undo
206 206
     'moderate' => 0,
207 207
     'sticky' => 0,
208 208
     'format' => $input_format
209
-  );
209
+    );
210 210
   
211
-  // Use pathauto function, if available, to clean up the path
212
-  if (module_exists('pathauto')) {
211
+    // Use pathauto function, if available, to clean up the path
212
+    if (module_exists('pathauto')) {
213 213
     module_load_include('inc', 'pathauto', 'pathauto');
214 214
     $node['path'] = pathauto_cleanstring($values['name']);
215
-  }
216
-  else {
215
+    }
216
+    else {
217 217
     drupal_set_message(t('Teams cannot be created at this time. Please 
218 218
       contact the @project administrators!', array('@project' => PROJECT)));
219 219
     watchdog('BOINC team', 'BOINC teams require the Pathauto module. Teams
220 220
       cannot be created.', 'error');
221
-  }
221
+    }
222 222
   
223
-  /*
223
+    /*
224 224
   // Add special organic group properties
225 225
   $node['og_description'] = strip_tags($boincteam->description);
226 226
   $node['og_selective'] = OG_OPEN;
@@ -229,26 +229,26 @@  discard block
 block discarded – undo
229 229
   $node['og_private'] = 0;
230 230
   */
231 231
   
232
-  $node = (object) $node; // node_save requires an object form
232
+    $node = (object) $node; // node_save requires an object form
233 233
   
234
-  /*
234
+    /*
235 235
   $node->field_description[]['value'] = $boincteam->description;
236 236
   $node->field_url[]['value'] = $boincteam->url;
237 237
   $node->field_country[]['value'] = $boincteam->country;
238 238
   */
239 239
   
240
-  $node->taxonomy[] = taxonomy_get_term($values['type']);
240
+    $node->taxonomy[] = taxonomy_get_term($values['type']);
241 241
   
242
-  // Save the team node
243
-  node_save($node);
242
+    // Save the team node
243
+    node_save($node);
244 244
   
245
-  // Save the team IDs to a BOINC <--> Drupal reference table.
246
-  db_query('INSERT INTO {boincteam} (team_id, nid) VALUES (%d, %d)', $boinc_team->id, $node->nid);
245
+    // Save the team IDs to a BOINC <--> Drupal reference table.
246
+    db_query('INSERT INTO {boincteam} (team_id, nid) VALUES (%d, %d)', $boinc_team->id, $node->nid);
247 247
   
248
-  drupal_set_message(t('Team "@name" has been created.', 
248
+    drupal_set_message(t('Team "@name" has been created.', 
249 249
     array('@name' => $values['name'])));
250 250
   
251
-  $form_state['redirect'] = "community/teams/{$node->nid}";
251
+    $form_state['redirect'] = "community/teams/{$node->nid}";
252 252
 }
253 253
 
254 254
 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
@@ -259,17 +259,17 @@  discard block
 block discarded – undo
259 259
  * The definition of the edit team form
260 260
  */
261 261
 function boincteam_edit_form(&$form_state, $team_id) {
262
-  $form = array();
262
+    $form = array();
263 263
   
264
-  $team = node_load($team_id);
265
-  $boincteam = boincteam_load(boincteam_lookup_id($team_id));
264
+    $team = node_load($team_id);
265
+    $boincteam = boincteam_load(boincteam_lookup_id($team_id));
266 266
   
267
-  $is_boinc_wide = ($boincteam->seti_id > 0) ? TRUE : FALSE;
267
+    $is_boinc_wide = ($boincteam->seti_id > 0) ? TRUE : FALSE;
268 268
   
269
-  $form_state['storage']['team_id'] = $team_id;
270
-  $form_state['storage']['is_boinc_wide'] = $is_boinc_wide;
269
+    $form_state['storage']['team_id'] = $team_id;
270
+    $form_state['storage']['is_boinc_wide'] = $is_boinc_wide;
271 271
   
272
-  $default = array(
272
+    $default = array(
273 273
     'name' => $boincteam->name,
274 274
     'name_html' => $boincteam->name_html,
275 275
     'website' => $boincteam->url,
@@ -277,79 +277,79 @@  discard block
 block discarded – undo
277 277
     'country' => $boincteam->country,
278 278
     'joinable' => $boincteam->joinable,
279 279
     'description' => $boincteam->description,
280
-  );
280
+    );
281 281
   
282
-  // Standard option sets
283
-  $form['boolean_options'] = array(
282
+    // Standard option sets
283
+    $form['boolean_options'] = array(
284 284
     '#type' => 'value',
285 285
     '#value' => array(1 => bts('yes'), 0 => bts('no')),
286
-  );
286
+    );
287 287
   
288
-  // Vocabulary based option sets
289
-  $form['type_options'] = array(
288
+    // Vocabulary based option sets
289
+    $form['type_options'] = array(
290 290
     '#type' => 'value',
291 291
     '#value' => array(0 => bts('Choose type'))
292
-  );
293
-  $vocabs = taxonomy_get_vocabularies(NULL);
294
-  foreach ($vocabs as $vocab) {
292
+    );
293
+    $vocabs = taxonomy_get_vocabularies(NULL);
294
+    foreach ($vocabs as $vocab) {
295 295
     switch ($vocab->name) {
296 296
     case 'Teams':
297 297
       $team_types = taxonomy_get_tree($vocab->vid);
298
-      if (module_exists('internationalization')) {
298
+        if (module_exists('internationalization')) {
299 299
         $team_types = i18ntaxonomy_localize_terms($team_types);
300
-      }
301
-      foreach ($team_types as $team_type) {
300
+        }
301
+        foreach ($team_types as $team_type) {
302 302
         $form['type_options']['#value'][$team_type->tid] = $team_type->name;
303
-      }
304
-      break;
303
+        }
304
+        break;
305 305
     default:
306 306
     }
307
-  }
308
-  $form['country_options'] = array(
307
+    }
308
+    $form['country_options'] = array(
309 309
     '#type' => 'value',
310 310
     '#value' => boinccore_get_country_list(),
311
-  );
311
+    );
312 312
   
313
-  // Form elements
314
-  $form['name'] = array(
313
+    // Form elements
314
+    $form['name'] = array(
315 315
     '#title' => bts('Team name'),
316 316
     '#type' => 'textfield',
317 317
     '#default_value' => $default['name'],
318 318
     '#size' => 34,
319 319
     '#description' => bts('Text only, no HTML tags'),
320 320
     '#disabled' => $is_boinc_wide,
321
-  );
322
-  $form['name_html'] = array(
321
+    );
322
+    $form['name_html'] = array(
323 323
     '#title' => bts('Team name -- HTML version (optional)'),
324 324
     '#type' => 'textfield',
325 325
     '#default_value' => $default['name_html'],
326 326
     '#size' => 34,
327 327
     '#description' => bts('You may use limited HTML tags'),
328 328
     '#disabled' => $is_boinc_wide,
329
-  );
330
-  $form['website'] = array(
329
+    );
330
+    $form['website'] = array(
331 331
     '#title' => bts('Team website (optional)'),
332 332
     '#type' => 'textfield',
333 333
     '#default_value' => $default['website'],
334 334
     '#size' => 34,
335 335
     '#description' => bts("Displayed on the team's page"),
336 336
     '#disabled' => $is_boinc_wide,
337
-  );
338
-  $form['type'] = array(
337
+    );
338
+    $form['type'] = array(
339 339
     '#title' => bts('Type of team'),
340 340
     '#type' => 'select',
341 341
     '#options' => $form['type_options']['#value'],
342 342
     '#default_value' => $default['type'],
343 343
     '#disabled' => $is_boinc_wide,
344
-  );
345
-  $form['country'] = array(
344
+    );
345
+    $form['country'] = array(
346 346
     '#title' => bts('Country'),
347 347
     '#type' => 'select',
348 348
     '#options' => $form['country_options']['#value'],
349 349
     '#default_value' => $default['country'],
350 350
     '#disabled' => $is_boinc_wide,
351
-  );
352
-  $form['joinable'] = array(
351
+    );
352
+    $form['joinable'] = array(
353 353
     '#title' => bts('Accept new members?'),
354 354
     '#type' => 'radios',
355 355
     '#options' => $form['boolean_options']['#value'],
@@ -357,49 +357,49 @@  discard block
 block discarded – undo
357 357
     '#default_value' => $default['joinable'],
358 358
     '#size' => 34,
359 359
     '#disabled' => $is_boinc_wide,
360
-  );
361
-  if (!$is_boinc_wide) {
360
+    );
361
+    if (!$is_boinc_wide) {
362 362
     $form['description'] = array(
363
-      '#title' => bts('Description of team'),
364
-      '#type' => 'textarea',
365
-      '#default_value' => $default['description'],
366
-      '#size' => 5,
367
-      '#description' => NULL,
363
+        '#title' => bts('Description of team'),
364
+        '#type' => 'textarea',
365
+        '#default_value' => $default['description'],
366
+        '#size' => 5,
367
+        '#description' => NULL,
368 368
     );
369 369
     $form['format'] = filter_form();
370 370
     
371 371
     // Form control
372 372
     $form['form control tabs prefix'] = array(
373
-      '#value' => '<ul class="form-control tab-list">'
373
+        '#value' => '<ul class="form-control tab-list">'
374 374
     );
375 375
     $form['submit'] = array(
376
-      '#prefix' => '<li class="first tab">',
377
-      '#type' => 'submit',
378
-      '#value' => bts('Save changes'),
379
-      '#suffix' => '</li>',
376
+        '#prefix' => '<li class="first tab">',
377
+        '#type' => 'submit',
378
+        '#value' => bts('Save changes'),
379
+        '#suffix' => '</li>',
380 380
     );
381 381
     $form['form control tabs'] = array(
382
-      '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/edit', TRUE)) . '</li>'
382
+        '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/edit', TRUE)) . '</li>'
383 383
     );
384
-  }
385
-  else {
384
+    }
385
+    else {
386 386
     $form['description'] = array(
387
-      '#prefix' => '<div class="form-item"><label>' . bts('Description') . ':</label></div><div class="form-item">',
388
-      '#value' => $default['description'],
389
-      '#suffix' => '</div>',
387
+        '#prefix' => '<div class="form-item"><label>' . bts('Description') . ':</label></div><div class="form-item">',
388
+        '#value' => $default['description'],
389
+        '#suffix' => '</div>',
390 390
     );
391 391
     drupal_set_message(
392
-      bts('This is a BOINC-wide team. Changes can be made at the !site.',
392
+        bts('This is a BOINC-wide team. Changes can be made at the !site.',
393 393
         array('!site' => l(bts('BOINC-wide teams site'),
394
-          'http://boinc.berkeley.edu/teams/'
394
+            'http://boinc.berkeley.edu/teams/'
395 395
         ))
396
-      ),
397
-      'warning');
398
-  }
396
+        ),
397
+        'warning');
398
+    }
399 399
   
400
-  $form['#redirect'] = "community/teams/{$team_id}";
400
+    $form['#redirect'] = "community/teams/{$team_id}";
401 401
   
402
-  return $form;
402
+    return $form;
403 403
 }
404 404
 
405 405
 /**
@@ -407,32 +407,32 @@  discard block
 block discarded – undo
407 407
  */
408 408
 function boincteam_edit_form_validate($form, &$form_state) {
409 409
 
410
-  $values = $form_state['values'];
411
-  $name = $values['name'];
410
+    $values = $form_state['values'];
411
+    $name = $values['name'];
412 412
   
413
-  if ($form_state['storage']['is_boinc_wide']) {
413
+    if ($form_state['storage']['is_boinc_wide']) {
414 414
     form_set_error('none', bts('This team is managed by the BOINC-wide teams system and cannot be updated here.'));
415
-  }
416
-  else {
415
+    }
416
+    else {
417 417
     if (!$name) {
418
-      form_set_error('name', bts('Team name is required.'));
418
+        form_set_error('name', bts('Team name is required.'));
419 419
     }
420 420
     else {
421
-      $team = node_load($form_state['storage']['team_id']);
422
-      if ($name != $team->title) {
421
+        $team = node_load($form_state['storage']['team_id']);
422
+        if ($name != $team->title) {
423 423
         // If changing the name ("title" in Drupal terms), check that the new name is available
424 424
         require_boinc('boinc_db');
425 425
         if (BoincTeam::lookup_name($name)) {
426
-          form_set_error('name', bts('A team named "@name" already exists.',
426
+            form_set_error('name', bts('A team named "@name" already exists.',
427 427
             array('@name' => $name)));
428 428
         }
429
-      }
429
+        }
430 430
     }
431 431
   
432 432
     if (!$values['type'] OR !isset($values['type_options'][$values['type']])) {
433
-      form_set_error('type', bts('Please select a team type.'));
433
+        form_set_error('type', bts('Please select a team type.'));
434
+    }
434 435
     }
435
-  }
436 436
 }
437 437
 
438 438
 /**
@@ -440,18 +440,18 @@  discard block
 block discarded – undo
440 440
  */
441 441
 function boincteam_edit_form_submit($form, &$form_state) {
442 442
   
443
-  $team_id = $form_state['storage']['team_id'];
444
-  $values = $form_state['values'];
443
+    $team_id = $form_state['storage']['team_id'];
444
+    $values = $form_state['values'];
445 445
   
446
-  $team = node_load($team_id);
447
-  $boincteam_id = boincteam_lookup_id($team_id);
446
+    $team = node_load($team_id);
447
+    $boincteam_id = boincteam_lookup_id($team_id);
448 448
   
449
-  $input_format = !empty($values['format']) ? $values['format'] : 4;
450
-  $values['description'] = check_markup($values['description'], $input_format);
449
+    $input_format = !empty($values['format']) ? $values['format'] : 4;
450
+    $values['description'] = check_markup($values['description'], $input_format);
451 451
   
452
-  // Update the team in the BOINC db
453
-  db_set_active('boinc');
454
-  db_query("
452
+    // Update the team in the BOINC db
453
+    db_set_active('boinc');
454
+    db_query("
455 455
     UPDATE {team} SET
456 456
       name = '%s',
457 457
       name_lc = '%s',
@@ -471,32 +471,32 @@  discard block
 block discarded – undo
471 471
     $values['country'],
472 472
     $values['joinable'],
473 473
     $boincteam_id
474
-  );
475
-  db_set_active('default');
474
+    );
475
+    db_set_active('default');
476 476
   
477
-  // Update the team node in Drupal
477
+    // Update the team node in Drupal
478 478
   
479
-  $team->title = $values['name'];
480
-  $team->body = $values['description'];
481
-  $team->teaser = node_teaser($values['description']);
479
+    $team->title = $values['name'];
480
+    $team->body = $values['description'];
481
+    $team->teaser = node_teaser($values['description']);
482 482
   
483
-  /*
483
+    /*
484 484
   $node->field_description[]['value'] = $boincteam->description;
485 485
   $node->field_url[]['value'] = $boincteam->url;
486 486
   $node->field_country[]['value'] = $boincteam->country;
487 487
   */
488 488
   
489
-  // Replace any existing taxonomy with the new one
490
-  $team->taxonomy = array(taxonomy_get_term($values['type']));
489
+    // Replace any existing taxonomy with the new one
490
+    $team->taxonomy = array(taxonomy_get_term($values['type']));
491 491
   
492
-  // Save the team node
493
-  node_save($team);
492
+    // Save the team node
493
+    node_save($team);
494 494
   
495
-  drupal_set_message(t('Details for "@team" have been updated.', 
495
+    drupal_set_message(t('Details for "@team" have been updated.', 
496 496
     array('@team' => $values['name'])));
497 497
     
498
-  // The storage variable quietly kills redirection for some reason... unset it
499
-  unset($form_state['storage']);
498
+    // The storage variable quietly kills redirection for some reason... unset it
499
+    unset($form_state['storage']);
500 500
 }
501 501
 
502 502
 
@@ -508,42 +508,42 @@  discard block
 block discarded – undo
508 508
  * The definition of the add team admin form
509 509
  */
510 510
 function boincteam_add_admin_form(&$form_state, $team_id) {
511
-  $form = array();
511
+    $form = array();
512 512
   
513
-  $team = node_load($team_id);
514
-  $boincteam = boincteam_load(boincteam_lookup_id($team_id));
513
+    $team = node_load($team_id);
514
+    $boincteam = boincteam_load(boincteam_lookup_id($team_id));
515 515
   
516
-  $form_state['storage']['team_id'] = $team_id;
516
+    $form_state['storage']['team_id'] = $team_id;
517 517
   
518
-  $default = array(
518
+    $default = array(
519 519
     'email' => '',
520
-  );
520
+    );
521 521
   
522
-  // Form elements
523
-  $form['email'] = array(
522
+    // Form elements
523
+    $form['email'] = array(
524 524
     '#title' => bts('Enter email address'),
525 525
     '#type' => 'textfield',
526 526
     '#default_value' => $default['email'],
527 527
     '#size' => 34,
528
-  );
528
+    );
529 529
   
530
-  // Form control
531
-  $form['form control tabs prefix'] = array(
530
+    // Form control
531
+    $form['form control tabs prefix'] = array(
532 532
     '#value' => '<ul class="form-control tab-list">'
533
-  );
534
-  $form['submit'] = array(
533
+    );
534
+    $form['submit'] = array(
535 535
     '#prefix' => '<li class="first tab">',
536 536
     '#type' => 'submit',
537 537
     '#value' => bts('Add'),
538 538
     '#suffix' => '</li>',
539
-  );
540
-  $form['form control tabs'] = array(
539
+    );
540
+    $form['form control tabs'] = array(
541 541
     '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/edit', TRUE)) . '</li>'
542
-  );
542
+    );
543 543
   
544
-  //$form['#redirect'] = "community/teams/{$team_id}";
544
+    //$form['#redirect'] = "community/teams/{$team_id}";
545 545
   
546
-  return $form;
546
+    return $form;
547 547
 }
548 548
 
549 549
 /**
@@ -551,40 +551,40 @@  discard block
 block discarded – undo
551 551
  */
552 552
 function boincteam_add_admin_form_validate($form, &$form_state) {
553 553
 
554
-  $team_id = $form_state['storage']['team_id'];
555
-  $values = $form_state['values'];
554
+    $team_id = $form_state['storage']['team_id'];
555
+    $values = $form_state['values'];
556 556
   
557
-  $team = node_load($team_id);
557
+    $team = node_load($team_id);
558 558
   
559
-  if (!$values['email']) {
559
+    if (!$values['email']) {
560 560
     form_set_error('email', bts('Email address is required.'));
561
-  }
562
-  else {
561
+    }
562
+    else {
563 563
     $account = user_load(array('mail' => $values['email']));
564 564
     if ((!$account) OR ($account->team != $team_id)) {
565
-      form_set_error('email', bts('There is no user on your team with that email address.'));
565
+        form_set_error('email', bts('There is no user on your team with that email address.'));
566 566
     }
567 567
     elseif (boincteam_is_founder($team_id, $account->uid)) {
568
-      form_set_error('email', bts('@user is the founder of @team!',
568
+        form_set_error('email', bts('@user is the founder of @team!',
569 569
         array(
570
-          '@user' => $account->boincuser_name,
571
-          '@team' => $team->title,
570
+            '@user' => $account->boincuser_name,
571
+            '@team' => $team->title,
572 572
         )
573
-      ));
573
+        ));
574 574
     }
575 575
     elseif (boincteam_is_admin($team_id, $account->uid)) {
576
-      form_set_error('email', bts('@user is already an admin of @team.',
576
+        form_set_error('email', bts('@user is already an admin of @team.',
577 577
         array(
578
-          '@user' => $account->boincuser_name,
579
-          '@team' => $team->title,
578
+            '@user' => $account->boincuser_name,
579
+            '@team' => $team->title,
580 580
         )
581
-      ));
581
+        ));
582 582
     }
583 583
     else {
584
-      $form_state['storage']['boincuser_id'] = $account->boincuser_id;
585
-      $form_state['storage']['boincuser_name'] = $account->boincuser_name;
584
+        $form_state['storage']['boincuser_id'] = $account->boincuser_id;
585
+        $form_state['storage']['boincuser_name'] = $account->boincuser_name;
586
+    }
586 587
     }
587
-  }
588 588
 }
589 589
 
590 590
 /**
@@ -592,17 +592,17 @@  discard block
 block discarded – undo
592 592
  */
593 593
 function boincteam_add_admin_form_submit($form, &$form_state) {
594 594
   
595
-  $team_id = $form_state['storage']['team_id'];
596
-  $boincuser_id = $form_state['storage']['boincuser_id'];
597
-  $user_name = $form_state['storage']['boincuser_name'];
598
-  $values = $form_state['values'];
595
+    $team_id = $form_state['storage']['team_id'];
596
+    $boincuser_id = $form_state['storage']['boincuser_id'];
597
+    $user_name = $form_state['storage']['boincuser_name'];
598
+    $values = $form_state['values'];
599 599
   
600
-  $team = node_load($team_id);
601
-  $boincteam_id = boincteam_lookup_id($team_id);
600
+    $team = node_load($team_id);
601
+    $boincteam_id = boincteam_lookup_id($team_id);
602 602
   
603
-  // Update the team in the BOINC db
604
-  db_set_active('boinc');
605
-  db_query("
603
+    // Update the team in the BOINC db
604
+    db_set_active('boinc');
605
+    db_query("
606 606
     INSERT INTO {team_admin} SET
607 607
       teamid = '%d',
608 608
       userid = '%d',
@@ -610,15 +610,15 @@  discard block
 block discarded – undo
610 610
     $boincteam_id,
611 611
     $boincuser_id,
612 612
     time()
613
-  );
614
-  db_set_active('default');
613
+    );
614
+    db_set_active('default');
615 615
   
616
-  // Could assign a role in Drupal here, as needed
616
+    // Could assign a role in Drupal here, as needed
617 617
   
618 618
   
619
-  drupal_set_message(t('@user has been added as an admin.', 
619
+    drupal_set_message(t('@user has been added as an admin.', 
620 620
     array('@user' => $user_name)));
621 621
     
622
-  // The storage variable quietly kills redirection for some reason... unset it
623
-  unset($form_state['storage']);
622
+    // The storage variable quietly kills redirection for some reason... unset it
623
+    unset($form_state['storage']);
624 624
 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     '#suffix' => '</li>',
120 120
   );
121 121
   $form['form control tabs'] = array(
122
-    '#value' => '<li class="tab">' . l(bts('Cancel'), $_GET['q']) . '</li>'
122
+    '#value' => '<li class="tab">'.l(bts('Cancel'), $_GET['q']).'</li>'
123 123
   );
124 124
   
125 125
   return $form;
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
   
164 164
   // Create the team in the BOINC db
165 165
   
166
-  require_boinc(array('user','team'));
166
+  require_boinc(array('user', 'team'));
167 167
   $boinc_team = make_team(
168 168
     $account->boincuser_id,
169 169
     $values['name'],
@@ -199,10 +199,10 @@  discard block
 block discarded – undo
199 199
     'teaser' => $teaser,
200 200
     'uid' => $user->uid,
201 201
     'path' => null,
202
-    'status' => 1,  // published or not - always publish
202
+    'status' => 1, // published or not - always publish
203 203
     'promote' => 0,
204 204
     'created' => $created_time,
205
-    'comment' => 0,  // comments disabled
205
+    'comment' => 0, // comments disabled
206 206
     'moderate' => 0,
207 207
     'sticky' => 0,
208 208
     'format' => $input_format
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
   $node['og_private'] = 0;
230 230
   */
231 231
   
232
-  $node = (object) $node; // node_save requires an object form
232
+  $node = (object)$node; // node_save requires an object form
233 233
   
234 234
   /*
235 235
   $node->field_description[]['value'] = $boincteam->description;
@@ -379,12 +379,12 @@  discard block
 block discarded – undo
379 379
       '#suffix' => '</li>',
380 380
     );
381 381
     $form['form control tabs'] = array(
382
-      '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/edit', TRUE)) . '</li>'
382
+      '#value' => '<li class="tab">'.l(bts('Cancel'), strstr($_GET['q'], '/edit', TRUE)).'</li>'
383 383
     );
384 384
   }
385 385
   else {
386 386
     $form['description'] = array(
387
-      '#prefix' => '<div class="form-item"><label>' . bts('Description') . ':</label></div><div class="form-item">',
387
+      '#prefix' => '<div class="form-item"><label>'.bts('Description').':</label></div><div class="form-item">',
388 388
       '#value' => $default['description'],
389 389
       '#suffix' => '</div>',
390 390
     );
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
     '#suffix' => '</li>',
539 539
   );
540 540
   $form['form control tabs'] = array(
541
-    '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/edit', TRUE)) . '</li>'
541
+    '#value' => '<li class="tab">'.l(bts('Cancel'), strstr($_GET['q'], '/edit', TRUE)).'</li>'
542 542
   );
543 543
   
544 544
   //$form['#redirect'] = "community/teams/{$team_id}";
Please login to merge, or discard this patch.
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -135,8 +135,7 @@  discard block
 block discarded – undo
135 135
   
136 136
   if (!$name) {
137 137
     form_set_error('name', bts('Team name is required.'));
138
-  }
139
-  else {
138
+  } else {
140 139
     require_boinc('boinc_db');
141 140
     if (BoincTeam::lookup_name($name)) {
142 141
       form_set_error('name', bts('A team named "@name" already exists.',
@@ -177,8 +176,7 @@  discard block
 block discarded – undo
177 176
   if ($boinc_team) {
178 177
     $boinc_user = BoincUser::lookup_id($account->boincuser_id);
179 178
     user_join_team($boinc_team, $boinc_user);
180
-  }
181
-  else {
179
+  } else {
182 180
     drupal_set_message(t('Teams cannot be created at this time. Please 
183 181
       contact the @project administrators!', array('@project' => PROJECT)));
184 182
     watchdog('BOINC team', 'BOINC teams cannot be created for an unknown
@@ -212,8 +210,7 @@  discard block
 block discarded – undo
212 210
   if (module_exists('pathauto')) {
213 211
     module_load_include('inc', 'pathauto', 'pathauto');
214 212
     $node['path'] = pathauto_cleanstring($values['name']);
215
-  }
216
-  else {
213
+  } else {
217 214
     drupal_set_message(t('Teams cannot be created at this time. Please 
218 215
       contact the @project administrators!', array('@project' => PROJECT)));
219 216
     watchdog('BOINC team', 'BOINC teams require the Pathauto module. Teams
@@ -381,8 +378,7 @@  discard block
 block discarded – undo
381 378
     $form['form control tabs'] = array(
382 379
       '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/edit', TRUE)) . '</li>'
383 380
     );
384
-  }
385
-  else {
381
+  } else {
386 382
     $form['description'] = array(
387 383
       '#prefix' => '<div class="form-item"><label>' . bts('Description') . ':</label></div><div class="form-item">',
388 384
       '#value' => $default['description'],
@@ -412,12 +408,10 @@  discard block
 block discarded – undo
412 408
   
413 409
   if ($form_state['storage']['is_boinc_wide']) {
414 410
     form_set_error('none', bts('This team is managed by the BOINC-wide teams system and cannot be updated here.'));
415
-  }
416
-  else {
411
+  } else {
417 412
     if (!$name) {
418 413
       form_set_error('name', bts('Team name is required.'));
419
-    }
420
-    else {
414
+    } else {
421 415
       $team = node_load($form_state['storage']['team_id']);
422 416
       if ($name != $team->title) {
423 417
         // If changing the name ("title" in Drupal terms), check that the new name is available
@@ -558,29 +552,25 @@  discard block
 block discarded – undo
558 552
   
559 553
   if (!$values['email']) {
560 554
     form_set_error('email', bts('Email address is required.'));
561
-  }
562
-  else {
555
+  } else {
563 556
     $account = user_load(array('mail' => $values['email']));
564 557
     if ((!$account) OR ($account->team != $team_id)) {
565 558
       form_set_error('email', bts('There is no user on your team with that email address.'));
566
-    }
567
-    elseif (boincteam_is_founder($team_id, $account->uid)) {
559
+    } elseif (boincteam_is_founder($team_id, $account->uid)) {
568 560
       form_set_error('email', bts('@user is the founder of @team!',
569 561
         array(
570 562
           '@user' => $account->boincuser_name,
571 563
           '@team' => $team->title,
572 564
         )
573 565
       ));
574
-    }
575
-    elseif (boincteam_is_admin($team_id, $account->uid)) {
566
+    } elseif (boincteam_is_admin($team_id, $account->uid)) {
576 567
       form_set_error('email', bts('@user is already an admin of @team.',
577 568
         array(
578 569
           '@user' => $account->boincuser_name,
579 570
           '@team' => $team->title,
580 571
         )
581 572
       ));
582
-    }
583
-    else {
573
+    } else {
584 574
       $form_state['storage']['boincuser_id'] = $account->boincuser_id;
585 575
       $form_state['storage']['boincuser_name'] = $account->boincuser_name;
586 576
     }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     'website' => '',
23 23
     'type' => 0,
24 24
     'country' => 0,
25
-    'joinable' => TRUE,
25
+    'joinable' => true,
26 26
     'description' => '',
27 27
   );
28 28
   
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     '#type' => 'value',
38 38
     '#value' => array(0 => bts('Choose type'))
39 39
   );
40
-  $vocabs = taxonomy_get_vocabularies(NULL);
40
+  $vocabs = taxonomy_get_vocabularies(null);
41 41
   foreach ($vocabs as $vocab) {
42 42
     switch ($vocab->name) {
43 43
     case 'Teams':
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     '#type' => 'textarea',
105 105
     '#default_value' => $default['description'],
106 106
     '#size' => 5,
107
-    '#description' => NULL,
107
+    '#description' => null,
108 108
   );
109 109
   $form['format'] = filter_form();
110 110
   
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     }
145 145
   }
146 146
   
147
-  if (!$values['type'] OR !isset($values['type_options'][$values['type']])) {
147
+  if (!$values['type'] or !isset($values['type_options'][$values['type']])) {
148 148
     form_set_error('type', bts('Please select a team type.'));
149 149
   }
150 150
 }
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
       contact the @project administrators!', array('@project' => PROJECT)));
184 184
     watchdog('BOINC team', 'BOINC teams cannot be created for an unknown
185 185
       reason.', 'error');
186
-    return FALSE;
186
+    return false;
187 187
   }
188 188
   
189 189
   // Create the team node in Drupal
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
   $team = node_load($team_id);
265 265
   $boincteam = boincteam_load(boincteam_lookup_id($team_id));
266 266
   
267
-  $is_boinc_wide = ($boincteam->seti_id > 0) ? TRUE : FALSE;
267
+  $is_boinc_wide = ($boincteam->seti_id > 0) ? true : false;
268 268
   
269 269
   $form_state['storage']['team_id'] = $team_id;
270 270
   $form_state['storage']['is_boinc_wide'] = $is_boinc_wide;
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
     '#type' => 'value',
291 291
     '#value' => array(0 => bts('Choose type'))
292 292
   );
293
-  $vocabs = taxonomy_get_vocabularies(NULL);
293
+  $vocabs = taxonomy_get_vocabularies(null);
294 294
   foreach ($vocabs as $vocab) {
295 295
     switch ($vocab->name) {
296 296
     case 'Teams':
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
       '#type' => 'textarea',
365 365
       '#default_value' => $default['description'],
366 366
       '#size' => 5,
367
-      '#description' => NULL,
367
+      '#description' => null,
368 368
     );
369 369
     $form['format'] = filter_form();
370 370
     
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
       '#suffix' => '</li>',
380 380
     );
381 381
     $form['form control tabs'] = array(
382
-      '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/edit', TRUE)) . '</li>'
382
+      '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/edit', true)) . '</li>'
383 383
     );
384 384
   }
385 385
   else {
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
       }
430 430
     }
431 431
   
432
-    if (!$values['type'] OR !isset($values['type_options'][$values['type']])) {
432
+    if (!$values['type'] or !isset($values['type_options'][$values['type']])) {
433 433
       form_set_error('type', bts('Please select a team type.'));
434 434
     }
435 435
   }
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
     '#suffix' => '</li>',
539 539
   );
540 540
   $form['form control tabs'] = array(
541
-    '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/edit', TRUE)) . '</li>'
541
+    '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/edit', true)) . '</li>'
542 542
   );
543 543
   
544 544
   //$form['#redirect'] = "community/teams/{$team_id}";
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
   }
562 562
   else {
563 563
     $account = user_load(array('mail' => $values['email']));
564
-    if ((!$account) OR ($account->team != $team_id)) {
564
+    if ((!$account) or ($account->team != $team_id)) {
565 565
       form_set_error('email', bts('There is no user on your team with that email address.'));
566 566
     }
567 567
     elseif (boincteam_is_founder($team_id, $account->uid)) {
Please login to merge, or discard this patch.
boinc/modules/boincteam/includes/views_handler_argument_boincteam_id.inc 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@
 block discarded – undo
7 7
  */
8 8
 
9 9
 class views_handler_argument_boincteam_id extends views_handler_argument_numeric {
10
-  function construct() {
10
+    function construct() {
11 11
     parent::construct();
12
-  }
12
+    }
13 13
 
14
-  function set_argument($arg) {
14
+    function set_argument($arg) {
15 15
     // When setting the ID argument, convert to BOINC ID
16 16
     $id = is_numeric($arg) ? $arg : 0;
17 17
     $boinc_id = db_result(db_query("SELECT team_id FROM {boincteam} WHERE nid = %d", $id));
18 18
     $this->argument = $boinc_id;
19 19
     return $this->validate_arg($boinc_id);
20
-  }
20
+    }
21 21
 }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincteam/includes/boincteam.helpers.inc 4 patches
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -15,41 +15,41 @@  discard block
 block discarded – undo
15 15
  */
16 16
 function boincteam_sync() {
17 17
   
18
-  // Get the list of teams to import
19
-  db_set_active('boinc');
20
-  $boinc_teams = db_query('
18
+    // Get the list of teams to import
19
+    db_set_active('boinc');
20
+    $boinc_teams = db_query('
21 21
     SELECT id, name, description, userid, create_time, seti_id
22 22
     FROM team
23 23
     WHERE mod_time > FROM_UNIXTIME(%d)',
24 24
     variable_get('boincteam_last_sync', 0)
25
-  );
26
-  db_set_active('default');
25
+    );
26
+    db_set_active('default');
27 27
   
28
-  $existing_teams = array();
28
+    $existing_teams = array();
29 29
   
30
-  // Get the list of teams already in Drupal to be sure we're not importing
31
-  // any twice
32
-  $result = db_query('
30
+    // Get the list of teams already in Drupal to be sure we're not importing
31
+    // any twice
32
+    $result = db_query('
33 33
     SELECT nid, team_id FROM {boincteam}'
34
-  );
35
-  while ($row = db_fetch_object($result)) {
34
+    );
35
+    while ($row = db_fetch_object($result)) {
36 36
     $existing_teams[$row->team_id] = $row->nid;
37
-  }
37
+    }
38 38
   
39
-  while ($boinc_team = db_fetch_object($boinc_teams)) {
39
+    while ($boinc_team = db_fetch_object($boinc_teams)) {
40 40
     $success = NULL;
41 41
     if (isset($existing_teams[$boinc_team->id])) {
42
-      if ($boinc_team->seti_id > 0) {
42
+        if ($boinc_team->seti_id > 0) {
43 43
         // Sync BOINC-wide teams
44 44
         $nid = $existing_teams[$boinc_team->id];
45 45
         $success = boincteam_import($boinc_team, $nid);
46
-      }
46
+        }
47 47
     }
48 48
     else {
49
-      // Import new teams created by RPC or ops/team_import.php
50
-      $success = boincteam_import($boinc_team);
49
+        // Import new teams created by RPC or ops/team_import.php
50
+        $success = boincteam_import($boinc_team);
51
+    }
51 52
     }
52
-  }
53 53
 }
54 54
 
55 55
 
@@ -58,56 +58,56 @@  discard block
 block discarded – undo
58 58
  */
59 59
 function boincteam_import($boincteam, $nid = NULL) {
60 60
   
61
-  $input_format = variable_get('boincimport_input_format', 0);
62
-  $team_type_map = variable_get('boincimport_team_types', array()); 
61
+    $input_format = variable_get('boincimport_input_format', 0);
62
+    $team_type_map = variable_get('boincimport_team_types', array()); 
63 63
   
64
-  // Save the team type affiliation
65
-  $team_type_tid = $team_type_map[$boincteam->type];
64
+    // Save the team type affiliation
65
+    $team_type_tid = $team_type_map[$boincteam->type];
66 66
   
67
-  $boincteam->description = html_entity_decode($boincteam->description, ENT_QUOTES, 'utf-8');
68
-  // Be sure the text is filtered for the default input format
69
-  $boincteam->description = check_markup($boincteam->description, $input_format);
67
+    $boincteam->description = html_entity_decode($boincteam->description, ENT_QUOTES, 'utf-8');
68
+    // Be sure the text is filtered for the default input format
69
+    $boincteam->description = check_markup($boincteam->description, $input_format);
70 70
   
71
-  $teaser = node_teaser($boincteam->description);
71
+    $teaser = node_teaser($boincteam->description);
72 72
   
73
-  if ($nid) {
73
+    if ($nid) {
74 74
     // Update an existing node
75 75
     $node = node_load($nid);
76 76
     $node->title = $boincteam->name;
77 77
     $node->body = $boincteam->description;
78 78
     $node->teaser = $teaser;
79 79
     $node->uid = boincuser_lookup_uid($boincteam->userid);
80
-  }
81
-  else {
80
+    }
81
+    else {
82 82
     // Construct the team as a new node
83 83
     $node = array(
84
-      'type' => 'team',
85
-      'title' => $boincteam->name,
86
-      'body' => $boincteam->description,
87
-      'teaser' => $teaser,
88
-      'uid' => boincuser_lookup_uid($boincteam->userid),
89
-      'path' => null,
90
-      'status' => 1,  // published or not - always publish
91
-      'promote' => 0,
92
-      'created' => $boincteam->create_time,
93
-      'comment' => 0,  // comments disabled
94
-      'moderate' => 0,
95
-      'sticky' => 0,
96
-      'format' => $input_format
84
+        'type' => 'team',
85
+        'title' => $boincteam->name,
86
+        'body' => $boincteam->description,
87
+        'teaser' => $teaser,
88
+        'uid' => boincuser_lookup_uid($boincteam->userid),
89
+        'path' => null,
90
+        'status' => 1,  // published or not - always publish
91
+        'promote' => 0,
92
+        'created' => $boincteam->create_time,
93
+        'comment' => 0,  // comments disabled
94
+        'moderate' => 0,
95
+        'sticky' => 0,
96
+        'format' => $input_format
97 97
     );
98 98
     $node = (object) $node; // node_save requires an object form
99
-  }
99
+    }
100 100
   
101
-  $node->taxonomy[] = taxonomy_get_term($team_type_tid);
101
+    $node->taxonomy[] = taxonomy_get_term($team_type_tid);
102 102
   
103
-  // Save the team node
104
-  node_save($node);
105
-  $success = ($node->nid) ? TRUE : FALSE;
103
+    // Save the team node
104
+    node_save($node);
105
+    $success = ($node->nid) ? TRUE : FALSE;
106 106
   
107
-  if (!$nid) {
107
+    if (!$nid) {
108 108
     // Save the team IDs to a BOINC <--> Drupal reference table, if needed
109 109
     db_query('INSERT INTO {boincteam} (team_id, nid) VALUES (%d, %d)', $boincteam->id, $node->nid);
110
-  }
110
+    }
111 111
   
112
-  return $success;
112
+    return $success;
113 113
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -87,15 +87,15 @@
 block discarded – undo
87 87
       'teaser' => $teaser,
88 88
       'uid' => boincuser_lookup_uid($boincteam->userid),
89 89
       'path' => null,
90
-      'status' => 1,  // published or not - always publish
90
+      'status' => 1, // published or not - always publish
91 91
       'promote' => 0,
92 92
       'created' => $boincteam->create_time,
93
-      'comment' => 0,  // comments disabled
93
+      'comment' => 0, // comments disabled
94 94
       'moderate' => 0,
95 95
       'sticky' => 0,
96 96
       'format' => $input_format
97 97
     );
98
-    $node = (object) $node; // node_save requires an object form
98
+    $node = (object)$node; // node_save requires an object form
99 99
   }
100 100
   
101 101
   $node->taxonomy[] = taxonomy_get_term($team_type_tid);
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,8 +44,7 @@  discard block
 block discarded – undo
44 44
         $nid = $existing_teams[$boinc_team->id];
45 45
         $success = boincteam_import($boinc_team, $nid);
46 46
       }
47
-    }
48
-    else {
47
+    } else {
49 48
       // Import new teams created by RPC or ops/team_import.php
50 49
       $success = boincteam_import($boinc_team);
51 50
     }
@@ -77,8 +76,7 @@  discard block
 block discarded – undo
77 76
     $node->body = $boincteam->description;
78 77
     $node->teaser = $teaser;
79 78
     $node->uid = boincuser_lookup_uid($boincteam->userid);
80
-  }
81
-  else {
79
+  } else {
82 80
     // Construct the team as a new node
83 81
     $node = array(
84 82
       'type' => 'team',
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
   }
38 38
   
39 39
   while ($boinc_team = db_fetch_object($boinc_teams)) {
40
-    $success = NULL;
40
+    $success = null;
41 41
     if (isset($existing_teams[$boinc_team->id])) {
42 42
       if ($boinc_team->seti_id > 0) {
43 43
         // Sync BOINC-wide teams
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 /**
57 57
  * Import a given BOINC team object into Drupal
58 58
  */
59
-function boincteam_import($boincteam, $nid = NULL) {
59
+function boincteam_import($boincteam, $nid = null) {
60 60
   
61 61
   $input_format = variable_get('boincimport_input_format', 0);
62 62
   $team_type_map = variable_get('boincimport_team_types', array()); 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
   
103 103
   // Save the team node
104 104
   node_save($node);
105
-  $success = ($node->nid) ? TRUE : FALSE;
105
+  $success = ($node->nid) ? true : false;
106 106
   
107 107
   if (!$nid) {
108 108
     // Save the team IDs to a BOINC <--> Drupal reference table, if needed
Please login to merge, or discard this patch.
sites/default/boinc/modules/boincteam/includes/boincteam_forum.forms.inc 3 patches
Indentation   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -14,84 +14,84 @@  discard block
 block discarded – undo
14 14
  * The definition of the create team form
15 15
  */
16 16
 function boincteam_forum_create_form(&$form_state) {
17
-  $form = array();
17
+    $form = array();
18 18
   
19
-  global $user;
20
-  $account = user_load($user->uid);
19
+    global $user;
20
+    $account = user_load($user->uid);
21 21
   
22
-  $default = array(
22
+    $default = array(
23 23
     'title' => '',
24 24
     'min_time_between_posts' => '',
25 25
     'min_total_credit_to_post' => '',
26 26
     'min_avg_credit_to_post' => '',
27 27
     'public' => 0,
28 28
     'description' => '',
29
-  );
29
+    );
30 30
   
31
-  // Standard option sets
32
-  $form['boolean_options'] = array(
31
+    // Standard option sets
32
+    $form['boolean_options'] = array(
33 33
     '#type' => 'value',
34 34
     '#value' => array(1 => bts('yes'), 0 => bts('no')),
35
-  );
35
+    );
36 36
   
37
-  // Form elements
38
-  $form['title'] = array(
37
+    // Form elements
38
+    $form['title'] = array(
39 39
     '#title' => bts('Message board title'),
40 40
     '#type' => 'textfield',
41 41
     '#default_value' => $default['title'],
42 42
     '#size' => 34,
43 43
     '#description' => bts('Text only, no HTML tags'),
44
-  );
45
-  $form['min_time_between_posts'] = array(
44
+    );
45
+    $form['min_time_between_posts'] = array(
46 46
     '#title' => bts('Minimum time between posts'),
47 47
     '#type' => 'textfield',
48 48
     '#default_value' => $default['min_time_between_posts'],
49 49
     '#size' => 12,
50 50
     '#description' => bts('Seconds'),
51
-  );
52
-  $form['min_total_credit_to_post'] = array(
51
+    );
52
+    $form['min_total_credit_to_post'] = array(
53 53
     '#title' => bts('Minimum total credit to post'),
54 54
     '#type' => 'textfield',
55 55
     '#default_value' => $default['min_total_credit_to_post'],
56 56
     '#size' => 12,
57
-  );
58
-  $form['min_avg_credit_to_post'] = array(
57
+    );
58
+    $form['min_avg_credit_to_post'] = array(
59 59
     '#title' => bts('Minimum avg credit to post'),
60 60
     '#type' => 'textfield',
61 61
     '#default_value' => $default['min_avg_credit_to_post'],
62 62
     '#size' => 12,
63
-  );
64
-  $form['public'] = array(
63
+    );
64
+    $form['public'] = array(
65 65
     '#title' => bts('Allow public to read board?'),
66 66
     '#type' => 'radios',
67 67
     '#options' => $form['boolean_options']['#value'],
68 68
     '#attributes' => array('class' => 'fancy'),
69 69
     '#default_value' => $default['public'],
70
-  );
71
-  $form['description'] = array(
70
+    );
71
+    $form['description'] = array(
72 72
     '#title' => bts('Description'),
73 73
     '#type' => 'textarea',
74 74
     '#default_value' => $default['description'],
75 75
     '#size' => 5,
76
-  );
76
+    );
77 77
   
78
-  // Form control
79
-  $form['form control tabs prefix'] = array(
78
+    // Form control
79
+    $form['form control tabs prefix'] = array(
80 80
     '#value' => '<ul class="form-control tab-list">'
81
-  );
82
-  $form['submit'] = array(
81
+    );
82
+    $form['submit'] = array(
83 83
     '#prefix' => '<li class="first tab">',
84 84
     '#type' => 'submit',
85 85
     '#value' => bts('Create message board'),
86 86
     '#suffix' => '</li>',
87
-  );
88
-  $form['form control tabs'] = array(
87
+    );
88
+    $form['form control tabs'] = array(
89 89
     '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/forum/add', TRUE)) . '</li>'
90
-  );
90
+    );
91 91
   
92
-  $form['#redirect'] = "community/teams/{$account->team}";
92
+    $form['#redirect'] = "community/teams/{$account->team}";
93 93
   
94
-  return $form;
94
+    return $form;
95 95
 }
96 96
 
97 97
 /**
@@ -99,33 +99,33 @@  discard block
 block discarded – undo
99 99
  */
100 100
 function boincteam_forum_create_form_validate($form, &$form_state) {
101 101
 
102
-  $values = $form_state['values'];
102
+    $values = $form_state['values'];
103 103
   
104
-  if (!$values['title']) {
104
+    if (!$values['title']) {
105 105
     form_set_error('name', bts('Message board title is required.'));
106
-  }
107
-  if (!is_numeric($values['min_time_between_posts']) OR
106
+    }
107
+    if (!is_numeric($values['min_time_between_posts']) OR
108 108
       $values['min_time_between_posts'] < 0) {
109 109
     form_set_error('min_time_between_posts',
110
-      bts('Please set the minimum time required between posts.')
110
+        bts('Please set the minimum time required between posts.')
111 111
     );
112
-  }
113
-  if (!is_numeric($values['min_total_credit_to_post']) OR
112
+    }
113
+    if (!is_numeric($values['min_total_credit_to_post']) OR
114 114
       $values['min_total_credit_to_post'] < 0) {
115 115
     form_set_error('min_total_credit_to_post',
116
-      bts('Please set the minimum total credit that a user'
116
+        bts('Please set the minimum total credit that a user'
117 117
         . ' must earn in order to post to this message board.'
118
-      )
118
+        )
119 119
     );
120
-  }
121
-  if (!is_numeric($values['min_avg_credit_to_post']) OR
120
+    }
121
+    if (!is_numeric($values['min_avg_credit_to_post']) OR
122 122
       $values['min_avg_credit_to_post'] < 0) {
123 123
     form_set_error('min_avg_credit_to_post',
124
-      bts('Please set the minimum average credit that a user'
124
+        bts('Please set the minimum average credit that a user'
125 125
         . ' is required to have in order to post to this message board.'
126
-      )
126
+        )
127 127
     );
128
-  }
128
+    }
129 129
 }
130 130
 
131 131
 /**
@@ -133,13 +133,13 @@  discard block
 block discarded – undo
133 133
  */
134 134
 function boincteam_forum_create_form_submit($form, &$form_state) {
135 135
   
136
-  $values = $form_state['values'];
136
+    $values = $form_state['values'];
137 137
   
138
-  global $user;
139
-  $account = user_load($user->uid);
138
+    global $user;
139
+    $account = user_load($user->uid);
140 140
   
141
-  // Add the team forum to the db
142
-  db_query("
141
+    // Add the team forum to the db
142
+    db_query("
143 143
     INSERT INTO {boincteam_forum} SET
144 144
       nid = %d,
145 145
       title = '%s',
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
     (int) $values['min_avg_credit_to_post'],
158 158
     ($values['public']) ? 1 : 0,
159 159
     $values['description']
160
-  );
160
+    );
161 161
   
162
-  drupal_set_message(t('Message board "@forum" has been created.',
162
+    drupal_set_message(t('Message board "@forum" has been created.',
163 163
     array('@forum' => $values['title'])));
164 164
 }
165 165
 
@@ -171,84 +171,84 @@  discard block
 block discarded – undo
171 171
  * The definition of the edit team forum form
172 172
  */
173 173
 function boincteam_forum_edit_form(&$form_state, $tfid) {
174
-  $form = array();
175
-  $boincteam_forum = boincteam_forum_load($tfid);
174
+    $form = array();
175
+    $boincteam_forum = boincteam_forum_load($tfid);
176 176
   
177
-  $form_state['storage']['tfid'] = $tfid;
177
+    $form_state['storage']['tfid'] = $tfid;
178 178
   
179
-  $default = array(
179
+    $default = array(
180 180
     'title' => $boincteam_forum->title,
181 181
     'min_time_between_posts' => $boincteam_forum->min_time_between_posts,
182 182
     'min_total_credit_to_post' => $boincteam_forum->min_total_credit_to_post,
183 183
     'min_avg_credit_to_post' => $boincteam_forum->min_avg_credit_to_post,
184 184
     'public' => ($boincteam_forum->public) ? 1 : 0,
185 185
     'description' => $boincteam_forum->description,
186
-  );
186
+    );
187 187
   
188
-  // Standard option sets
189
-  $form['boolean_options'] = array(
188
+    // Standard option sets
189
+    $form['boolean_options'] = array(
190 190
     '#type' => 'value',
191 191
     '#value' => array(1 => bts('yes'), 0 => bts('no')),
192
-  );
192
+    );
193 193
   
194
-  // Form elements
195
-  $form['title'] = array(
194
+    // Form elements
195
+    $form['title'] = array(
196 196
     '#title' => bts('Message board title'),
197 197
     '#type' => 'textfield',
198 198
     '#default_value' => $default['title'],
199 199
     '#size' => 34,
200 200
     '#description' => bts('Text only, no HTML tags'),
201
-  );
202
-  $form['min_time_between_posts'] = array(
201
+    );
202
+    $form['min_time_between_posts'] = array(
203 203
     '#title' => bts('Minimum time between posts'),
204 204
     '#type' => 'textfield',
205 205
     '#default_value' => $default['min_time_between_posts'],
206 206
     '#size' => 12,
207 207
     '#description' => bts('Seconds'),
208
-  );
209
-  $form['min_total_credit_to_post'] = array(
208
+    );
209
+    $form['min_total_credit_to_post'] = array(
210 210
     '#title' => bts('Minimum total credit to post'),
211 211
     '#type' => 'textfield',
212 212
     '#default_value' => $default['min_total_credit_to_post'],
213 213
     '#size' => 12,
214
-  );
215
-  $form['min_avg_credit_to_post'] = array(
214
+    );
215
+    $form['min_avg_credit_to_post'] = array(
216 216
     '#title' => bts('Minimum avg credit to post'),
217 217
     '#type' => 'textfield',
218 218
     '#default_value' => $default['min_avg_credit_to_post'],
219 219
     '#size' => 12,
220
-  );
221
-  $form['public'] = array(
220
+    );
221
+    $form['public'] = array(
222 222
     '#title' => bts('Allow public to read board?'),
223 223
     '#type' => 'radios',
224 224
     '#options' => $form['boolean_options']['#value'],
225 225
     '#attributes' => array('class' => 'fancy'),
226 226
     '#default_value' => $default['public'],
227
-  );
228
-  $form['description'] = array(
227
+    );
228
+    $form['description'] = array(
229 229
     '#title' => bts('Description'),
230 230
     '#type' => 'textarea',
231 231
     '#default_value' => $default['description'],
232 232
     '#size' => 5,
233
-  );
233
+    );
234 234
   
235
-  // Form control
236
-  $form['form control tabs prefix'] = array(
235
+    // Form control
236
+    $form['form control tabs prefix'] = array(
237 237
     '#value' => '<ul class="form-control tab-list">'
238
-  );
239
-  $form['submit'] = array(
238
+    );
239
+    $form['submit'] = array(
240 240
     '#prefix' => '<li class="first tab">',
241 241
     '#type' => 'submit',
242 242
     '#value' => bts('Save message board'),
243 243
     '#suffix' => '</li>',
244
-  );
245
-  $form['form control tabs'] = array(
244
+    );
245
+    $form['form control tabs'] = array(
246 246
     '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/forum', TRUE)) . '</li>'
247
-  );
247
+    );
248 248
   
249
-  $form['#redirect'] = "community/teams/{$boincteam_forum->nid}";
249
+    $form['#redirect'] = "community/teams/{$boincteam_forum->nid}";
250 250
   
251
-  return $form;
251
+    return $form;
252 252
 }
253 253
 
254 254
 /**
@@ -256,33 +256,33 @@  discard block
 block discarded – undo
256 256
  */
257 257
 function boincteam_forum_edit_form_validate($form, &$form_state) {
258 258
 
259
-  $values = $form_state['values'];
259
+    $values = $form_state['values'];
260 260
   
261
-  if (!$values['title']) {
261
+    if (!$values['title']) {
262 262
     form_set_error('name', bts('Message board title is required.'));
263
-  }
264
-  if (!is_numeric($values['min_time_between_posts']) OR
263
+    }
264
+    if (!is_numeric($values['min_time_between_posts']) OR
265 265
       $values['min_time_between_posts'] < 0) {
266 266
     form_set_error('min_time_between_posts', 
267
-      bts('Please set the minimum time required between posts.')
267
+        bts('Please set the minimum time required between posts.')
268 268
     );
269
-  }
270
-  if (!is_numeric($values['min_total_credit_to_post']) OR
269
+    }
270
+    if (!is_numeric($values['min_total_credit_to_post']) OR
271 271
       $values['min_total_credit_to_post'] < 0) {
272 272
     form_set_error('min_total_credit_to_post',
273
-      bts('Please set the minimum total credit that a user'
273
+        bts('Please set the minimum total credit that a user'
274 274
         . ' must earn in order to post to this message board.'
275
-      )
275
+        )
276 276
     );
277
-  }
278
-  if (!is_numeric($values['min_avg_credit_to_post']) OR
277
+    }
278
+    if (!is_numeric($values['min_avg_credit_to_post']) OR
279 279
       $values['min_avg_credit_to_post'] < 0) {
280 280
     form_set_error('min_avg_credit_to_post', 
281
-      bts('Please set the minimum average credit that a user'
281
+        bts('Please set the minimum average credit that a user'
282 282
         . ' is required to have in order to post to this message board.'
283
-      )
283
+        )
284 284
     );
285
-  }
285
+    }
286 286
 }
287 287
 
288 288
 /**
@@ -290,11 +290,11 @@  discard block
 block discarded – undo
290 290
  */
291 291
 function boincteam_forum_edit_form_submit($form, &$form_state) {
292 292
   
293
-  $tfid = $form_state['storage']['tfid'];
294
-  $values = $form_state['values'];
293
+    $tfid = $form_state['storage']['tfid'];
294
+    $values = $form_state['values'];
295 295
   
296
-  // Update the team forum in the db
297
-  db_query("
296
+    // Update the team forum in the db
297
+    db_query("
298 298
     UPDATE {boincteam_forum} SET
299 299
       title = '%s',
300 300
       min_time_between_posts = '%d',
@@ -311,11 +311,11 @@  discard block
 block discarded – undo
311 311
     ($values['public']) ? 1 : 0,
312 312
     $values['description'],
313 313
     $tfid
314
-  );
314
+    );
315 315
   
316
-  drupal_set_message(t('Details for message board "@forum" have been updated.',
316
+    drupal_set_message(t('Details for message board "@forum" have been updated.',
317 317
     array('@forum' => $values['title'])));
318 318
   
319
-  // The storage variable quietly kills redirection for some reason... unset it
320
-  unset($form_state['storage']);
319
+    // The storage variable quietly kills redirection for some reason... unset it
320
+    unset($form_state['storage']);
321 321
 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     '#suffix' => '</li>',
87 87
   );
88 88
   $form['form control tabs'] = array(
89
-    '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/forum/add', TRUE)) . '</li>'
89
+    '#value' => '<li class="tab">'.l(bts('Cancel'), strstr($_GET['q'], '/forum/add', TRUE)).'</li>'
90 90
   );
91 91
   
92 92
   $form['#redirect'] = "community/teams/{$account->team}";
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
       updated = UNIX_TIMESTAMP()",
153 153
     $account->team,
154 154
     $values['title'],
155
-    (int) $values['min_time_between_posts'],
156
-    (int) $values['min_total_credit_to_post'],
157
-    (int) $values['min_avg_credit_to_post'],
155
+    (int)$values['min_time_between_posts'],
156
+    (int)$values['min_total_credit_to_post'],
157
+    (int)$values['min_avg_credit_to_post'],
158 158
     ($values['public']) ? 1 : 0,
159 159
     $values['description']
160 160
   );
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     '#suffix' => '</li>',
244 244
   );
245 245
   $form['form control tabs'] = array(
246
-    '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/forum', TRUE)) . '</li>'
246
+    '#value' => '<li class="tab">'.l(bts('Cancel'), strstr($_GET['q'], '/forum', TRUE)).'</li>'
247 247
   );
248 248
   
249 249
   $form['#redirect'] = "community/teams/{$boincteam_forum->nid}";
@@ -305,9 +305,9 @@  discard block
 block discarded – undo
305 305
       updated = UNIX_TIMESTAMP()
306 306
     WHERE tfid='%d'",
307 307
     $values['title'],
308
-    (int) $values['min_time_between_posts'],
309
-    (int) $values['min_total_credit_to_post'],
310
-    (int) $values['min_avg_credit_to_post'],
308
+    (int)$values['min_time_between_posts'],
309
+    (int)$values['min_total_credit_to_post'],
310
+    (int)$values['min_avg_credit_to_post'],
311 311
     ($values['public']) ? 1 : 0,
312 312
     $values['description'],
313 313
     $tfid
Please login to merge, or discard this patch.
Upper-Lower-Casing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     '#suffix' => '</li>',
87 87
   );
88 88
   $form['form control tabs'] = array(
89
-    '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/forum/add', TRUE)) . '</li>'
89
+    '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/forum/add', true)) . '</li>'
90 90
   );
91 91
   
92 92
   $form['#redirect'] = "community/teams/{$account->team}";
@@ -104,13 +104,13 @@  discard block
 block discarded – undo
104 104
   if (!$values['title']) {
105 105
     form_set_error('name', bts('Message board title is required.'));
106 106
   }
107
-  if (!is_numeric($values['min_time_between_posts']) OR
107
+  if (!is_numeric($values['min_time_between_posts']) or
108 108
       $values['min_time_between_posts'] < 0) {
109 109
     form_set_error('min_time_between_posts',
110 110
       bts('Please set the minimum time required between posts.')
111 111
     );
112 112
   }
113
-  if (!is_numeric($values['min_total_credit_to_post']) OR
113
+  if (!is_numeric($values['min_total_credit_to_post']) or
114 114
       $values['min_total_credit_to_post'] < 0) {
115 115
     form_set_error('min_total_credit_to_post',
116 116
       bts('Please set the minimum total credit that a user'
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
       )
119 119
     );
120 120
   }
121
-  if (!is_numeric($values['min_avg_credit_to_post']) OR
121
+  if (!is_numeric($values['min_avg_credit_to_post']) or
122 122
       $values['min_avg_credit_to_post'] < 0) {
123 123
     form_set_error('min_avg_credit_to_post',
124 124
       bts('Please set the minimum average credit that a user'
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     '#suffix' => '</li>',
244 244
   );
245 245
   $form['form control tabs'] = array(
246
-    '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/forum', TRUE)) . '</li>'
246
+    '#value' => '<li class="tab">' . l(bts('Cancel'), strstr($_GET['q'], '/forum', true)) . '</li>'
247 247
   );
248 248
   
249 249
   $form['#redirect'] = "community/teams/{$boincteam_forum->nid}";
@@ -261,13 +261,13 @@  discard block
 block discarded – undo
261 261
   if (!$values['title']) {
262 262
     form_set_error('name', bts('Message board title is required.'));
263 263
   }
264
-  if (!is_numeric($values['min_time_between_posts']) OR
264
+  if (!is_numeric($values['min_time_between_posts']) or
265 265
       $values['min_time_between_posts'] < 0) {
266 266
     form_set_error('min_time_between_posts', 
267 267
       bts('Please set the minimum time required between posts.')
268 268
     );
269 269
   }
270
-  if (!is_numeric($values['min_total_credit_to_post']) OR
270
+  if (!is_numeric($values['min_total_credit_to_post']) or
271 271
       $values['min_total_credit_to_post'] < 0) {
272 272
     form_set_error('min_total_credit_to_post',
273 273
       bts('Please set the minimum total credit that a user'
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
       )
276 276
     );
277 277
   }
278
-  if (!is_numeric($values['min_avg_credit_to_post']) OR
278
+  if (!is_numeric($values['min_avg_credit_to_post']) or
279 279
       $values['min_avg_credit_to_post'] < 0) {
280 280
     form_set_error('min_avg_credit_to_post', 
281 281
       bts('Please set the minimum average credit that a user'
Please login to merge, or discard this patch.