সাঁচ:Composition bar
This template is used on 4913 pages, and changes to it will be widely noticed. Please test any changes in the template's /sandbox or /testcases subpages, or in a user subpage, and consider discussing changes at the talk page before implementing them. |
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. A single line, flexible width version of this template is available at Template:Composition bar compact.
Usage
সম্পাদনা কৰক{{Composition bar|amount|total|bar-color|options...}}
- amount
- The first parameter is the number of sub-units.
- total
- The second parameter is the total number of sub-units possible.
- bar-color
- (default is light grey) The third parameter is the background color of the left part of the bar - a valid web color, which can be specified by name, as a hex triplet (#rrbbgg), or rgb triplet (rgb(0–255,0–255,0–255)).
In the case of political parties, most will have their logo color available in {{political party/meta/color}} templates.
Additional display options:
- background-color=...
- (default is transparent) is the background color of the right part of the bar - a valid web color.
- border=...
- (default is medium grey) is the color of the border, or "none" for no border
- width=...
- (default is 100px) a width value for the bar, such as "100%" or "8em" (unitless numbers are interpreted as px)
- per=...
- (default is false), when set to any value (true), adds a percentage to the bar as well
- ref=...
- (default is blank), may be used to add a reference/citation for the numbers.
Examples
সম্পাদনা কৰকCode | Result |
---|---|
{{Composition bar|50|100|red}}
|
৫০ / ১০০
|
{{Composition bar|50|100|red|background-color=#DDD|border=none}}
|
৫০ / ১০০
|
{{Composition bar|50|100|#99F|width=85%}}
|
৫০ / ১০০
|
{{Composition bar|50|100|{{Green Party (UK)/meta/color}}}}
|
৫০ / ১০০
|
{{Composition bar|50|100|rgb(255,255,16)}}
|
৫০ / ১০০
|
{{Composition bar|75|100|#FF0}}
|
৭৫ / ১০০
|
{{Composition bar|40|100|#F00|per=1}}
|
৪০ / ১০০ (40%)
|
{{Composition bar|90|100|#F0F0F0|per=1|background-color=#F00}}
|
৯০ / ১০০ (90%)
|
{{Composition bar|90|100|#F0C|per=1}}
|
৯০ / ১০০ (90%)
|
{{Composition bar|0|26|hex=#00BFFF|per=1}}
|
০ / ২৬ (0%)
|
TemplateData
সম্পাদনা কৰকComposition bar
A composition bar.
পেৰামিটাৰ | বিৱৰণ | প্ৰকাৰ | স্থিতি | |
---|---|---|---|---|
1 | 1 | The number of sub-units. | শাৰী | প্ৰয়োজনীয় |
2 | 2 | The total number of sub-units possible. | শাৰী | প্ৰয়োজনীয় |
3 | 3 hex | The background color of the left part of the bar - a valid web color, which can be specified by name, as a hex triplet (#rrbbgg), or rgb triplet (rgb(0–255,0–255,0–255)). In the case of political parties, most will have their logo color available in {{political party/meta/color}} templates.
| শাৰী | ঐচ্ছিক |
Background color | background-color | The background color of the right part of the bar - a valid web color.
| শাৰী | ঐচ্ছিক |
Border color | border border-color | The color of the border, or 'none' for no border
| শাৰী | ঐচ্ছিক |
Width | width | The width of the bar with units, such as 100% or 10em (unitless numbers are interpreted as px)
| শাৰী | ঐচ্ছিক |
Show percent | per | When set to 1 (true), adds a percentage to the bar as well
| শাৰী | ঐচ্ছিক |
See also
সম্পাদনা কৰক The above documentation is transcluded from সাঁচ:Composition bar/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |