From 328decccb4b2f4bfa9f32ad1999baf9ad4fc051a Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Thu, 31 Mar 2011 10:06:49 +0000 Subject: [PATCH] 2011-03-31 Sergio Martin * include/graphs/pChart/pDraw.class.php: Fixed pchart library bug with default value for forcetransparency attribute. Changed from NULL to -1 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4154 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++++++ .../include/graphs/pChart/pDraw.class.php | 12 ++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 414d879c0f..5716be96d6 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2011-03-31 Sergio Martin + + * include/graphs/pChart/pDraw.class.php: Fixed + pchart library bug with default value for + forcetransparency attribute. Changed from NULL + to -1 + 2011-03-31 Miguel de Dios * include/functions_graph.php, include/graphs/functions_fsgraph.php: add diff --git a/pandora_console/include/graphs/pChart/pDraw.class.php b/pandora_console/include/graphs/pChart/pDraw.class.php index 2d5db6948b..5656daf973 100755 --- a/pandora_console/include/graphs/pChart/pDraw.class.php +++ b/pandora_console/include/graphs/pChart/pDraw.class.php @@ -3040,7 +3040,7 @@ $DisplayB = isset($Format["DisplayB"]) ? $Format["DisplayB"] : 0; $Data = $this->DataSet->getData(); - + debugPrint($Data, '/tmp/logo'); list($XMargin,$XDivs) = $this->scaleGetXSettings(); foreach($Data["Series"] as $SerieName => $Serie) { @@ -3525,7 +3525,7 @@ $DisplayValues = isset($Format["DisplayValues"]) ? $Format["DisplayValues"] :FALSE; $DisplayOffset = isset($Format["DisplayOffset"]) ? $Format["DisplayOffset"] : 2; $DisplayColor = isset($Format["DisplayColor"]) ? $Format["DisplayColor"] : DISPLAY_MANUAL; - $ForceTransparency = isset($Format["ForceTransparency"]) ? $Format["ForceTransparency"] : NULL; + $ForceTransparency = isset($Format["ForceTransparency"]) ? $Format["ForceTransparency"] : -1; $DisplayR = isset($Format["DisplayR"]) ? $Format["DisplayR"] : 0; $DisplayG = isset($Format["DisplayG"]) ? $Format["DisplayG"] : 0; $DisplayB = isset($Format["DisplayB"]) ? $Format["DisplayB"] : 0; @@ -3547,7 +3547,7 @@ $Unit = $Data["Axis"][$AxisID]["Unit"]; $Color = array("R"=>$R,"G"=>$G,"B"=>$B); - if ( $ForceTransparency != NULL ) { $Color["Alpha"] = $ForceTransparency; } else { $Color["Alpha"] = $Alpha; } + if ( $ForceTransparency != -1 ) { $Color["Alpha"] = $ForceTransparency; } else { $Color["Alpha"] = $Alpha; } $PosArray = $this->scaleComputeY($Serie["Data"],array("AxisID"=>$Serie["Axis"])); $YZero = $this->scaleComputeY(0,array("AxisID"=>$Serie["Axis"])); @@ -3733,7 +3733,7 @@ $Areas[$AreaID][] = $LastX; if ( $AroundZero ) { $Areas[$AreaID][] = $YZero; } else { $Areas[$AreaID][] = $this->GraphAreaY2-1; } - $Alpha = $ForceTransparency != NULL ? $ForceTransparency : $Alpha; + $Alpha = $ForceTransparency != -1 ? $ForceTransparency : $Alpha; $Color = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha); foreach($Areas as $Key => $Points) $this->drawPolygon($Points,$Color); @@ -3785,7 +3785,7 @@ if ( $AroundZero ) { $Areas[$AreaID][] = $YZero; } else { $Areas[$AreaID][] = $this->GraphAreaX1+1; } $Areas[$AreaID][] = $LastY; - $Alpha = $ForceTransparency != NULL ? $ForceTransparency : $Alpha; + $Alpha = $ForceTransparency != -1 ? $ForceTransparency : $Alpha; $Color = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha); foreach($Areas as $Key => $Points) $this->drawPolygon($Points,$Color); @@ -4357,7 +4357,7 @@ { $R = $Serie["Color"]["R"]; $G = $Serie["Color"]["G"]; $B = $Serie["Color"]["B"]; $Alpha = $Serie["Color"]["Alpha"]; $Ticks = $Serie["Ticks"]; - if ( $ForceTransparency != NULL ) { $Alpha = $ForceTransparency; } + if ( $ForceTransparency != -1 ) { $Alpha = $ForceTransparency; } if ( $DisplayColor == DISPLAY_AUTO ) { $DisplayR = 255; $DisplayG = 255; $DisplayB = 255; } if ( $Surrounding != NULL ) { $BorderR = $R+$Surrounding; $BorderG = $G+$Surrounding; $BorderB = $B+$Surrounding; }