Sha256: 6959cd735152f63979b261fcf7f7cbc3c799199765ea870039a41dc8252ce530

Contents?: true

Size: 502 Bytes

Versions: 23

Compression:

Stored size: 502 Bytes

Contents

initializeCharts = ->
  $('.effective-datatables-chart').each ->
    $chart = $(this)

    data = $chart.data('data') || []
    type = $chart.data('type') || 'BarChart'
    options = $chart.data('options') || {}

    chart = new google.visualization[type](document.getElementById($chart.attr('id')))
    chart.draw(google.visualization.arrayToDataTable(data), options)

$ -> initializeCharts()
$(document).on 'page:change', -> initializeCharts()
$(document).on 'turbolinks:load', -> initializeCharts()

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
effective_datatables-2.6.21 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.11.1 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.11.0 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.10.0 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.9.0 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.8.0 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.7.0 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.6.20 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.6.19 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.6.18 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.6.17 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.6.16 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.6.15 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.6.14 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.6.13 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.6.12 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.6.11 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.6.10 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.6.9 app/assets/javascripts/effective_datatables/charts.js.coffee
effective_datatables-2.6.8 app/assets/javascripts/effective_datatables/charts.js.coffee