Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8371213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:06:36+00:00 2026-06-09T14:06:36+00:00

I have a simple poll with multiple answers. I use in the result the

  • 0

I have a simple poll with multiple answers. I use in the result the percentage of the answer as width of my chart.

For example:

  • Answer 1 20%
  • Answer 2 39%
  • Answer 3 5%
  • Answer 4 11%

etc..

(the percentage above is the width of my chart to)

The problem:

By having a lot of answers the highest result will not have more like: 15%. So my chart isnt nice at all.

The chart of my highest result has to be 100%, the second best result should have some percentage relative on the total.

Is there a way to calculate/fix that ?

Sorry for my english, hope you guys understand.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:06:38+00:00Added an answer on June 9, 2026 at 2:06 pm

    This is more of a maths question than a coding question I guess, but here it goes.
    For the first (highest voted) entry, $percent will be 100%; for the other entries, it’s:

    $percent = $nr_votes * 100 / $first;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have simple regular expression: ^123$ Matches are for example 123 1234 etc. How
I want to create simple poll system. I have two question and two answers.
I want to create simple poll system. I have two question and two answers.
I have simple class with width and height member fields which define number of
Trying to setup a simple Thread/Poll table mapping. Here is what I have: Threads
--EDIT-- I believe this is a valid question that may have multiple answers (as
I have a simple poll site. I would like to disallow possibility of voting
I am doing a simple Poll system. I have 2 tables: Person : ID,
I'm trying to create a simple poll function using php and sql. I have
I have a simple interface, using a database poll that creates a text file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.