- fulldata, labels = get_positions_info(@election)
- legend = Hash.new
-
- @election.candidates.each_with_index do |candidate, index|
- legend[candidate.name] = fulldata[index]
+ names = Hash.new
+ candidates = @election.candidates.sort.collect {|candidate| candidate.id}
+ candidates.each do |candidate|
+ names[candidate]= (Candidate.find(candidate)).name