MyBB Community Forums

Full Version: Change Poll Bar Colors
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
impressive nice tutorial clever yaldaram Big Grin
(2011-11-12, 04:27 AM)Yaldaram Wrote: [ -> ]This only covers the polls on showthread pages. If you guys need to change the poll colors on Poll pages, then let me know. I'll update the first post.

Hello Yaldaram,

Did you ever update this. I also have poll on index and it's not showing any color

Apologies, I completely forgot this thread. I've to go now for University I'll surely update this in after few hours.
For adding these colors on Poll results page, I've updated the first post.
is it possible (and maybe easier) to add color into one poll bar (preselected when i create a poll into a post)?
Awesome,need this. thanks friend.
Thank You.
I made the changes above, and the bars are now colored with the % shown inside the bars, but now all bars are the same length including the colored part of the bar. I have retraced my steps, but I don't see what I have done wrong. I'm using the default template.

Also, is there any way to edit the number of decimal places? I would rather have 40.6% not 40.67%

I'm horribly rusty at CSS, but I kept messing around with the showthread_poll_resultbit code and I finally got it to work, only better:

<td class="{$optionbg}">
<div style="width:400px;">
</div>
<div style="background-color: #fff; border: 1px solid black; width:{$percent}%; margin-top: 1px; font-size: 12px;">
<div style="background-color: {$pollbg}; color: #000000; font-weight:bold; max-width:100%; &nbsp; width:{$percent}%; height:16px;">
&nbsp;&nbsp;&nbsp;{$percent}%
</div>
</div>
</td>
Most commonly issue arises if "Codepress" is turned ON.

AdminCP > Preferences > Turn on / off Codepress > should be turned OFF

Turning ON this setting most probably add &nbsp; like characters while pasting the code copied from somewhere.
Cool . Do it for calendar too?
Pages: 1 2