           position = sortedPositions()[0][0]
           shapes.push draw.circle($scope.diameter).attr
             'stroke-width': 0
-            fill: AppConfig.pollColors.proposal[position]
+            fill: colors[position]
         else
           _.each sortedPositions(), ([position, votes]) ->
             return unless votes > 0
             angle = 360/_.sum($scope.votes)*votes
             shapes.push draw.path(arcPath(start, start + angle)).attr
               'stroke-width': 0
-              fill: AppConfig.pollColors.proposal[position]
+              fill: colors[position]
             start += angle

    sortedPositions = ->
      _.sortBy(_.pairs($scope.votes), ([_, count]) -> - count)

    $scope.$watchCollection 'votes', ->
      _.each shapes, (shape) -> shape.remove()
      start = 90

angular.module('loomioApp').directive 'pieChart', (AppConfig) ->
  template: '<div class="pie-chart"></div>'
  replace: true
  scope:
