Template:Composition bar/doc: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(Document new parameters) |
(→Examples: add some examples of changing text and background colour) |
||
Line 22: | Line 22: | ||
| style="font-size: 95%"| <code><nowiki>{{Composition bar|50|100|red}}</nowiki></code> |
| style="font-size: 95%"| <code><nowiki>{{Composition bar|50|100|red}}</nowiki></code> |
||
| {{Composition bar|50|100|red}} |
| {{Composition bar|50|100|red}} |
||
|- |
|||
| style="font-size: 95%"| <code><nowiki>{{Composition bar|50|100|red|color=#FFFFFF}}</nowiki></code> |
|||
| {{Composition bar|50|100|red|color=#FFFFFF}} |
|||
|- |
|||
| style="font-size: 95%"| <code><nowiki>{{Composition bar|50|100|red|color=#FFFFFF|background-color=#000000}}</nowiki></code> |
|||
| {{Composition bar|50|100|red|color=#FFFFFF|background-color=#000000}} |
|||
|- |
|- |
||
| style="font-size: 95%"| <code><nowiki>{{Composition bar|50|100|#9999FF}}</nowiki></code> |
| style="font-size: 95%"| <code><nowiki>{{Composition bar|50|100|#9999FF}}</nowiki></code> |
||
Line 37: | Line 43: | ||
| style="font-size: 95%"| <code><nowiki>{{Composition bar|90|100|#F00|width=500|per=1}}</nowiki></code> |
| style="font-size: 95%"| <code><nowiki>{{Composition bar|90|100|#F00|width=500|per=1}}</nowiki></code> |
||
| {{Composition bar|90|100|#F00|width=500|per=1}} |
| {{Composition bar|90|100|#F00|width=500|per=1}} |
||
|- |
|||
| style="font-size: 95%"| <code><nowiki>{{Composition bar|90|100|#F00|width=500|per=1|color=#FFFFFF}}</nowiki></code> |
|||
| {{Composition bar|90|100|#F00|width=500|per=1|color=#FFFFFF}} |
|||
|} |
|} |
||
Revision as of 21:54, 17 December 2013
This is a documentation subpage for Template:Composition bar. It contains usage information, categories and other content that is not part of the original template 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 {{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 available in{{political party/meta/color}}
templates. - width is the width of the bar in px.
- per adds a percentage to the bar as well.
Examples
Code | Result |
---|---|
{{Composition bar|50|100|red}}
|
50 / 100
|
{{Composition bar|50|100|red|color=#FFFFFF}}
|
50 / 100
|
{{Composition bar|50|100|red|color=#FFFFFF|background-color=#000000}}
|
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
|
{{Composition bar|75|100|#FF0|width=250}}
|
75 / 100
|
{{Composition bar|90|100|#F00|width=500|per=1}}
|
90 / 100 (90%)
|
{{Composition bar|90|100|#F00|width=500|per=1|color=#FFFFFF}}
|
90 / 100 (90%)
|
See also
- {{Bar chart}}
- Template:T1
- {{Composition_bar/advanced}}
- {{Percentage bar}}
- {{Percent-done}}
- {{Progress}}
- {{Progress bar}}
- {{Progress box}}
- {{Progression}}
- {{Progress meter}}