Template:Bar box/doc
Used for construction of horizontal bar charts.
Usage
{{Bar box
|width =
|barwidth =
|float =
|title =
|titlebar =
|left1 =
|left2 =
|right1 =
|right2 =
|bars =
|caption =
}}
- Bar box scheme
⇤---------------------------------------- width ----------------------------------------⇥background color= titlebartitle | ||||
left1 | left2 | ⇤--- barwidth ---⇥ | right1 | right2 |
| or | ||||
left1 | ⇤--- barwidth ---⇥ | right1 | ||
bars | ||||
caption | ||||
Template parameters
- TemplateData
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.
Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either useTemplateData=1 or useTemplateData=only on the /doc subpage and transcluding it with {{Documentation}} into the template. <nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.
Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw <templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.
Wikipedia's help about TemplateData • Commons-specific information
Used for construction of horizontal bar charts.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| bars | bars | any number of whether "Template:Bar percent" or "Template:Bar pixel" | Content | required |
| barwidth | barwidth | width of the bar area in px
| Number | optional |
| caption | caption | caption under the chart | Content | optional |
| float | float | side to which the graph is moved (none/left/right)
| Line | optional |
| first left column header text | left1 | content of first left column header | Content | optional |
| second left column header text | left2 | content of second left column header | Content | optional |
| first right column header text | right1 | content of first right column header | Content | optional |
| second right column header text | right2 | content of second right column header | Content | optional |
| style | style | additional CSS styles for the whole table | Content | optional |
| title | title | title of the chart | Content | optional |
| titlebar color | titlebar | background color of the title (i.e. red, #00FF00, rgb(0, 0, 255))
| Line | optional |
| width | width | width of the graph in px
| Number | optional |
Additional information
The template is intended to be used in the following namespaces: all namespaces
The template is intended to be used by the following user groups: all users
Relies on:
Example
{{Bar box|title =Beer consumption 🍺 |width =500 |barwidth =500 |float =right |titlebar =lightskyblue |left1 =Country |left2 =left2 |right1 =right1 |right2 =in numbers |bars = {{bar pixel|{{W|Germany||en}}|red|120| litres}} {{bar pixel|USA<sup>{{W|United States of America|1|en}}</sup>|silver|73| this text is invisible|in plastic cups}} {{bar percent|Czech|#FF8822|51}} {{bar percent|Denmark|lightskyblue|13|in glasses}} |caption =All numbers are estimated }}
renders as:
Localization
This template is not intended to be localized.