Experimental!!! See also the Net graph.
Submitted by Kevin Clark glu.ttono.us/
# File lib/gruff/spider.rb, line 31 def draw @hide_line_markers = true super return unless @has_data # Setup basic positioning diameter = @graph_height radius = @graph_height / 2.0 top_x = @graph_left + (@graph_width - diameter) / 2.0 center_x = @graph_left + (@graph_width / 2.0) center_y = @graph_top + (@graph_height / 2.0) - 25 # Move graph up a bit @unit_length = radius / @max_value total_sum = sums_for_spider prev_degrees = 0.0 additive_angle = (2 * Math::PI)/ @data.size current_angle = rotation * Math::PI / 180.0 # Draw axes draw_axes(center_x, center_y, radius, additive_angle) unless hide_axes # Draw polygon draw_polygon(center_x, center_y, additive_angle) @d.draw(@base_image) end
Generated with the Darkfish Rdoc Generator 2.