[PATCH] add Threshold to drawPlotChart
Change the color of the dot if the value is above or below of the Threshold min or max
Code:
--- pDraw.class.php (revisione 180)
+++ pDraw.class.php (copia locale)
@@ -3334,6 +3334,7 @@
$DisplayR = isset($Format["DisplayR"]) ? $Format["DisplayR"] : 0;
$DisplayG = isset($Format["DisplayG"]) ? $Format["DisplayG"] : 0;
$DisplayB = isset($Format["DisplayB"]) ? $Format["DisplayB"] : 0;
+ $Threshold = isset($Format["Threshold"]) ? $Format["Threshold"] : NULL;
$RecordImageMap = isset($Format["RecordImageMap"]) ? $Format["RecordImageMap"] : FALSE;
$this->LastChartLayout = CHART_LAST_LAYOUT_REGULAR;
@@ -3387,7 +3388,21 @@
if ( $Picture != NULL )
{ $this->drawFromPicture($PicType,$Picture,$X-$PicWidth/2,$Y-$PicHeight/2); }
else
- { $this->drawShape($X,$Y,$Shape,$SerieWeight,$PlotBorder,$BorderSize,$R,$G,$B,$Alpha,$BorderR,$BorderG,$BorderB,$BorderAlpha); }
+ {
+ $SerieR = $R;
+ $SerieG = $G;
+ $SerieB = $B;
+ if ( $Threshold != NULL )
+ {
+ if ($Serie["Data"][$Key] <= $Threshold["Min"] || $Serie["Data"][$Key] >= $Threshold["Max"])
+ {
+ $SerieR = $Threshold["R"];
+ $SerieG = $Threshold["G"];
+ $SerieB = $Threshold["B"];
+ }
+ }
+ $this->drawShape($X,$Y,$Shape,$SerieWeight,$PlotBorder,$BorderSize,$SerieR,$SerieG,$SerieB,$Alpha,$BorderR,$BorderG,$BorderB,$BorderAlpha);
+ }
}
$X = $X + $XStep;
}