Using y_axis_increment with a line graph gives:
ArgumentError in StatsController#graph_outings_test
wrong number of arguments (1 for 0)
RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace
#{RAILS_ROOT}/lib/gruff/base.rb:581:in `normalize'
#{RAILS_ROOT}/lib/gruff/base.rb:581:in `draw_line_markers'
#{RAILS_ROOT}/lib/gruff/base.rb:434:in `setup_drawing'
#{RAILS_ROOT}/lib/gruff/base.rb:404:in `draw'
#{RAILS_ROOT}/lib/gruff/line.rb:38:in `draw'
#{RAILS_ROOT}/lib/gruff/base.rb:391:in `to_blob'
#{RAILS_ROOT}/app/controllers/stats_controller.rb:59:in `graph_outings_test'
The code for graph_outings_test is:
g = Gruff::Line.new(500)
g.y_axis_increment = 1
g.title = "Uscite per spot"
g.data("Outings", [5,2,2,3])
g.data("Outings2", [1,4,6,8])
g.minimum_value = 0
send_data(g.to_blob,
:disposition => 'inline',
:type => 'image/png',
:filename => "outings_per_spot.png")
I changed the file line.rb from:
def normalize()
into
def normalize(force=false)
and now it works. |