Results 1 to 7 of 7

Thread: [RESOLVED] [2005] Making Poll of Games

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Resolved [RESOLVED] [2005] Making Poll of Games

    Hello ,

    I am Trying to Make a poll something like this poll here

    i have a table Polls(Id,GameType)
    i have 6 Games (GTA , SILENT HILL , PES , SPLINTER CELL , PRINCE OF PERSIA, Burnout)
    I have add on the web page a RadioButtonList
    The Value are Inserted on The Table !
    i have done The Number That Voted for each game

    what i need now is to show pourcentage % for each game

    like in the poll here


    Thanks !
    Last edited by killer7k; May 13th, 2008 at 03:10 PM.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] Making Poll of Games

    If you go to the poll result and look at the image, you'll see this



    Essentially, to show poll results, first find the results relative to each other as a percentage of a total. So take each results and divide by the total number of votes and you will end up with, for example:

    GTA 10 %,
    SILENT HILL 2%,
    PES 4%,
    SPLINTER CELL 9%,
    PRINCE OF PERSIA 20%,
    Burnout 0%,
    Half Life 2 55%


    Note that Half Life 2 is the winner here simply because it's the greatest game of all time, with PoP as a close second.

    Now when showing the results, simply take the percentage, and show the thin image that number of times in a row to make it appear like a bar.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Re: [2005] Making Poll of Games

    Can you give more details about percentage that appear like a bar !
    i have the percentage & i want next to each TypeGame show the bar

    Thanks

  4. #4
    Fanatic Member
    Join Date
    May 2005
    Posts
    608

    Re: [2005] Making Poll of Games

    Hello Killer7k,

    We already established from Mendhak's post that the image has a width of 1 pixel.
    Imagine a td cell that has 100 pixels total of width. That would be 100% score.
    Half Life 2 takes 55% of the poll votes. That's 55 pixels in a 1:1 relationship with the cell. Make the width of the img that holds the pixel of a width of 55 pixels. That's your 55% bar.

    When you specify the width or height attribute in an img tag, the img tag will stretch the image to fit those attributes.

    HTML extract from the poll page:
    Code:
    <img width="200" height="10" alt="" src="images/polls/bar2.gif"/>
    HTH,
    HoraShadow
    Last edited by HoraShadow; May 13th, 2008 at 06:40 PM.
    I do like the reward system. If you find that my post was useful, rate it.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Re: [2005] Making Poll of Games

    Yes Thanks Both
    I have just see it well what do you mean
    i have add a image & set the width of it as the pourcentage value
    & working
    i was Thinking for something else !

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [RESOLVED] [2005] Making Poll of Games

    Glad you got it working. Is this going to be a Game Poll? Don't forget Tomb Raider, Resident Evil 4 and Half Life 2.

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Re: [RESOLVED] [2005] Making Poll of Games

    Yep sure m8


    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width