Result bar widths should be percentage of most popular result, not percentage of total vote.

lendrick - October 21, 2009 - 20:53
Project:Decisions
Version:6.x-1.3
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

Greets! Love the module; I've been using it in production now for some time. One thing I've noticed, though, is that it might be a little bit nicer visually (especially in polls with a lot of options) if the option with the largest number of votes had a bar that's 100% full, and then the other options have bars with widths relative to that bar.

Here's a good example of what I'm talking about:
http://opengameart.org/node/2743/results

In the above case, it would be a lot more readable if the bars stretched out so that the most popular one was the whole way across the screen, and the other bars were proportionally wider too. Mathematically, instead of:

(bar width) = (votes) / (total votes)

... it should be ...

(bar width) = (votes) / (votes for most popular option)

If you provide the number of votes for the most popular option to the theme_decision_bar function, I would be able to handle this myself in my theme.

Thanks!

Bart

#1

anarcat - October 26, 2009 - 20:45

I think I agree with you: it would look nicer. However, the percentages showed should be in a proper percentage.

Patches welcome, I don't have time to hack this now.. :/

 
 

Drupal is a registered trademark of Dries Buytaert.