Template talk:Ratio bar

From Wikipedia, the free encyclopedia

Undeleted so that TFD folks can see it. Don't use this anywhere on wikipedia! Wikipedia is not a democracy Kim Bruning 13:24, 21 August 2005 (UTC)

Templates for deletion This template survived a request for deletion. The result of the discussion was keep and rename.

Courtland 03:08, 3 September 2005 (UTC)

Rather, don't use it where it's not appropriate.  Denelson83  03:53, 22 August 2005 (UTC)
Right, as long as it's not in the wikipedia: namespace, I figure it might be ok. Do make sure to watch it so that it doesn't go there! Kim Bruning 03:59, 22 August 2005 (UTC)

Contents

[edit] Sample

The following code produces the following ratio bar–

{{Ratio bar
| HC1 = #FCC
| C1  = red
| O1  = Losers
| V1  = 238
| V2  = 541
| O2  = Winners
| C2  = blue
| HC2 = #CCF
}}
Losers: 238
(30.55%)
Winners: 541
(69.45%)

[edit] Parameters

  • HC1 = Header background color for option 1 (optional: defaults to white)
  • C1 = Background color for option 1 (main bar color) (optional: defaults to silver)
  • O1 = Option 1 title/caption
  • V1 = Votes for option 1
  • V2 = Votes for option 2
  • O2 = Option 2 title/caption
  • C2 = Background color for option 2 (main bar color) (optional: defaults to gray)
  • HC2 = Header background color for option 2 (optional: defaults to white)
  • R = Number of digits to round to for percentage calculation (optional: defaults to 2 digits)

[edit] Tests

If you play with the formula calculations, check these to make sure the visual appearance wasn't altered.

Losers: 0
(0%)
Winners: 320
(100%)
Losers: 320
(100%)
Winners: 0
(0%)
Losers: 5
(5%)
Winners: 95
(95%)
Losers: 95
(95%)
Winners: 5
(5%)
Losers: 9
(5.66%)
Winners: 150
(94.34%)
Losers: 3
(1.96%)
Winners: 150
(98.04%)

[edit] Parameter names

Any objection to removing the old-style parameter names (the longish ones)? As far as Whatlinkshere seems to indicate, this isn't very widely used. =) —Locke Cole • tc 03:02, 18 April 2006 (UTC)

Well, it's because the Wikipedia community objected to seeing it used for the purpose for which I originally created it. So, I have made it a task of mine to make sure it's not improperly used. Denelson83 03:16, 18 April 2006 (UTC)
Yeah, I actually got here by viewing some old TFDs. =) Unfortunate, really, because 99% of the time the various polls on here come down to the pure numbers. —Locke Cole • tc 03:22, 18 April 2006 (UTC)
Well, the general consensus here on enwiki is that polls are evil. Denelson83 06:15, 27 April 2006 (UTC)