Sha256: 2238d8a8fbf93a3120aeabf96755542bee97275d211dcefe6a7596f4c7a4b5a9

Contents?: true

Size: 698 Bytes

Versions: 61

Compression:

Stored size: 698 Bytes

Contents

# frozen_string_literal: true

module Effective
  module EffectiveDatatable
    module Dsl
      module Charts
        # Instance Methods inside the charts do .. end block
        def chart(name, as = 'BarChart', label: nil, legend: true, partial: nil, **options, &compute)
          raise 'expected a block returning an Array of Arrays' unless block_given?

          datatable._charts[name.to_sym] = {
            as: as,
            compute: compute,
            name: name,
            options: { label: (label || name.to_s.titleize), legend: (legend || 'none') }.merge(options),
            partial: partial || '/effective/datatables/chart'
          }
        end
      end
    end
  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
effective_datatables-4.31.0 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.30.2 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.30.1 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.30.0 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.29.0 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.26.0 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.25.3 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.25.2 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.25.1 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.25.0 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.24.2 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.24.1 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.24.0 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.23.0 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.22.3 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.22.2 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.22.1 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.22.0 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.21.1 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.21.0 app/models/effective/effective_datatable/dsl/charts.rb