Class: SVG::Graph::BarBase
Overview
Synopsis
A superclass for bar-style graphs. Do not attempt to instantiate directly; use one of the subclasses instead.
Author
Sean E. Russell <serATgermaneHYPHENsoftwareDOTcom>
Copyright 2004 Sean E. Russell This software is available under the Ruby license[LICENSE.txt]
Direct Known Subclasses
Constant Summary
Constants inherited from Graph
Instance Attribute Summary
-
- (Object) bar_gap
Whether to have a gap between the bars or not, default.
-
- (Object) stack
How to stack data sets.
Instance Method Summary
-
- (BarBase) initialize(config)
constructor
Ensures that :fields are provided in the configuration.
-
- (Object) set_defaults
In addition to the defaults set in Graph::initialize, sets
- bar_gap
- true
- stack
- :overlap.
Methods inherited from Graph
Constructor Details
- (BarBase) initialize(config)
Ensures that :fields are provided in the configuration.
20 21 22 23 24 25 |
# File 'lib/SVG/Graph/BarBase.rb', line 20 def initialize config raise "fields was not supplied or is empty" unless config[:fields] && config[:fields].kind_of?(Array) && config[:fields].length > 0 super end |
Instance Attribute Details
- (Object) bar_gap
Whether to have a gap between the bars or not, default
is true, set to false if you don't want gaps.
36 37 38 |
# File 'lib/SVG/Graph/BarBase.rb', line 36 def end |
- (Object) stack
How to stack data sets. :overlap overlaps bars with
transparent colors, :top stacks on top of one another, :side stacks the side-by-side. Defaults to :overlap.
40 41 42 |
# File 'lib/SVG/Graph/BarBase.rb', line 40 def stack @stack end |
Instance Method Details
- (Object) set_defaults
In addition to the defaults set in Graph::initialize, sets
- bar_gap
- true
- stack
- :overlap
30 31 32 |
# File 'lib/SVG/Graph/BarBase.rb', line 30 def set_defaults init_with( :bar_gap => true, :stack => :overlap ) end |