Class: Gruff::Box
Overview
Constant Summary
Constants inherited from Base
Gruff::Base::DEFAULT_MARGIN, Gruff::Base::DEFAULT_TARGET_WIDTH, Gruff::Base::LABEL_MARGIN, Gruff::Base::LEGEND_MARGIN
Instance Attribute Summary collapse
-
#fill_opacity ⇒ Object
writeonly
Specifies the filling opacity in area graph.
-
#stroke_width ⇒ Object
writeonly
Specifies the stroke width in line.
Attributes inherited from Base
#bottom_margin, #colors, #hide_legend, #hide_line_markers, #hide_line_numbers, #hide_title, #label_margin, #label_max_size, #label_truncation_style, #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_margin, #top_margin, #x_axis_increment, #x_axis_label_format, #y_axis_increment, #y_axis_label_format
Instance Method Summary collapse
-
#spacing_factor=(space_percent) ⇒ Object
Can be used to adjust the spaces between the bars.
Methods inherited from Base
#add_color, #bold_title=, #data, #draw, #font=, #font_color=, #initialize, #label_rotation=, #label_stagger_height=, #labels=, #legend_font_size=, #margins=, #marker_font_size=, #replace_colors, #theme=, #theme_37signals, #theme_greyscale, #theme_keynote, #theme_odeo, #theme_pastel, #theme_rails_keynote, #title=, #title_font=, #title_font_size=, #to_blob, #to_image, #transparent_background=, #write
Constructor Details
This class inherits a constructor from Gruff::Base
Instance Attribute Details
#fill_opacity=(value) ⇒ Object (writeonly)
Specifies the filling opacity in area graph. Default is 0.2
.
14 15 16 |
# File 'lib/gruff/box.rb', line 14 def fill_opacity=(value) @fill_opacity = value end |
#stroke_width=(value) ⇒ Object (writeonly)
Specifies the stroke width in line. Default is 3.0
.
17 18 19 |
# File 'lib/gruff/box.rb', line 17 def stroke_width=(value) @stroke_width = value end |
Instance Method Details
#spacing_factor=(space_percent) ⇒ Object
Can be used to adjust the spaces between the bars. Accepts values between 0.00 and 1.00 where 0.00 means no spacing at all and 1 means that each bars’ width is nearly 0 (so each bar is a simple line with no x dimension).
Default value is 0.8
.
25 26 27 28 29 |
# File 'lib/gruff/box.rb', line 25 def spacing_factor=(space_percent) raise ArgumentError, 'spacing_factor must be between 0.00 and 1.00' if (space_percent < 0) || (space_percent > 1) @spacing_factor = (1 - space_percent) end |