1
|
|
|
<?php |
2
|
|
|
namespace Amenadiel\JpGraph\Plot; |
3
|
|
|
|
4
|
|
|
use Amenadiel\JpGraph\Util; |
5
|
|
|
|
6
|
|
|
/*======================================================================= |
7
|
|
|
// File: JPGRAPH_LINE.PHP |
8
|
|
|
// Description: Line plot extension for JpGraph |
9
|
|
|
// Created: 2001-01-08 |
10
|
|
|
// Ver: $Id: jpgraph_line.php 1921 2009-12-11 11:46:39Z ljp $ |
11
|
|
|
// |
12
|
|
|
// Copyright (c) Asial Corporation. All rights reserved. |
13
|
|
|
//======================================================================== |
14
|
|
|
*/ |
15
|
|
|
|
16
|
|
|
// constants for the (filled) area |
17
|
|
|
DEFINE("LP_AREA_FILLED", true); |
18
|
|
|
DEFINE("LP_AREA_NOT_FILLED", false); |
19
|
|
|
DEFINE("LP_AREA_BORDER", false); |
20
|
|
|
DEFINE("LP_AREA_NO_BORDER", true); |
21
|
|
|
|
22
|
|
|
//=================================================== |
23
|
|
|
// CLASS LinePlot |
24
|
|
|
// Description: |
25
|
|
|
//=================================================== |
26
|
|
|
class LinePlot extends Plot |
27
|
|
|
{ |
28
|
|
|
public $mark = null; |
29
|
|
|
protected $filled = false; |
30
|
|
|
protected $fill_color = 'blue'; |
31
|
|
|
protected $step_style = false; |
32
|
|
|
protected $center = false; |
33
|
|
|
protected $line_style = 1; // Default to solid |
34
|
|
|
protected $filledAreas = array(); // array of arrays(with min,max,col,filled in them) |
35
|
|
|
public $barcenter = false; // When we mix line and bar. Should we center the line in the bar. |
36
|
|
|
protected $fillFromMin = false; |
37
|
|
|
protected $fillFromMax = false; |
38
|
|
|
protected $fillgrad = false; |
39
|
|
|
protected $fillgrad_fromcolor = 'navy'; |
40
|
|
|
protected $fillgrad_tocolor = 'silver'; |
41
|
|
|
protected $fillgrad_numcolors = 100; |
42
|
|
|
protected $iFastStroke = false; |
43
|
|
|
|
44
|
|
|
//--------------- |
45
|
|
|
// CONSTRUCTOR |
46
|
|
|
public function __construct($datay, $datax = false) |
47
|
|
|
{ |
48
|
|
|
parent::__construct($datay, $datax); |
49
|
|
|
$this->mark = new PlotMark(); |
50
|
|
|
$this->color = Util\ColorFactory::getColor(); |
51
|
|
|
$this->fill_color = $this->color; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
//--------------- |
55
|
|
|
// PUBLIC METHODS |
56
|
|
|
|
57
|
|
|
public function SetFilled($aFlg = true) |
58
|
|
|
{ |
59
|
|
|
$this->filled = $aFlg; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
public function SetBarCenter($aFlag = true) |
63
|
|
|
{ |
64
|
|
|
$this->barcenter = $aFlag; |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
public function SetStyle($aStyle) |
68
|
|
|
{ |
69
|
|
|
$this->line_style = $aStyle; |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
public function SetStepStyle($aFlag = true) |
73
|
|
|
{ |
74
|
|
|
$this->step_style = $aFlag; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
public function SetColor($aColor) |
78
|
|
|
{ |
79
|
|
|
parent::SetColor($aColor); |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
public function SetFillFromYMin($f = true) |
83
|
|
|
{ |
84
|
|
|
$this->fillFromMin = $f; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
public function SetFillFromYMax($f = true) |
88
|
|
|
{ |
89
|
|
|
$this->fillFromMax = $f; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
public function SetFillColor($aColor, $aFilled = true) |
93
|
|
|
{ |
94
|
|
|
//$this->color = $aColor; |
|
|
|
|
95
|
|
|
$this->fill_color = $aColor; |
96
|
|
|
$this->filled = $aFilled; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
public function SetFillGradient($aFromColor, $aToColor, $aNumColors = 100, $aFilled = true) |
100
|
|
|
{ |
101
|
|
|
$this->fillgrad_fromcolor = $aFromColor; |
102
|
|
|
$this->fillgrad_tocolor = $aToColor; |
103
|
|
|
$this->fillgrad_numcolors = $aNumColors; |
104
|
|
|
$this->filled = $aFilled; |
105
|
|
|
$this->fillgrad = true; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
public function Legend($graph) |
109
|
|
|
{ |
110
|
|
|
if ($this->legend != "") { |
111
|
|
|
if ($this->filled && !$this->fillgrad) { |
112
|
|
|
$graph->legend->Add($this->legend, |
113
|
|
|
$this->fill_color, $this->mark, 0, |
114
|
|
|
$this->legendcsimtarget, $this->legendcsimalt, $this->legendcsimwintarget); |
115
|
|
|
} elseif ($this->fillgrad) { |
116
|
|
|
$color = array($this->fillgrad_fromcolor, $this->fillgrad_tocolor); |
117
|
|
|
// In order to differentiate between gradients and cooors specified as an RGB triple |
118
|
|
|
$graph->legend->Add($this->legend, $color, "", -2/* -GRAD_HOR */, |
119
|
|
|
$this->legendcsimtarget, $this->legendcsimalt, $this->legendcsimwintarget); |
120
|
|
|
} else { |
121
|
|
|
$graph->legend->Add($this->legend, |
122
|
|
|
$this->color, $this->mark, $this->line_style, |
123
|
|
|
$this->legendcsimtarget, $this->legendcsimalt, $this->legendcsimwintarget); |
124
|
|
|
} |
125
|
|
|
} |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
public function AddArea($aMin = 0, $aMax = 0, $aFilled = LP_AREA_NOT_FILLED, $aColor = "gray9", $aBorder = LP_AREA_BORDER) |
129
|
|
|
{ |
130
|
|
|
if ($aMin > $aMax) { |
131
|
|
|
// swap |
132
|
|
|
$tmp = $aMin; |
133
|
|
|
$aMin = $aMax; |
134
|
|
|
$aMax = $tmp; |
135
|
|
|
} |
136
|
|
|
$this->filledAreas[] = array($aMin, $aMax, $aColor, $aFilled, $aBorder); |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
// Gets called before any axis are stroked |
140
|
|
|
public function PreStrokeAdjust($graph) |
141
|
|
|
{ |
142
|
|
|
|
143
|
|
|
// If another plot type have already adjusted the |
144
|
|
|
// offset we don't touch it. |
145
|
|
|
// (We check for empty in case the scale is a log scale |
146
|
|
|
// and hence doesn't contain any xlabel_offset) |
147
|
|
|
if (empty($graph->xaxis->scale->ticks->xlabel_offset) || $graph->xaxis->scale->ticks->xlabel_offset == 0) { |
148
|
|
|
if ($this->center) { |
149
|
|
|
++$this->numpoints; |
150
|
|
|
$a = 0.5; |
151
|
|
|
$b = 0.5; |
152
|
|
|
} else { |
153
|
|
|
$a = 0; |
154
|
|
|
$b = 0; |
155
|
|
|
} |
156
|
|
|
$graph->xaxis->scale->ticks->SetXLabelOffset($a); |
157
|
|
|
$graph->SetTextScaleOff($b); |
158
|
|
|
//$graph->xaxis->scale->ticks->SupressMinorTickMarks(); |
|
|
|
|
159
|
|
|
} |
160
|
|
|
} |
161
|
|
|
|
162
|
|
|
public function SetFastStroke($aFlg = true) |
163
|
|
|
{ |
164
|
|
|
$this->iFastStroke = $aFlg; |
165
|
|
|
} |
166
|
|
|
|
167
|
|
|
public function FastStroke($img, $xscale, $yscale, $aStartPoint = 0, $exist_x = true) |
168
|
|
|
{ |
169
|
|
|
// An optimized stroke for many data points with no extra |
170
|
|
|
// features but 60% faster. You can't have values or line styles, or null |
171
|
|
|
// values in plots. |
172
|
|
|
$numpoints = count($this->coords[0]); |
173
|
|
|
if ($this->barcenter) { |
174
|
|
|
$textadj = 0.5 - $xscale->text_scale_off; |
175
|
|
|
} else { |
176
|
|
|
$textadj = 0; |
177
|
|
|
} |
178
|
|
|
|
179
|
|
|
$img->SetColor($this->color); |
180
|
|
|
$img->SetLineWeight($this->weight); |
181
|
|
|
$pnts = $aStartPoint; |
182
|
|
|
while ($pnts < $numpoints) { |
183
|
|
View Code Duplication |
if ($exist_x) { |
|
|
|
|
184
|
|
|
$x = $this->coords[1][$pnts]; |
185
|
|
|
} else { |
186
|
|
|
$x = $pnts + $textadj; |
187
|
|
|
} |
188
|
|
|
$xt = $xscale->Translate($x); |
189
|
|
|
$y = $this->coords[0][$pnts]; |
190
|
|
|
$yt = $yscale->Translate($y); |
191
|
|
|
if (is_numeric($y)) { |
192
|
|
|
$cord[] = $xt; |
|
|
|
|
193
|
|
|
$cord[] = $yt; |
|
|
|
|
194
|
|
|
} elseif ($y == '-' && $pnts > 0) { |
|
|
|
|
195
|
|
|
// Just ignore |
196
|
|
|
} else { |
197
|
|
|
Util\JpGraphError::RaiseL(10002); //('Plot too complicated for fast line Stroke. Use standard Stroke()'); |
198
|
|
|
} |
199
|
|
|
++$pnts; |
200
|
|
|
} // WHILE |
201
|
|
|
|
202
|
|
|
$img->Polygon($cord, false, true); |
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
public function Stroke($img, $xscale, $yscale) |
206
|
|
|
{ |
207
|
|
|
$idx = 0; |
208
|
|
|
$numpoints = count($this->coords[0]); |
209
|
|
View Code Duplication |
if (isset($this->coords[1])) { |
|
|
|
|
210
|
|
|
if (count($this->coords[1]) != $numpoints) { |
211
|
|
|
Util\JpGraphError::RaiseL(2003, count($this->coords[1]), $numpoints); |
212
|
|
|
//("Number of X and Y points are not equal. Number of X-points:".count($this->coords[1])." Number of Y-points:$numpoints"); |
|
|
|
|
213
|
|
|
} else { |
214
|
|
|
$exist_x = true; |
215
|
|
|
} |
216
|
|
|
} else { |
217
|
|
|
$exist_x = false; |
218
|
|
|
} |
219
|
|
|
|
220
|
|
|
if ($this->barcenter) { |
221
|
|
|
$textadj = 0.5 - $xscale->text_scale_off; |
222
|
|
|
} else { |
223
|
|
|
$textadj = 0; |
224
|
|
|
} |
225
|
|
|
|
226
|
|
|
// Find the first numeric data point |
227
|
|
|
$startpoint = 0; |
228
|
|
|
while ($startpoint < $numpoints && !is_numeric($this->coords[0][$startpoint])) { |
229
|
|
|
++$startpoint; |
230
|
|
|
} |
231
|
|
|
|
232
|
|
|
// Bail out if no data points |
233
|
|
|
if ($startpoint == $numpoints) { |
234
|
|
|
return; |
235
|
|
|
} |
236
|
|
|
|
237
|
|
|
if ($this->iFastStroke) { |
238
|
|
|
$this->FastStroke($img, $xscale, $yscale, $startpoint, $exist_x); |
|
|
|
|
239
|
|
|
return; |
240
|
|
|
} |
241
|
|
|
|
242
|
|
|
if ($exist_x) { |
243
|
|
|
$xs = $this->coords[1][$startpoint]; |
244
|
|
|
} else { |
245
|
|
|
$xs = $textadj + $startpoint; |
246
|
|
|
} |
247
|
|
|
|
248
|
|
|
$img->SetStartPoint($xscale->Translate($xs), |
249
|
|
|
$yscale->Translate($this->coords[0][$startpoint])); |
250
|
|
|
|
251
|
|
|
if ($this->filled) { |
252
|
|
|
if ($this->fillFromMax) { |
253
|
|
|
//$max = $yscale->GetMaxVal(); |
|
|
|
|
254
|
|
|
$cord[$idx++] = $xscale->Translate($xs); |
|
|
|
|
255
|
|
|
$cord[$idx++] = $yscale->scale_abs[1]; |
256
|
|
|
} else { |
257
|
|
|
$min = $yscale->GetMinVal(); |
258
|
|
|
if ($min > 0 || $this->fillFromMin) { |
259
|
|
|
$fillmin = $yscale->scale_abs[0]; //Translate($min); |
260
|
|
|
} else { |
261
|
|
|
$fillmin = $yscale->Translate(0); |
262
|
|
|
} |
263
|
|
|
|
264
|
|
|
$cord[$idx++] = $xscale->Translate($xs); |
|
|
|
|
265
|
|
|
$cord[$idx++] = $fillmin; |
266
|
|
|
} |
267
|
|
|
} |
268
|
|
|
$xt = $xscale->Translate($xs); |
269
|
|
|
$yt = $yscale->Translate($this->coords[0][$startpoint]); |
270
|
|
|
$cord[$idx++] = $xt; |
|
|
|
|
271
|
|
|
$cord[$idx++] = $yt; |
272
|
|
|
$yt_old = $yt; |
273
|
|
|
$xt_old = $xt; |
274
|
|
|
$y_old = $this->coords[0][$startpoint]; |
275
|
|
|
|
276
|
|
|
$this->value->Stroke($img, $this->coords[0][$startpoint], $xt, $yt); |
277
|
|
|
|
278
|
|
|
$img->SetColor($this->color); |
279
|
|
|
$img->SetLineWeight($this->weight); |
280
|
|
|
$img->SetLineStyle($this->line_style); |
281
|
|
|
$pnts = $startpoint + 1; |
282
|
|
|
$firstnonumeric = false; |
283
|
|
|
|
284
|
|
|
while ($pnts < $numpoints) { |
285
|
|
View Code Duplication |
if ($exist_x) { |
|
|
|
|
286
|
|
|
$x = $this->coords[1][$pnts]; |
287
|
|
|
} else { |
288
|
|
|
$x = $pnts + $textadj; |
289
|
|
|
} |
290
|
|
|
$xt = $xscale->Translate($x); |
291
|
|
|
$yt = $yscale->Translate($this->coords[0][$pnts]); |
292
|
|
|
|
293
|
|
|
$y = $this->coords[0][$pnts]; |
294
|
|
|
if ($this->step_style) { |
295
|
|
|
// To handle null values within step style we need to record the |
296
|
|
|
// first non numeric value so we know from where to start if the |
297
|
|
|
// non value is '-'. |
298
|
|
|
if (is_numeric($y)) { |
299
|
|
|
$firstnonumeric = false; |
300
|
|
|
if (is_numeric($y_old)) { |
301
|
|
|
$img->StyleLine($xt_old, $yt_old, $xt, $yt_old); |
302
|
|
|
$img->StyleLine($xt, $yt_old, $xt, $yt); |
303
|
|
|
} elseif ($y_old == '-') { |
304
|
|
|
$img->StyleLine($xt_first, $yt_first, $xt, $yt_first); |
|
|
|
|
305
|
|
|
$img->StyleLine($xt, $yt_first, $xt, $yt); |
306
|
|
|
} else { |
307
|
|
|
$yt_old = $yt; |
308
|
|
|
$xt_old = $xt; |
|
|
|
|
309
|
|
|
} |
310
|
|
|
$cord[$idx++] = $xt; |
311
|
|
|
$cord[$idx++] = $yt_old; |
312
|
|
|
$cord[$idx++] = $xt; |
313
|
|
|
$cord[$idx++] = $yt; |
314
|
|
|
} elseif ($firstnonumeric == false) { |
|
|
|
|
315
|
|
|
$firstnonumeric = true; |
316
|
|
|
$yt_first = $yt_old; |
317
|
|
|
$xt_first = $xt_old; |
318
|
|
|
} |
319
|
|
|
} else { |
320
|
|
|
$tmp1 = $y; |
321
|
|
|
$prev = $this->coords[0][$pnts - 1]; |
322
|
|
View Code Duplication |
if ($tmp1 === '' || $tmp1 === null || $tmp1 === 'X') { |
|
|
|
|
323
|
|
|
$tmp1 = 'x'; |
324
|
|
|
} |
325
|
|
|
|
326
|
|
View Code Duplication |
if ($prev === '' || $prev === null || $prev === 'X') { |
|
|
|
|
327
|
|
|
$prev = 'x'; |
328
|
|
|
} |
329
|
|
|
|
330
|
|
|
if (is_numeric($y) || (is_string($y) && $y != '-')) { |
331
|
|
|
if (is_numeric($y) && (is_numeric($prev) || $prev === '-')) { |
332
|
|
|
$img->StyleLineTo($xt, $yt); |
333
|
|
|
} else { |
334
|
|
|
$img->SetStartPoint($xt, $yt); |
335
|
|
|
} |
336
|
|
|
} |
337
|
|
|
if ($this->filled && $tmp1 !== '-') { |
338
|
|
|
if ($tmp1 === 'x') { |
339
|
|
|
$cord[$idx++] = $cord[$idx - 3]; |
340
|
|
|
$cord[$idx++] = $fillmin; |
|
|
|
|
341
|
|
|
} elseif ($prev === 'x') { |
342
|
|
|
$cord[$idx++] = $xt; |
343
|
|
|
$cord[$idx++] = $fillmin; |
344
|
|
|
$cord[$idx++] = $xt; |
345
|
|
|
$cord[$idx++] = $yt; |
346
|
|
|
} else { |
347
|
|
|
$cord[$idx++] = $xt; |
348
|
|
|
$cord[$idx++] = $yt; |
349
|
|
|
} |
350
|
|
|
} else { |
351
|
|
|
if (is_numeric($tmp1) && (is_numeric($prev) || $prev === '-')) { |
352
|
|
|
$cord[$idx++] = $xt; |
353
|
|
|
$cord[$idx++] = $yt; |
354
|
|
|
} |
355
|
|
|
} |
356
|
|
|
} |
357
|
|
|
$yt_old = $yt; |
358
|
|
|
$xt_old = $xt; |
359
|
|
|
$y_old = $y; |
360
|
|
|
|
361
|
|
|
$this->StrokeDataValue($img, $this->coords[0][$pnts], $xt, $yt); |
362
|
|
|
|
363
|
|
|
++$pnts; |
364
|
|
|
} |
365
|
|
|
|
366
|
|
|
if ($this->filled) { |
367
|
|
|
$cord[$idx++] = $xt; |
368
|
|
|
if ($this->fillFromMax) { |
369
|
|
|
$cord[$idx++] = $yscale->scale_abs[1]; |
370
|
|
|
} else { |
371
|
|
|
if ($min > 0 || $this->fillFromMin) { |
372
|
|
|
$cord[$idx++] = $yscale->Translate($min); |
|
|
|
|
373
|
|
|
} else { |
374
|
|
|
$cord[$idx++] = $yscale->Translate(0); |
375
|
|
|
} |
376
|
|
|
} |
377
|
|
|
if ($this->fillgrad) { |
378
|
|
|
$img->SetLineWeight(1); |
379
|
|
|
$grad = new Gradient($img); |
380
|
|
|
$grad->SetNumColors($this->fillgrad_numcolors); |
381
|
|
|
$grad->FilledFlatPolygon($cord, $this->fillgrad_fromcolor, $this->fillgrad_tocolor); |
382
|
|
|
$img->SetLineWeight($this->weight); |
383
|
|
|
} else { |
384
|
|
|
$img->SetColor($this->fill_color); |
385
|
|
|
$img->FilledPolygon($cord); |
386
|
|
|
} |
387
|
|
|
if ($this->weight > 0) { |
388
|
|
|
$img->SetLineWeight($this->weight); |
389
|
|
|
$img->SetColor($this->color); |
390
|
|
|
// Remove first and last coordinate before drawing the line |
391
|
|
|
// sine we otherwise get the vertical start and end lines which |
392
|
|
|
// doesn't look appropriate |
393
|
|
|
$img->Polygon(array_slice($cord, 2, count($cord) - 4)); |
394
|
|
|
} |
395
|
|
|
} |
396
|
|
|
|
397
|
|
|
if (!empty($this->filledAreas)) { |
398
|
|
|
$minY = $yscale->Translate($yscale->GetMinVal()); |
399
|
|
|
$factor = ($this->step_style ? 4 : 2); |
400
|
|
|
|
401
|
|
|
for ($i = 0; $i < sizeof($this->filledAreas); ++$i) { |
|
|
|
|
402
|
|
|
// go through all filled area elements ordered by insertion |
403
|
|
|
// fill polygon array |
404
|
|
|
$areaCoords[] = $cord[$this->filledAreas[$i][0] * $factor]; |
|
|
|
|
405
|
|
|
$areaCoords[] = $minY; |
|
|
|
|
406
|
|
|
|
407
|
|
|
$areaCoords = |
408
|
|
|
array_merge($areaCoords, |
409
|
|
|
array_slice($cord, |
410
|
|
|
$this->filledAreas[$i][0] * $factor, |
411
|
|
|
($this->filledAreas[$i][1] - $this->filledAreas[$i][0] + ($this->step_style ? 0 : 1)) * $factor)); |
412
|
|
|
$areaCoords[] = $areaCoords[sizeof($areaCoords) - 2]; // last x |
413
|
|
|
$areaCoords[] = $minY; // last y |
414
|
|
|
|
415
|
|
|
if ($this->filledAreas[$i][3]) { |
416
|
|
|
$img->SetColor($this->filledAreas[$i][2]); |
417
|
|
|
$img->FilledPolygon($areaCoords); |
418
|
|
|
$img->SetColor($this->color); |
419
|
|
|
} |
420
|
|
|
// Check if we should draw the frame. |
421
|
|
|
// If not we still re-draw the line since it might have been |
422
|
|
|
// partially overwritten by the filled area and it doesn't look |
423
|
|
|
// very good. |
424
|
|
|
if ($this->filledAreas[$i][4]) { |
425
|
|
|
$img->Polygon($areaCoords); |
426
|
|
|
} else { |
427
|
|
|
$img->Polygon($cord); |
428
|
|
|
} |
429
|
|
|
|
430
|
|
|
$areaCoords = array(); |
431
|
|
|
} |
432
|
|
|
} |
433
|
|
|
|
434
|
|
|
if (!is_object($this->mark) || $this->mark->type == -1 || $this->mark->show == false) { |
|
|
|
|
435
|
|
|
return; |
436
|
|
|
} |
437
|
|
|
|
438
|
|
|
for ($pnts = 0; $pnts < $numpoints; ++$pnts) { |
439
|
|
View Code Duplication |
if ($exist_x) { |
|
|
|
|
440
|
|
|
$x = $this->coords[1][$pnts]; |
441
|
|
|
} else { |
442
|
|
|
$x = $pnts + $textadj; |
443
|
|
|
} |
444
|
|
|
$xt = $xscale->Translate($x); |
445
|
|
|
$yt = $yscale->Translate($this->coords[0][$pnts]); |
446
|
|
|
|
447
|
|
|
if (is_numeric($this->coords[0][$pnts])) { |
448
|
|
View Code Duplication |
if (!empty($this->csimtargets[$pnts])) { |
|
|
|
|
449
|
|
|
if (!empty($this->csimwintargets[$pnts])) { |
450
|
|
|
$this->mark->SetCSIMTarget($this->csimtargets[$pnts], $this->csimwintargets[$pnts]); |
451
|
|
|
} else { |
452
|
|
|
$this->mark->SetCSIMTarget($this->csimtargets[$pnts]); |
453
|
|
|
} |
454
|
|
|
$this->mark->SetCSIMAlt($this->csimalts[$pnts]); |
455
|
|
|
} |
456
|
|
|
if ($exist_x) { |
457
|
|
|
$x = $this->coords[1][$pnts]; |
458
|
|
|
} else { |
459
|
|
|
$x = $pnts; |
460
|
|
|
} |
461
|
|
|
$this->mark->SetCSIMAltVal($this->coords[0][$pnts], $x); |
462
|
|
|
$this->mark->Stroke($img, $xt, $yt); |
463
|
|
|
$this->csimareas .= $this->mark->GetCSIMAreas(); |
464
|
|
|
} |
465
|
|
|
} |
466
|
|
|
} |
467
|
|
|
} // Class |
468
|
|
|
|
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.