Module: ActiveCharts::Helpers::BarChartHelper
- Defined in:
- lib/active_charts/helpers/bar_chart_helper.rb
Instance Method Summary collapse
- #bar_chart(collection, options = {}) ⇒ Object
- #bar_chart_for(resource_collection, columns = [], options = {}) ⇒ Object
Instance Method Details
#bar_chart(collection, options = {}) ⇒ Object
8 9 10 |
# File 'lib/active_charts/helpers/bar_chart_helper.rb', line 8 def (collection, = {}) BarChart.new(collection, ).to_html end |
#bar_chart_for(resource_collection, columns = [], options = {}) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/active_charts/helpers/bar_chart_helper.rb', line 12 def (resource_collection, columns = [], = {}) return ([[]], ) unless Util.valid_collection?(resource_collection) parser = CollectionParser.new(resource_collection, columns, [:label_column]) (parser.collection, .merge(series_labels: parser.series_labels, rows: parser.rows)) end |