Sha256: e6e9c9df3fc5883ef7b86687be61402f5fec45d2c89563bf80a73e174f19de25

Contents?: true

Size: 647 Bytes

Versions: 1

Compression:

Stored size: 647 Bytes

Contents

# frozen_string_literal: true

require 'active_charts/util'

module ActiveCharts
  module Helpers #:nodoc:
    module BarChartHelper
      def bar_chart(collection, options = {})
        BarChart.new(collection, options).to_html
      end
      
      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
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_charts-1.0.1 lib/active_charts/helpers/bar_chart_helper.rb