Patches: Browse | Submit New | Admin

[#19141] Fix y_axis_increment for line graphs

Date:
2008-03-27 21:12
Priority:
3
Submitted By:
Laurel Fan (laurelfan)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Fix y_axis_increment for line graphs

Detailed description
Fix bug 9101: http://rubyforge.org/tracker/index.php?func=detail&aid=9109&group_id=1044&atid=4081

Where Line graphs with y_axis_increment set are raising this exception when they are drawn:
 
ArgumentError: wrong number of arguments (1 for 0)
    /usr/local/lib/ruby/gems/1.8/gems/gruff-0.3.1/lib/gruff/base.rb:661:in `normalize'
    /usr/local/lib/ruby/gems/1.8/gems/gruff-0.3.1/lib/gruff/base.rb:661:in `draw_line_markers'
    /usr/local/lib/ruby/gems/1.8/gems/gruff-0.3.1/lib/gruff/base.rb:513:in `setup_drawing'
    /usr/local/lib/ruby/gems/1.8/gems/gruff-0.3.1/lib/gruff/base.rb:485:in `draw'
    /usr/local/lib/ruby/gems/1.8/gems/gruff-0.3.1/lib/gruff/line.rb:49:in `draw'
    /usr/local/lib/ruby/gems/1.8/gems/gruff-0.3.1/lib/gruff/base.rb:470:in `to_blob'


This patch includes a test for the bug and the (very) simple fix.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2009-05-08 21:32
Sender: Nils o. Janus

With this fix, my current version from GitHub ran into the following
error:
wrong number of arguments (1 for 0)
/home/noj/Projectz/StudStatz/vendor/plugins/gruff/lib/gruff/base.
rb:675:in `normalize'
/home/noj/Projectz/StudStatz/vendor/plugins/gruff/lib/gruff/base.
rb:675:in `draw_line_markers'
/home/noj/Projectz/StudStatz/vendor/plugins/gruff/lib/gruff/base.
rb:524:in `setup_drawing'

where changing line 675 of base.rb from normalize(true) to normalize(
) did the trick.

More information:
http://blog.janus.cx/archives/274-Gruff-line-graph,-y_axis_increm
ent,-wrong-number-of-arguments-1-for-0.html

Attached Files:

Name Description Download
fix-normalize.diff patch to fix the Line::normalize method to fix y_axis_increment Download

Changes:

Field Old Value Date By
File Added3519: fix-normalize.diff2008-03-27 21:12laurelfan