             hideHover: true
             ymin: 'auto'
 
+    # Fix graph size on resize
     '{window} resize': (el,ev)->
         clearTimeout @timer
         @timer = setTimeout (=> this.draw()) ,100

        this.element.html can.view('views/traffic_graph.ejs',this.options)
        this.load()

    cutoff: ->
        days=1 if @mode=="day"
        days=7 if @mode=="week"
        days=28 if @mode=="month"
        new Date().getTime()/1000-(days*24*60*60)


    load: ->
        $.get this.options.url,(content)=>
            dataRaw={}

        mode: 'day'
        initialHeight: '300px'
,
    # initialize component
    init: ->
        @url=this.options.url
        @graphId=$(this.element).attr('id')+"_graph"
