Home
Random
Log in
Settings
About The Republic Wiki
Disclaimers
The Republic Wiki
Search
Editing
Template:Composition bar/advanced/doc
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
The edit appears to have already been undone.
Anti-spam check. Do
not
fill this in!
{{Documentation subpage}} The advanced '''Composition bar''' template can be used to show a composition bar split into different colours. It's intended use is on election articles to show the share of the vote in a given division/constituency/ward, but it can be used as a general composition bar, or as a more comprehensive progress bar. The number of votes or percentages are entered using the '''party1'''/'''party2'''/'''party3''' parameters, with the '''partycolor1'''/'''partycolor2'''/'''partycolor3''' parameters allowing you to choose the colour of that part of the bar (using hexcode). In the examples below, political party templates are used to generate the specific colours (for example <nowiki>{{party color|Labour Party (UK)}}</nowiki> generates the following: {{party color|Labour Party (UK)}} ). The width of the whole box can be edited using the '''boxwidth''' parameter. If this parameter isn't used, it will default to 500px. NOTE: This template does not currently add up your individual '''party1'''/'''party2'''/'''party3''' parameters for the '''total''', so you should ensure that you add up these numbers and enter it as the '''total''' parameter. If the total of your '''party''' parameters does not reach the '''total''', the extra space will be shown as white on the bar. <syntaxhighlight lang="wikitext">{{Composition_bar/advanced |divisionname = |total = |boxwidth = |party1 = |partycolor1 = |party2 = |partycolor2 = |party3 = |partycolor3 = |party4 = |partycolor4 = |party5 = |partycolor5 = |party6 = |partycolor6 = |party7 = |partycolor7 = |party8 = |partycolor8 = |party9 = |partycolor9 = |party10 = |partycolor10 = }} </syntaxhighlight> ===Color parameters=== Colors (/colours) can be defined using hexcode (e.g. '''#7CFC00''') or as color names (e.g. '''LawnGreen'''). For a comprehensive list of X11 color names, see [[Web colors#X11 color names|here]]. In the below example of an election result, a template (e.g. '''<nowiki>{{party color|Labour Party (UK)}}</nowiki>''') is used to call the specific colour (in this case '''#DC241f'''). ==Examples== ===Example 1: Election results=== <syntaxhighlight lang="wikitext"> {{Composition_bar/advanced |divisionname = Cardiff South and Penarth by-election, 2012 |total = 19436 |boxwidth = 800 |party1 = 9193 |partycolor1 = {{party color|Labour Party (UK)}} |party2 = 3859 |partycolor2 = {{party color|Conservative Party (UK)}} |party3 = 2103 |partycolor3 = {{party color|Liberal Democrats (UK)}} |party4 = 1854 |partycolor4 = {{party color|Plaid Cymru}} |party5 = 1179 |partycolor5 = {{party color|UK Independence Party}} |party6 = 800 |partycolor6 = {{party color|Green Party of England and Wales}} |party7 = 235 |partycolor7 = {{party color|Socialist Labour Party (UK)}} |party8 = 213 |partycolor8 = {{party color|Communist Party of Britain}} }}</syntaxhighlight>{{Composition_bar/advanced |divisionname = Cardiff South and Penarth by-election, 2012 |total = 19436 |boxwidth = 800 |party1 = 9193 |partycolor1 = {{party color|Labour Party (UK)}} |party2 = 3859 |partycolor2 = {{party color|Conservative Party (UK)}} |party3 = 2103 |partycolor3 = {{party color|Liberal Democrats (UK)}} |party4 = 1854 |partycolor4 = {{party color|Plaid Cymru}} |party5 = 1179 |partycolor5 = {{party color|UK Independence Party}} |party6 = 800 |partycolor6 = {{party color|Green Party of England and Wales}} |party7 = 235 |partycolor7 = {{party color|Socialist Labour Party (UK)}} |party8 = 213 |partycolor8 = {{party color|Communist Party of Britain}} }} ===Example 2: Demographics=== <syntaxhighlight lang="wikitext"> {{Composition_bar/advanced |divisionname = Gender of the population of the UK ([[Demographics of the United Kingdom|2011 census]]) |total = 63182000 |boxwidth = 500 |party1 = 32153000 |partycolor1 = HotPink |party2 = 31029000 |partycolor2 = DodgerBlue }}{{Composition_bar/advanced |divisionname = Gender of MPs elected in [[United Kingdom general election, 2010|2010]] |total = 650 |boxwidth = 500 |party1 = 142 |partycolor1 = #FF69B4 |party2 = 508 |partycolor2 = #1E90FF }}</syntaxhighlight> {{Composition_bar/advanced |divisionname = Gender of the population of the UK ([[Demographics of the United Kingdom|2011 census]]) |total = 63182000 |boxwidth = 500 |party1 = 32153000 |partycolor1 = HotPink |party2 = 31029000 |partycolor2 = DodgerBlue }}{{Composition_bar/advanced |divisionname = Gender of MPs elected in [[United Kingdom general election, 2010|2010]] |total = 650 |boxwidth = 500 |party1 = 142 |partycolor1 = #FF69B4 |party2 = 508 |partycolor2 = #1E90FF }} ===Example 3: Progress bar=== (This example is taken from the [[Wikipedia:WikiProject Spaceflight/Open tasks|WikiProject Spaceflight]].) <syntaxhighlight lang="wikitext">*'''Phase 1''' (orange) *'''Phase 2''' (green) {{Composition_bar/advanced |divisionname = Space Shuttle missions |total = 135 |party1 = 10 |partycolor1 = #00aa00 |party2 = 50 |partycolor2 = #ffaa00 |party3 = 75 |partycolor3 = #aa0000 }} {{Composition_bar/advanced |divisionname = Overall |total = 1900 |party1 = 11 |partycolor1 = #00aa00 |party2 = 51 |partycolor2 = #ffaa00 |party3 = 1838 |partycolor3 = #aa0000 }}</syntaxhighlight> *'''Phase 1''' (orange) *'''Phase 2''' (green) {{Composition_bar/advanced |divisionname = Space Shuttle missions |total = 135 |party1 = 10 |partycolor1 = #00aa00 |party2 = 50 |partycolor2 = #ffaa00 |party3 = 75 |partycolor3 = #aa0000 }} {{Composition_bar/advanced |divisionname = Overall |total = 1900 |party1 = 11 |partycolor1 = #00aa00 |party2 = 51 |partycolor2 = #ffaa00 |party3 = 1838 |partycolor3 = #aa0000 }} == References == <includeonly>{{Sandbox other| | <!-- Categories below this line, please: --> [[Category:Progress templates]] [[Category:Election and referendum templates]] }}</includeonly>
Summary:
Please note that all contributions to The Republic Wiki are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) (see
The Republic Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Composition bar/advanced
(
edit
)
Template:Documentation subpage
(
edit
)
Template:Mbox
(
edit
)
Template:Party color
(
edit
)
Template:Strong
(
edit
)
Template:Terminate sentence
(
edit
)
Module:Arguments
(
edit
)
Module:Delink
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Message box/ombox.css
(
edit
)
Module:Political party
(
edit
)
Module:Political party/C
(
edit
)
Module:Political party/G
(
edit
)
Module:Political party/L
(
edit
)
Module:Political party/P
(
edit
)
Module:Political party/S
(
edit
)
Module:Political party/U
(
edit
)
Module:Text
(
edit
)
Module:Text/data
(
edit
)
Module:Yesno
(
edit
)