   refresh: (event) ->
     kp = @get "#{event.keypath}"
     graphs[kp.divId].update()
+    graphs[kp.divId].moveDateWindowRight()

      strokeWidth: 1
      title: @name
    )

  create: ->
    @loadFile().then(@parseXml).then(@draw)

    now = new Date().valueOf()
    intervalBegin = now - minutes * 1000 * 60
    intervalEnd   = now
    @graph.updateOptions
      dateWindow: [intervalBegin, intervalEnd]

  moveDateWindowRight: ->
    [currBegin, currEnd] = @graph.xAxisRange()

    now = new Date().valueOf()
    diff = now - currEnd

    @graph.updateOptions
      dateWindow: [currBegin + diff, currEnd + diff]

  adjustWidth: ->
    $("##{@div}").width($(window).width() - $("##{@div}").css('margin').replace(/[^-\d\.]/g, '')*4)
