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

Division by zero in /class/pDraw.class.php on line 3102
http://wiki.pchart.net/forum/viewtopic.php?f=1&t=2536
Page 1 of 1

Author:  neofutur [ Fri Mar 23, 2012 2:42 am ]
Post subject:  Division by zero in /class/pDraw.class.php on line 3102

hi all,

still working on my historical graph for the namecoin currency, I find this php warning :

Code:
PHP Warning:  Division by zero in /.../class/pDraw.class.php on line 3102

in my apache error_log

the code is :
Code:
     if ( $Data["Orientation"] == SCALE_POS_LEFTRIGHT )
      {
       $Height      = ($this->GraphAreaY2 - $this->GraphAreaY1) - $Data["Axis"][$AxisID]["Margin"]*2;
       $ScaleHeight = $Data["Axis"][$AxisID]["ScaleMax"] - $Data["Axis"][$AxisID]["ScaleMin"];
       $Step        = $Height / $ScaleHeight;


so, I suppose my $ScaleHeight is 0 this point

could this be a bug of scaleComputeY function or could I have forgotten something ?

the default test2.php example is not generating this error, my modified example works :

Image

but triggers this division by zero ;(

any clues ?

PS : BEWARE ! your forum seem to be infested with spam ( I just found those :
viewtopic.php?f=1&t=2534
viewtopic.php?f=1&t=2535

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