Sha256: 3a017060e643decc0f6eeb4dc8394071f42fd29799ee0ac9df2bc83396a95c3d

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

# This is a manifest file that'll be compiled into application.js, which will include all the files
# listed below.
#
# Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
# or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
#
# It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
# compiled file.
#
# Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
# about supported directives.
#
#= require jquery
#= require jquery_ujs
#= require chart
#= require twitter/bootstrap
#= require_tree .

$ ->
  $("canvas.metric").each (i, el) ->
    ctx = el.getContext("2d")
    points = $(el).data('points')

    datasets = []

    size = 0
    for key, data of points
      datasets.push
        data: data
        fillColor : "rgba(151,187,205,0)",
        strokeColor : "rgba(0,0,0,1)",
          

      size = Math.max(size, data.length)
        
    data = 
      labels : (i for i in [0..size])
      datasets: datasets

    myNewChart = new Chart(ctx).Line(data)
    

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
prosperity-0.0.1 app/assets/javascripts/prosperity/application.js.coffee