 
 
 
-  normalizeData: (data) ->
+  normalizeData: (rawData) ->
     # normalize the user count values
     # and parse data into a form digestible by d3.stack()
 
-    for own timestamp, values of _.groupBy data, 'created_at'
-      sum = _.sumBy values, 'user_count'
-
-      # parse date stored in strings to JS Date object for use by
-      # d3 domains, and format it into a string shown on the tooltip
-      m = moment values[0].created_at
-
-      obj =
-        created_at: timestamp
-        date: m.toDate()
-        date_formatted: m.format 'YYYY/MM/DD'
-
-      for val in values
-        val.normalized = val.user_count / sum
-        obj[val.label] = val
-
-      obj
+    resetLabel = null
+    hasData = null
+
+    data =
+      for own timestamp, values of _.groupBy rawData, 'created_at'
+        sum = _.sumBy values, 'user_count'
+
+        if sum == 0
+          fakedVal = _.find(values, label: resetLabel) if resetLabel?
+          unless fakedVal?
+            fakedVal = _.last(values)
+            resetLabel = fakedVal.label
+          fakedVal.user_count = 1
+          sum = 1
+        else
+          hasData ?= true
+
+        # parse date stored in strings to JS Date object for use by
+        # d3 domains, and format it into a string shown on the tooltip
+        m = moment values[0].created_at
+
+        obj =
+          created_at: timestamp
+          date: m.toDate()
+          date_formatted: m.format 'YYYY/MM/DD'
+
+        for val in values
+          val.normalized = val.user_count / sum
+          obj[val.label] = val
+
+        obj
+
+    {data, hasData}

  loadData: ->
    @config = osu.parseJson 'json-chart-config'

    data = @normalizeData @config.build_history

    stack = d3.stack()
      .keys @config.order


    @hasData = @config.build_history? &&
      @config.build_history.length > 0 &&
      hasData


    @resize()
