   loadData: ->
     @config = osu.parseJson 'json-chart-config'
 
-    data = @normalizeData @config.build_history
+    {data, hasData} = @normalizeData @config.build_history
 
     stack = d3.stack()
       .keys @config.order


    @hasData = @config.build_history? &&
      @config.build_history.length > 0 &&
      _.some(@config.build_history, (b) -> b.user_count > 0)


    @resize()




  normalizeData: (rawData) ->
    # normalize the user count values
    # and parse data into a form digestible by d3.stack()

    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}
