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 =
{:grouped => 'g', :stacked => 's'}
Instance Attribute Summary collapse
-
#grouping ⇒ Object
writeonly
Sets the attribute grouping.
-
#orientation ⇒ Object
writeonly
Sets the attribute orientation.
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
15 16 17 |
# File 'lib/google_chart/bar_chart.rb', line 15 def grouping=(value) @grouping = value end |
#orientation=(value) ⇒ Object (writeonly)
Sets the attribute orientation
15 16 17 |
# File 'lib/google_chart/bar_chart.rb', line 15 def orientation=(value) @orientation = value end |
Instance Method Details
#chart_type ⇒ Object
25 26 27 28 29 |
# File 'lib/google_chart/bar_chart.rb', line 25 def chart_type @grouping ||= :stacked @orientation ||= :vertical "cht=b#{@@orientations[@orientation]}#{@@groupings[@grouping]}" end |
#grouped=(arg) ⇒ Object
21 22 23 |
# File 'lib/google_chart/bar_chart.rb', line 21 def grouped=(arg) self.grouping = arg ? :grouped : :stacked end |
#horizontal=(arg) ⇒ Object
17 18 19 |
# File 'lib/google_chart/bar_chart.rb', line 17 def horizontal=(arg) self.orientation = arg ? :horizontal : :vertical end |