-
-
- pie = GruffGraff.new ( :graph_type => Gruff::Pie,
- :data => ,
- :title => "Percentage of First Plce Votes")
+ @election.plurality_result.points.each do |candidate, votes|
+ data[names[candidate]] = votes
+ end
+ size = "400x300"
+ size = "520x300" if @election.candidates.size >= 8
+
+ if @election.candidates.size >= 8
+ marker_font_size = 20
+ legend_font_size = 17
+ else
+ marker_font_size = 17
+ legend_font_size = 17
+ end
+
+ pie = GruffGraff.new( :graph_type => Gruff::Pie,
+ :title => "Percentage of First Place Votes",
+ :size => size,
+ :marker_font_size => marker_font_size,
+ :legend_font_size => legend_font_size,
+ :data => data)
+ send_data(*pie.output)
+
+ end