Template:Composition bar/doc: Difference between revisions

From CivWiki
Jump to navigation Jump to search
Content added Content deleted
(Update template)
(Genericize. See also various similar templates.)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->

This template displays the numeric composition of a thing in terms of its sub-units. For example, it is frequently used as part of {{tl|Infobox political party}} to show the number of seats a given political party holds in a legislature.


== Usage ==
== Usage ==


:<code><nowiki>{{</nowiki>Composition bar|''seats_won''|''total_seats''|''color''<nowiki>}}</nowiki></code>
:<code><nowiki>{{</nowiki>Composition bar|''amount''|''total''|''color''<nowiki>}}</nowiki></code>


* ''seats_won'' is the number of seats held by the political party
* ''amount'' is the number of sub-units
* ''total_seats'' is the total number of seats possible
* ''total'' is the total number of sub-units possible
* ''color'' is a valid [[web colors|web color]], which can be specified either by name, as a [[hex triplet]] (#rrbbgg), or [[hex triplet]] from most {{tld|political party/meta/color}} templates.
* ''color'' is a valid [[web colors|web color]], which can be specified either by name, as a [[hex triplet]] (#rrbbgg), or [[hex triplet]].<br />In the case of political parties, most will have their logo color avaiable in {{tld|political party/meta/color}} templates.


== Examples ==
== Examples ==
Line 31: Line 33:


== See also ==
== See also ==
* {{tl|Infobox political party}}
* {{tl|Bar chart}}
* {{tl|Bar chart}}
* {{t1|Backlog progress bar}}
* {{tl|Percent-done}}
* {{tl|Progress}}
* {{tl|Progress bar}}
* {{tl|Progress box}}
* {{tl|Progression}}
* {{tl|Progress meter}}


<includeonly>
<includeonly>

Revision as of 19:30, 11 November 2012

This template displays the numeric composition of a thing in terms of its sub-units. For example, it is frequently used as part of {{Infobox political party}} to show the number of seats a given political party holds in a legislature.

Usage

{{Composition bar|amount|total|color}}
  • amount is the number of sub-units
  • total is the total number of sub-units possible
  • color is a valid web color, which can be specified either by name, as a hex triplet (#rrbbgg), or hex triplet.
    In the case of political parties, most will have their logo color avaiable in {{political party/meta/color}} templates.

Examples

Code Result
{{Composition bar|50|100|red}}
50 / 100
{{Composition bar|50|100|#9999FF}}
50 / 100
{{Composition bar|50|100|{{Green Party (UK)/meta/color}}}}
50 / 100
{{Composition bar|50|100|rgb(255,255,16)}}
50 / 100

See also