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.
This is more of a maths question than a coding question I guess, but here it goes.
For the first (highest voted) entry,
$percentwill be100%; for the other entries, it’s: