     @retentionsStore.removeAll()
     @retentionsStore.loadData(retentions)
 
-  eachRetention: (cb) ->
-    @retentionsStore.each (retention) ->
-      cb(retention, retention.get("name"))
-
   initLightCharts: () ->
     @lightCharts = {}
-    @eachRetention (retention, name) =>
+    @retentionsStore.each (retention) =>
+      name = retention.get("name")
       @lightCharts[name] = @createLightChart(retention)
       @lightChartsContainer.add(@lightCharts[name])
 

        closed: =>
          Muleview.event "legendChange", false
    }
    @mainChartContainer.setLoading(false)
    @previewContainer.unmask()

    cfg = Ext.apply({}, cfg, common)
    @mainChart = (Ext.create "Muleview.view.MuleChart", cfg)
    @mainChartContainer.removeAll()
    @mainChartContainer.add @mainChart
    @previewContainer.removeAll()
    @previewContainer.add(Ext.create("Muleview.view.Preview",
      mainChart: @mainChart
      lightChart: @lightCharts[@retention]))
    @previewContainer.show()



  updateRefreshTimer: (me, seconds) ->
    Muleview.Settings.updateInterval = seconds

      cb.apply(@, arguments) if @currentViewId == viewId

  refresh: ->
    Muleview.Mule.getKeysData @keys, @safeCallback((data) =>
      @fixDuplicateAndMissingTimestamps(retData) for _ret,retData of data
      for retention, lightChart of @lightCharts
        lightChart.chart.updateData(data[retention])
      if @showSubkeys
        # I'm doing the 2nd async request after the 1st one's response
          # because of some funky Mule behaviour
        Muleview.Mule.getGraphData @key, @retention, @safeCallback((data) =>
          @fixDuplicateAndMissingTimestamps(data)
          @mainChart.updateData(data)
          @mainChart.updateAlerts(@getAlerts())
        )
      else
        @mainChart.updateData(data[@retention])
    )

  showNoData: () ->
      @mainChartContainer.setTitle "No Key Selected"
