Sha256: 688a692d9ef8adf53245798176502c54d1e62bf2fb0322478179961c47a9de77

Contents?: true

Size: 541 Bytes

Versions: 1

Compression:

Stored size: 541 Bytes

Contents

class Dashing.Graph extends Dashing.Widget

  @accessor 'current', ->
    points = @get('points')
    if points
      points[points.length - 1].y

  ready: ->
    @graph = new Rickshaw.Graph(
      element: @node
      width: $(@node).parent().width()
      series: [
        {
        color: "#fff",
        data: [{ x: 0, y: 0}]
        }
      ]
    )
    x_axis = new Rickshaw.Graph.Axis.Time(graph: @graph)
    @graph.render()

  onData: (data) ->
    super
    if @graph
      @graph.series[0].data = data.points
      @graph.render()

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dashing-0.1.0 templates/project/widgets/graph/graph.coffee