Module: Chartjs::ChartHelpers

Defined in:
lib/chartjs/chart_helpers.rb

Instance Method Summary collapse

Instance Method Details

#bar_chart(labels, datasets, options = {}) ⇒ Object



8
9
10
# File 'lib/chartjs/chart_helpers.rb', line 8

def bar_chart(labels, datasets, options = {})
  chart 'Bar', labels, datasets, options
end

#doughnut_chart(data, options = {}) ⇒ Object



24
25
26
# File 'lib/chartjs/chart_helpers.rb', line 24

def doughnut_chart(data, options = {})
  chart 'Doughnut', nil, data, options
end

#line_chart(labels, datasets, options = {}) ⇒ Object



4
5
6
# File 'lib/chartjs/chart_helpers.rb', line 4

def line_chart(labels, datasets, options = {})
  chart 'Line', labels, datasets, options
end

#pie_chart(data, options = {}) ⇒ Object



20
21
22
# File 'lib/chartjs/chart_helpers.rb', line 20

def pie_chart(data, options = {})
  chart 'Pie', nil, data, options
end

#polar_area_chart(data, options = {}) ⇒ Object



16
17
18
# File 'lib/chartjs/chart_helpers.rb', line 16

def polar_area_chart(data, options = {})
  chart 'PolarArea', nil, data, options
end

#radar_chart(labels, datasets, options = {}) ⇒ Object



12
13
14
# File 'lib/chartjs/chart_helpers.rb', line 12

def radar_chart(labels, datasets, options = {})
  chart 'Radar', labels, datasets, options
end