Permalink
Browse files

Merge pull request #22 from prikha/master

Fixed a ZeroDivision BUG that appears when you launch the first example.
  • Loading branch information...
2 parents 777cd05 + f509844 commit 223c7b732c63c506487f604183b97188ccfeced6 @topfunky committed Jun 6, 2012
Showing with 4 additions and 1 deletion.
  1. +3 −0 README.txt
  2. +1 −1 lib/gruff/base.rb
View
@@ -1,3 +1,6 @@
+== MAIN FIX
+ Zero Division Problem
+
== Gruff Graphs
A library for making beautiful graphs.
View
@@ -1066,7 +1066,7 @@ def increment_color
# Return a formatted string representing a number value that should be
# printed as a label.
def label(value)
- label = if (@spread.to_f % @marker_count.to_f == 0) || !@y_axis_increment.nil?
+ label = if (@spread.to_f % (@marker_count.to_f==0 ? 1 : @marker_count.to_f) == 0) || !@y_axis_increment.nil?
value.to_i.to_s
elsif @spread > 10.0
sprintf("%0i", value)

0 comments on commit 223c7b7

Please sign in to comment.