Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.1.3
-
Fix Version/s: 3.2
-
Component/s: CiviReport, Core CiviCRM
-
Labels:None
Description
Starting at line 86 of civicrm/CRM/Utils/OpenFlashChart.php we have:
// calculate max scale for graph.
$yMax = max( $yValues );
if ( $mod = $yMax%(str_pad( 5, strlen($yMax)-1, 0)))
This code works fine if $yMax is set in the first line to an integer value, but if it is a decimal value, with two places (like a currency value) then the following 3 lines will reset it to be far too high. If it's 85000.23 for example, then the $yMax will come out 5000000.23. If we use this as the first line:
$yMax = round( max( $yValues ));
however, then 85000.23 is recalculated as 90000, which is correct.