Difference between revisions of "Template:Composition bar/advanced/doc"
imported>Woodgreener |
imported>Woodgreener |
||
| Line 85: | Line 85: | ||
|boxwidth = 500 | |boxwidth = 500 | ||
|party1 = 32153000 | |party1 = 32153000 | ||
| − | |partycolor1 = | + | |partycolor1 = HotPink |
|party2 = 31029000 | |party2 = 31029000 | ||
| − | |partycolor2 = | + | |partycolor2 = DodgerBlue |
}}{{Composition_bar/advanced | }}{{Composition_bar/advanced | ||
|divisionname = Gender of MPs elected in [[United Kingdom general election, 2010|2010]] | |divisionname = Gender of MPs elected in [[United Kingdom general election, 2010|2010]] | ||
| Line 93: | Line 93: | ||
|boxwidth = 500 | |boxwidth = 500 | ||
|party1 = 142 | |party1 = 142 | ||
| − | |partycolor1 = # | + | |partycolor1 = #FF69B4 |
|party2 = 508 | |party2 = 508 | ||
| − | |partycolor2 = # | + | |partycolor2 = #1E90FF |
}}</pre> | }}</pre> | ||
{{Composition_bar/advanced | {{Composition_bar/advanced | ||
| Line 102: | Line 102: | ||
|boxwidth = 500 | |boxwidth = 500 | ||
|party1 = 32153000 | |party1 = 32153000 | ||
| − | |partycolor1 = | + | |partycolor1 = HotPink |
|party2 = 31029000 | |party2 = 31029000 | ||
| − | |partycolor2 = | + | |partycolor2 = DodgerBlue |
}}{{Composition_bar/advanced | }}{{Composition_bar/advanced | ||
|divisionname = Gender of MPs elected in [[United Kingdom general election, 2010|2010]] | |divisionname = Gender of MPs elected in [[United Kingdom general election, 2010|2010]] | ||
| Line 110: | Line 110: | ||
|boxwidth = 500 | |boxwidth = 500 | ||
|party1 = 142 | |party1 = 142 | ||
| − | |partycolor1 = # | + | |partycolor1 = #FF69B4 |
|party2 = 508 | |party2 = 508 | ||
| − | |partycolor2 = # | + | |partycolor2 = #1E90FF |
}} | }} | ||
Revision as of 04:57, 8 May 2013
Contents
Usage
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.
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 {{Labour Party (UK)/meta/color}} generates the following: #E4003B ).
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.
{{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 =
}}
Examples
Example 1: Election results
{{Composition_bar/advanced
|divisionname = Cardiff South and Penarth by-election, 2012
|total = 19436
|boxwidth = 800
|party1 = 9193
|partycolor1 = {{Labour Party (UK)/meta/color}}
|party2 = 3859
|partycolor2 = {{Conservative Party (UK)/meta/color}}
|party3 = 2103
|partycolor3 = {{Liberal Democrats/meta/color}}
|party4 = 1854
|partycolor4 = {{Plaid Cymru/meta/color}}
|party5 = 1179
|partycolor5 = {{UKIP/meta/color}}
|party6 = 800
|partycolor6 = {{Green Party of England and Wales/meta/color}}
|party7 = 235
|partycolor7 = {{Socialist Labour Party (UK)/meta/color}}
|party8 = 213
|partycolor8 = {{Communist Party of Britain/meta/color}}
}}Example 2: Demographics
{{Composition_bar/advanced
|divisionname = Gender of the population of the UK ([[Demography 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
}}