Subject: | Using range_round with large positive data values gives a min that's below zero! [PATCH] |
Mn values that are already on a 'step' shouldn't be adjusted:
--- lib/perl5/URI/GoogleChart.pm (revision 9182)
+++ lib/perl5/URI/GoogleChart.pm (working copy)
@@ -300,7 +300,9 @@
$step /= 10 if $step / $range >= 0.1;
$step *= 5 if $step / $range < 0.05;
- $min = floor($min / $step - 0.2) * $step;
+ # step down the min unless it's already on a good step
+ $min = floor($min / $step - 0.2) * $step
+ unless floor($min / $step) * $step == $min;
$max = ceil($max / $step + 0.2) * $step;
# zero based minimum is usually a good thing so make it more likely