         pieChart managementChart, managements, managementsGroup, all
 
         dc.dataCount(".dc-data-count").dimension(xfilter).group(all)
-        $scope.columns = ["ward","region"]
         makeDataTable("#dc-data-table", wards)
 
         dc.renderAll()

        (() -> count: 0, total: 0))
      res


          chart.rescale())
        .yAxis().ticks(4)

    reloadTable = (datatable,dim) ->
      alldata = dim.top(Infinity)
      datatable.fnClearTable()
      datatable.fnAddData(alldata)
      datatable.fnDraw()

    makeDataTable = (selector, dim) ->
      exists = $.fn.DataTable.fnIsDataTable($(selector))

      if exists
        datatable = $(selector).dataTable()
        reloadTable(datatable,dim)
      else
        cols = $scope.fields.map((x) ->
          if x.endsWith("_year")
            mData: x
            sDefaultContent: ""
            mRender: (obj) ->
              y = obj.getFullYear()
              if y == YEAR_ZERO then "unknown" else y
          else
            {mData: x, sDefaultContent: ""})

        datatable = $(selector).dataTable
          bPaginate: true,
          pagingType: "full",
          iDisplayLength: 25,
          scrollX: true,
          scrollY: 500,
          scrollCollapse: true,
          bSort: true,
          bDeferRender: true,
          aaData: dim.top(Infinity),
          bDestroy: true,
          aoColumns: cols

      dc.chartRegistry.list().forEach (chart) ->
        chart.on "filtered", () ->
          dc.events.trigger () ->
            reloadTable(datatable,dim)

    reduceStatus = (group) ->
      res = group.reduce(\
