Module: BarChart

Defined in:
lib/chart_helpers/common/bar_chart.rb

Instance Method Summary collapse

Instance Method Details

#horizontal_bar_chart(data, element = '.horizontal_bar_chart') ⇒ Object



3
4
5
6
# File 'lib/chart_helpers/common/bar_chart.rb', line 3

def horizontal_bar_chart( data, element='.horizontal_bar_chart' )
  HorizontalBarChartGenerator.new.generate( element, data )
  ( :div, '', class: "#{element[1..-1]}" )
end

#vertical_bar_chart(data_url, element = '.vertical_bar_chart') ⇒ Object



8
9
10
11
# File 'lib/chart_helpers/common/bar_chart.rb', line 8

def vertical_bar_chart( data_url, element='.vertical_bar_chart' )
  VerticalBarChartGenerator.new.generate( element, data_url )
  ( :div, '', class: "#{element[1..-1]}" )
end