- model :user
-
- def day_votes
-
- @election = Election.find(params[:id])
- line = Gruff::Line.new
- line.title = "Voters Per Day"
- line.font = File.expand_path('/usr/X11R6/lib/X11/fonts/TTF/Vera.ttf', RAILS_ROOT)
- line.data("#{@election.name}", voter_days["voters_per_day"] )
- line.labels = voter_days["days_hash"]
- line.x_axis_label = "Date"
- line.y_axis_label = "Number of Votes"
- line.minimum_value = 0.0
- line.draw
- send_data(line.to_blob,
- :disposition => 'inline',
- :type => 'image/png',
- :filename => "dayvotes#{@poll.id}.png")