pChart 2.x forum
http://wiki.pchart.net/forum/

Bug (+fix) in pImage::drawBarChart displayFont
http://wiki.pchart.net/forum/viewtopic.php?f=5&t=2370
Page 1 of 1

Author:  gdhn [ Wed Feb 15, 2012 1:20 pm ]
Post subject:  Bug (+fix) in pImage::drawBarChart displayFont

pChart 2.1.3 line 4431 and 4432:

$DisplayFont = isset($Format["DisplaySize"]) ? $Format["DisplaySize"] : $this->FontName;
$DisplaySize = isset($Format["DisplaySize"]) ? $Format["DisplaySize"] : $this->FontSize;

The mistake is clear (DisplaySize should be DisplayFont), and leads to Error: "imagettfbbox() [function.imagettfbbox]: Could not find/open font"

Regards,
Gerben

Patch:
Code:
Index: util/phplib/pChart/pDraw.class.php
===================================================================
--- util/phplib/pChart/pDraw.class.php   (revision 7395)
+++ util/phplib/pChart/pDraw.class.php   (working copy)
@@ -4428,7 +4428,7 @@
      $DisplayOrientation = isset($Format["DisplayOrientation"]) ? $Format["DisplayOrientation"] : ORIENTATION_HORIZONTAL;
      $DisplayOffset   = isset($Format["DisplayOffset"]) ? $Format["DisplayOffset"] : 2;
      $DisplayColor   = isset($Format["DisplayColor"]) ? $Format["DisplayColor"] : DISPLAY_MANUAL;
-     $DisplayFont   = isset($Format["DisplaySize"]) ? $Format["DisplaySize"] : $this->FontName;
+     $DisplayFont   = isset($Format["DisplayFont"]) ? $Format["DisplayFont"] : $this->FontName;
      $DisplaySize   = isset($Format["DisplaySize"]) ? $Format["DisplaySize"] : $this->FontSize;
      $DisplayPos   = isset($Format["DisplayPos"]) ? $Format["DisplayPos"] : LABEL_POS_OUTSIDE;
      $DisplayShadow   = isset($Format["DisplayShadow"]) ? $Format["DisplayShadow"] : TRUE;

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/