Sha256: 465ab3fe856cca020f3772b14611364245ed65330da2d15b4d4b4d6ad3cddd9d

Contents?: true

Size: 759 Bytes

Versions: 1

Compression:

Stored size: 759 Bytes

Contents

# frozen_string_literal: true

require 'active_charts/util'

module ActiveCharts
  module Helpers #:nodoc:
    module LineChartHelper
      def line_chart(collection, options = {})
        LineChart.new(collection, options).to_html
      end
      
      def line_chart_for(resource_collection, columns = [], options = {})
        return line_chart([[]], options) unless Util.valid_collection?(resource_collection)
        
        parser = CollectionParser.new(resource_collection, columns, options[:label_column])
        series_labels = options[:series_labels] || parser.xy_series_labels
        options = options.merge(series_labels: series_labels, rows: parser.rows)
        
        line_chart(parser.xy_collection, options)
      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/line_chart_helper.rb