X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/6dfbfbec4b0d01138c272649d668c5a872706a5c..bb6aa392b953e018389843b02f044afd45d8afb9:/app/controllers/graph_controller.rb diff --git a/app/controllers/graph_controller.rb b/app/controllers/graph_controller.rb index 4f33ac3..9ab2a4c 100644 --- a/app/controllers/graph_controller.rb +++ b/app/controllers/graph_controller.rb @@ -21,7 +21,8 @@ class GraphController < ApplicationController line.draw send_data(line.to_blob, :disposition => 'inline', :type => 'image/png') end - + + #will place votes in a fixed number of intervals, and shows votes over time def votes_per_interval @election = Election.find(params[:id]) data, labels = get_votes_per_interval_data(@election) @@ -43,6 +44,23 @@ class GraphController < ApplicationController send_data(line.to_blob, :disposition => 'inline', :type => 'image/png') end + def quickvote_bar + @election = Election.find(params[:id]) + end + + def borda_bar + @election = Election.find(params[:id]) + + #Get the list of candidates from the election, and calculate how RubyVote + #gave each one points + @election.candidates.each do |candidate| + + #Tabulate how many points each candidate received + #Make the name of each candidate a label under the correspoding column + #done! + end + + private # generate the data and labels for each graph