Update drawBarGraph() to draw also the value -refs #6876

1.9.x
Daniel Barreto 12 years ago
parent 4593b2ca78
commit 3c633e5e2f
  1. 2
      main/inc/lib/pchart/pChart.class.php

@ -2006,6 +2006,7 @@
if ( is_numeric($Data[$Key][$ColName]) ) if ( is_numeric($Data[$Key][$ColName]) )
{ {
$Value = $Data[$Key][$ColName]; $Value = $Data[$Key][$ColName];
$ValueWidth = strlen("$Value") * 6;
$YPos = $this->GArea_Y2 - (($Value-$this->VMin) * $this->DivisionRatio); $YPos = $this->GArea_Y2 - (($Value-$this->VMin) * $this->DivisionRatio);
/* Save point into the image map if option activated */ /* Save point into the image map if option activated */
@ -2017,6 +2018,7 @@
if ( $Shadow && $Alpha == 100 ) if ( $Shadow && $Alpha == 100 )
$this->drawRectangle($XPos+1,$YZero,$XPos+$SeriesWidth-1,$YPos,25,25,25,TRUE,$Alpha); $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); $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; $XPos = $XPos + $this->DivisionWidth;

Loading…
Cancel
Save