From 3c633e5e2f47e159c258e88539faa18662133ddc Mon Sep 17 00:00:00 2001 From: Daniel Barreto Date: Fri, 11 Apr 2014 13:46:12 -0500 Subject: [PATCH] Update drawBarGraph() to draw also the value -refs #6876 --- main/inc/lib/pchart/pChart.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main/inc/lib/pchart/pChart.class.php b/main/inc/lib/pchart/pChart.class.php index c2cbb10db0..b8132ab32b 100755 --- a/main/inc/lib/pchart/pChart.class.php +++ b/main/inc/lib/pchart/pChart.class.php @@ -2006,6 +2006,7 @@ if ( is_numeric($Data[$Key][$ColName]) ) { $Value = $Data[$Key][$ColName]; + $ValueWidth = strlen("$Value") * 6; $YPos = $this->GArea_Y2 - (($Value-$this->VMin) * $this->DivisionRatio); /* Save point into the image map if option activated */ @@ -2017,6 +2018,7 @@ if ( $Shadow && $Alpha == 100 ) $this->drawRectangle($XPos+1,$YZero,$XPos+$SeriesWidth-1,$YPos,25,25,25,TRUE,$Alpha); $this->drawFilledRectangle($XPos+1,$YZero,$XPos+$SeriesWidth-1,$YPos,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"],TRUE,$Alpha); + imagettftext($this->Picture, $this->FontSize, 0, $XPos + ($SeriesWidth / 2) - ($ValueWidth / 2), $YPos - 2, $ColorID, $this->FontName, $Value); } } $XPos = $XPos + $this->DivisionWidth;