legend = Hash.new
alldata, labels = get_positions_info(@election)
@election.results unless @election.condorcet_result || @election.ssd_result
+ ranked_candidates = @election.condorcet_result.ranked_candidates.flatten
names = Hash.new
candidates = @election.candidates.sort.collect {|candidate| candidate.id}
names[candidate]= (Candidate.find(candidate)).name
end
- ranked_candidates = @election.condorcet_result.ranked_candidates.flatten
ranked_candidates.each_with_index \
{|candidate, index| legend[names[candidate]] = alldata[index]}
send_data(*graph.output)
end
+ def plurality_pie
+ @election = Election.find(params[:id])
+
+
+
+ pie = GruffGraff.new ( :graph_type => Gruff::Pie,
+ :data => ,
+ :title => "Percentage of First Plce Votes")
+
private
def get_positions_info(election)
buckets = Hash.new