Class: Gruff::Net

Inherits:
Base
  • Object
show all
Defined in:
lib/gruff/net.rb

Overview

See also the Spider graph.

Here's how to make a Gruff::Net.

g = Gruff::Net.new
g.title = "Net Graph"
g.labels = {
  0 => '5/6',
  1 => '5/15',
  2 => '5/24',
  3 => '5/30',
  4 => '6/4',
  5 => '6/12',
  6 => '6/21',
  7 => '6/28'
}
g.line_width = 3
g.dot_radius = 4
g.data :Jimmy, [25, 36, 86, 39, 25, 31, 79, 88]
g.data :Julie, [22, 29, 35, 38, 36, 40, 46, 57]
g.write("net.png")

Constant Summary

Constants inherited from Base

Base::DEFAULT_MARGIN, Base::DEFAULT_TARGET_WIDTH, Base::LABEL_MARGIN, Base::LEGEND_MARGIN

Instance Attribute Summary collapse

Attributes inherited from Base

#bottom_margin, #colors, #hide_legend, #hide_line_markers, #hide_line_numbers, #hide_title, #label_max_size, #label_stagger_height, #label_truncation_style, #labels, #left_margin, #legend_at_bottom, #legend_box_size, #legend_margin, #marker_color, #marker_shadow_color, #maximum_value, #minimum_value, #no_data_message, #right_margin, #sort, #sorted_drawing, #title, #title_margin, #top_margin, #x_axis_increment, #x_axis_label_format, #y_axis_increment, #y_axis_label_format

Method Summary

Methods inherited from Base

#add_color, #bold_title=, #data, #draw, #font=, #font_color=, #initialize, #legend_font_size=, #margins=, #marker_font_size=, #replace_colors, #theme=, #theme_37signals, #theme_greyscale, #theme_keynote, #theme_odeo, #theme_pastel, #theme_rails_keynote, #title_font=, #title_font_size=, #to_blob, #to_image, #write

Constructor Details

This class inherits a constructor from Gruff::Base

Instance Attribute Details

#dot_radius=(value) ⇒ Object (writeonly)

Sets the attribute dot_radius

Parameters:

  • value

    the value to set the attribute dot_radius to.


31
32
33
# File 'lib/gruff/net.rb', line 31

def dot_radius=(value)
  @dot_radius = value
end

#hide_dots=(value) ⇒ Object (writeonly)

Hide parts of the graph to fit more data points, or for a different appearance.


27
28
29
# File 'lib/gruff/net.rb', line 27

def hide_dots=(value)
  @hide_dots = value
end

#line_width=(value) ⇒ Object (writeonly)

Dimensions of lines and dots; calculated based on dataset size if left unspecified.


30
31
32
# File 'lib/gruff/net.rb', line 30

def line_width=(value)
  @line_width = value
end