Class: GoogleChart::BarChart
- Inherits:
-
AbstractChart
- Object
- AbstractChart
- GoogleChart::BarChart
- Defined in:
- lib/google_chart/bar_chart.rb
Constant Summary collapse
- @@orientations =
{:horizontal => 'h', :vertical => 'v'}
- @@groupings =
{:group => 'g', :stack => 's', :overlap => 's'}
Instance Attribute Summary collapse
-
#grouping ⇒ Object
writeonly
Sets the attribute grouping.
-
#orientation ⇒ Object
writeonly
Sets the attribute orientation.
Attributes included from Data
Attributes included from BarStyle
Attributes inherited from AbstractChart
Instance Method Summary collapse
Methods included from Title
Methods included from RangeMarker
Methods included from Legend
Methods included from GridLine
Methods included from Data
Methods included from Color
Methods included from BarStyle
Methods included from Axis
Methods inherited from AbstractChart
inherited, #initialize, register!, registered?, registry, #to_url
Constructor Details
This class inherits a constructor from GoogleChart::AbstractChart
Instance Attribute Details
#grouping=(value) ⇒ Object (writeonly)
Sets the attribute grouping
17 18 19 |
# File 'lib/google_chart/bar_chart.rb', line 17 def grouping=(value) @grouping = value end |
#orientation=(value) ⇒ Object (writeonly)
Sets the attribute orientation
17 18 19 |
# File 'lib/google_chart/bar_chart.rb', line 17 def orientation=(value) @orientation = value end |
Instance Method Details
#chart_type ⇒ Object
23 24 25 26 27 |
# File 'lib/google_chart/bar_chart.rb', line 23 def chart_type @grouping ||= :group @orientation ||= :vertical "cht=b#{@@orientations[@orientation]}#{@@groupings[@grouping]}" end |
#horizontal=(arg) ⇒ Object
19 20 21 |
# File 'lib/google_chart/bar_chart.rb', line 19 def horizontal=(arg) self.orientation = arg ? :horizontal : :vertical end |