From a66821f0e7574489b94041c305827cf472a7243e Mon Sep 17 00:00:00 2001 From: Coleman Date: Fri, 17 Oct 2008 02:36:15 -0500 Subject: [PATCH] use bigger image for stats and remove text --- app/helpers/votes_helper.rb | 6 +++--- app/views/votes/show.html.haml | 6 ------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/app/helpers/votes_helper.rb b/app/helpers/votes_helper.rb index f0f8b54..2926dcf 100644 --- a/app/helpers/votes_helper.rb +++ b/app/helpers/votes_helper.rb @@ -2,9 +2,9 @@ module Merb module VotesHelper def stat_chart curl = Gchart.pie( - :size => '300x200', - :title => "Voting results for #{@user.votes.size} photos", - :legend => [ 'Not One', 'One' ], + :size => '415x275', + :title => "Voting results for #{@user.votes.size} photos. Oneness #{"%.1f%%" % (@user.votes.select { |v| v.one? }.size.to_f / @user.votes.size.to_f * 100.0)}", + :legend => [ "Not One (#{@user.votes.select { |v| v.zero? }.size})", "One (#{@user.votes.select { |v| v.one? }.size})" ], :data => [ @user.votes.select { |v| v.zero? }.size, @user.votes.select { |v| v.one? }.size ], :theme => :pastel ) diff --git a/app/views/votes/show.html.haml b/app/views/votes/show.html.haml index 4a0800e..dd3f552 100644 --- a/app/views/votes/show.html.haml +++ b/app/views/votes/show.html.haml @@ -11,10 +11,4 @@ %div.user_stat_chart = stat_chart -%p== Zero: #{@user.votes.select { |v| v.zero? }.size} - -%p== One: #{@user.votes.select { |v| v.one? }.size} - -%p== Oneness: #{"%.1f%%" % (@user.votes.select { |v| v.one? }.size.to_f / @user.votes.size.to_f * 100.0)} - %br{ :style => 'clear: both' }