Menu

#9 bug: drawScale infinite loop

open
nobody
None
5
2008-09-24
2008-09-24
No

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

Discussion

  • Matthias Broenner

    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?

     
  • Matthias Broenner

    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 :-)

     
  • Roberto

    Roberto - 2011-05-25

    Thanks bonexx! It works!

     

Log in to post a comment.

MongoDB Logo MongoDB