bug: drawScale infinite loop
Status: Beta
Brought to you by:
ayashisunyday
in drawScale() the while(!$ScaleOk) {} loop is sometimes infinite. For example,
$VMax = 8.8
$VMin = 0.0 (i.e. addallstart0)
$Factor = 1
$MinDivHeight = 25
$GArea_Y2 = 130
$GArea_Y1 = 30
so $MaxDivs = 4, $Scale1 = 8.8, $Scale2 = 4.4. Both are above $MaxDivs, but then $Scale2>1 so $Factor->10 and now both Scale1/2 are < 1, so $Factor->1.
dylan
Seems that I can report the same problem:
<b>Fatal error</b>: Maximum execution time of 60 seconds exceeded in <b>/.../pChart-1.27d/pChart/pChart.class</b> on line <b>468</b><br />
Is there at least a workaround available?
workaround:
add:
if ( $Scale4 > 1 && $Scale4 <= $MaxDivs && !$ScaleOk) { $ScaleOk = TRUE; $Divisions = floor($Scale4); $Scale = 4;}
after:
if ( $Scale1 > 1 && $Scale1 <= $MaxDivs && !$ScaleOk) { $ScaleOk = TRUE; $Divisions = floor($Scale1); $Scale = 1;}
if ( $Scale2 > 1 && $Scale2 <= $MaxDivs && !$ScaleOk) { $ScaleOk = TRUE; $Divisions = floor($Scale2); $Scale = 2;}
seems to work without side effects :-)
Thanks bonexx! It works!