Class: ChartJS::Background

Inherits:
Object
  • Object
show all
Defined in:
lib/chart_js/chart/dataset/background.rb,
lib/chart_js/chart/bar_chart/background.rb,
lib/chart_js/chart/line_chart/background.rb,
lib/chart_js/chart/radar_chart/background.rb,
lib/chart_js/chart/bar_chart/dataset/background.rb,
lib/chart_js/chart/line_chart/dataset/background.rb,
lib/chart_js/chart/radar_chart/dataset/background.rb

Instance Method Summary collapse

Constructor Details

#initialize(container) ⇒ Background

Returns a new instance of Background.



5
6
7
# File 'lib/chart_js/chart/dataset/background.rb', line 5

def initialize(container)
  @container = container
end

Instance Method Details

#build(&block) ⇒ Object



9
10
11
12
# File 'lib/chart_js/chart/dataset/background.rb', line 9

def build(&block)
  instance_eval(&block)
  @container 
end

#color(value) ⇒ Object



14
15
16
# File 'lib/chart_js/chart/dataset/background.rb', line 14

def color(value)
  @container['backgroundColor'] = value
end