Module: GoogleChart::BarStyle

Included in:
BarChart
Defined in:
lib/google_chart/bar_style.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#width=(value) ⇒ Object (writeonly)

Sets the attribute width

Parameters:

  • value

    the value to set the attribute width to.



8
9
10
# File 'lib/google_chart/bar_style.rb', line 8

def width=(value)
  @width = value
end

Class Method Details

.included(klass) ⇒ Object



4
5
6
# File 'lib/google_chart/bar_style.rb', line 4

def self.included(klass)
  klass.register!(:style)
end

Instance Method Details

#spacing=(spacing) ⇒ Object

TODO: raise error if bar spacing > group spacing?



11
12
13
# File 'lib/google_chart/bar_style.rb', line 11

def spacing=(spacing)
  @spacing = [spacing].flatten
end

#styleObject



15
16
17
# File 'lib/google_chart/bar_style.rb', line 15

def style
  "chbh=#{[@width, *@spacing].compact.join(',')}" if @width
end