     displayName: 'graph'
     getInitialState: ->
       todoTotals: [] 
-    update: ->
-      $.get "#{@props.urlbase}/#{@props.daysBack}", ((result) ->
+    update: (url) ->
+      $.get url, ((result) ->
         data = result
         @setState {todoTotals: data}).bind(this)
     componentDidMount: ->
-      @update()
-    componentDidUpdate: ->
-      @update()
+      @update("#{@props.urlbase}/#{@props.daysBack}")
+    componentWillReceiveProps: (nextProps) ->
+      @update("#{nextProps.urlbase}/#{nextProps.daysBack}")
     render: ->
       linechart
         data: @state.todoTotals

    getInitialState: ->
      daysBack: 60
    updateLinechartTime: (val) ->
      @setState daysBack: val
    render: ->
      div className: "section", [
        div className: "container", [

          id: "timeinput"
          type: "text"
          ref: "timeinput"),
        (React.DOM.input
          className: "button-primary"
          value: "update"
          type: "submit"
