Permalink
Browse files

Fixed issue when calculating significant, if marker_count is 0 there …

…is a divide by zero error
  • Loading branch information...
1 parent ff2b00e commit f64613d8ae2aed1ca87f12db11512f1c2c0999db @BRIMIL01 BRIMIL01 committed with BRIMIL01 Dec 23, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/gruff/base.rb
View
@@ -601,7 +601,7 @@ def draw_line_markers
end
@marker_count ||= 4
end
- @increment = (@spread > 0) ? significant(@spread / @marker_count) : 1
+ @increment = (@spread > 0 && @marker_count > 0) ? significant(@spread / @marker_count) : 1
else
# TODO Make this work for negative values
@maximum_value = [@maximum_value.ceil, @y_axis_increment].max

0 comments on commit f64613d

Please sign in to comment.