ढाँचा:Composition bar/कागजात
This template is used on approximately ४,९०० pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on 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. A textless, single line, flexible width version of this template is available at Template:Composition bar textless.
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 #F8F9FA 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|{{party color|Green Party (UK)}}}}
|
५० / १००
|
{{Composition bar|50|100|rgb(255,255,16)}}
|
५० / १००
|
{{Composition bar|75|100|#FF0}}
|
७५ / १००
|
{{Composition bar|40|100|#F00|per=1}}
|
४० / १०० (४०%)
|
{{Composition bar|90|100|#F0F0F0|per=1|background-color=#F00}}
|
९० / १०० (९०%)
|
{{Composition bar|90|100|#F0C|per=1}}
|
९० / १०० (९०%)
|
{{Composition bar|0|26|hex=#00BFFF|per=1}}
|
० / २६ (०%)
|
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 {{party color|political party}} 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
सम्पादन गर्नुहोस्