BigW Consortium Gitlab

chart.js.coffee 455 Bytes
Newer Older
1 2 3 4 5 6
@Chart =
  labels: []
  values: []

  init: (labels, values, title) ->
    r = Raphael('activity-chart')
7 8 9 10 11 12 13 14

    fin = ->
      @flag = r.popup(@bar.x, @bar.y, @bar.value or "0").insertBefore(this)

    fout = ->
      @flag.animate
        opacity: 0, 300, -> @remove()

15 16
    r.text(160, 10, title).attr font: "13px sans-serif"
    r.barchart(
17
      10, 20, 560, 200,
18 19 20
      [values],
      {colors:["#456"]}
    ).label(labels, true)
21
      .hover(fin, fout)