module ActiveCharts::Helpers::BarChartHelper

Public Instance Methods

bar_chart(collection, options = {}) click to toggle source
# File lib/active_charts/helpers/bar_chart_helper.rb, line 8
def bar_chart(collection, options = {})
  BarChart.new(collection, options).to_html
end
bar_chart_for(resource_collection, columns = [], options = {}) click to toggle source
# File lib/active_charts/helpers/bar_chart_helper.rb, line 12
def bar_chart_for(resource_collection, columns = [], options = {})
  return bar_chart([[]], options) unless Util.valid_collection?(resource_collection)
  
  parser = CollectionParser.new(resource_collection, columns, options[:label_column])
  bar_chart(parser.collection, options.merge(series_labels: parser.series_labels, rows: parser.rows))
end