Permalink
Browse files

Fix exception when y_axis_increment is used in line bars

  • Loading branch information...
1 parent 508a80d commit d5bad04b049c4657ca3d07d3a3e8bd441f74b1d1 @bhaak committed Nov 20, 2011
Showing with 13 additions and 2 deletions.
  1. +2 −2 lib/gruff/line.rb
  2. +11 −0 test/test_line.rb
View
@@ -109,9 +109,9 @@ def draw
@d.draw(@base_image)
end
- def normalize
+ def normalize(force=false)
@maximum_value = [@maximum_value.to_f, @baseline_value.to_f].max
- super
+ super(force)
@norm_baseline = (@baseline_value.to_f / @maximum_value.to_f) if @baseline_value
end
View
@@ -482,6 +482,17 @@ def test_marker_label_accuracy
g.write("test/output/line_marker_label_accuracy.png")
end
+ def test_y_axis_increment
+ g = Gruff::Line.new
+ g.title = "y axis increment"
+
+ g.data('data', [1,2,3])
+
+ g.y_axis_increment = 1
+
+ g.write("test/output/line_y_axis_increment.png")
+ end
+
private

0 comments on commit d5bad04

Please sign in to comment.