Sha256: a74665a0747ddbe5532d4fad98ddd615838cd37b6a2fc29102043a66e20a6720

Contents?: true

Size: 667 Bytes

Versions: 169

Compression:

Stored size: 667 Bytes

Contents

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

169 entries across 169 versions & 1 rubygems

Version Path
effective_datatables-3.7.10 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-3.7.9 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-3.7.8 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.10.0 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.9.4 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.9.3 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.9.2 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.9.1 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.9.0 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.8.16 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.8.15 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.8.14 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.8.13 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.8.12 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-3.7.7 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.8.11 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.8.10 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.8.9 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.8.8 app/models/effective/effective_datatable/dsl/charts.rb
effective_datatables-4.8.7 app/models/effective/effective_datatable/dsl/charts.rb