Aquesta és una subpàgina de documentació per a la Plantilla:Bartable Té la informació d'ús, les categories i qualsevol altre contingut que no forma part essencial del codi de la plantilla.
{{bartable|value|unit|scale|height|style}}
value (mandatory)
any real number or math expression that evaluates to a number. Commas can be used to group digits. See Help:Calculation for the syntax for math expressions.
unit (default = empty string)
the unit, e.g. "m" for metres. Prepend a space if you want a space between the value and the unit. If unit starts with "/", the value is converted between units (using the convert template) as follows:
"/unit1/unit2/round" converts the value from unit1 to unit2 and rounds it to round decimal places (using {{convert|value|unit1|unit2|round|abbr=on}}). Unfortunately unit1, unit2 or round cannot contain a "/" or a "=" — if anyone knows how to allow it (or translate other characters to it), please help.
scale (default = 1)
a factor multiplied by value to give the width of the bar in pixels. Use the same scale in every row, as otherwise the bar chart won’t be to scale!
scale can be negative, in which case an additional column (for showing negative values) is created. See example below.
height (default = "2ex")
the height of the bar as a CSS measurement e.g. "1em" or "16px".
style (default = empty string)
a CSS style string to apply to the bar, e.g. "background:red;".
{| class="wikitable"
! Example || colspan="2" | Rendering
|-
| Only value || {{bartable|272}}
|-
| Negative value || {{bartable|-72}}
|-
| Math expression || {{bartable|exp(1)*1e2}}
|-
| Value and unit (note added space) || {{bartable|272| km/h}}
|-
| Value and unit (link to definition) || {{bartable|272|[[Degree_(angle)|°]]}}
|-
| Value and unit (with formatting) || align="right"|''θ'' = {{bartable|272|°}}
|-
| Value and unit (with conversion) || {{bartable|272|/km/mi}}
|-
| Value and scale || {{bartable|272||1/(2^0.5)}}
|-
| Value and height || {{bartable|272|||4px}}
|-
| Value and style || {{bartable|272||||background:blue;}}
|-
| Value with commas, and scale || {{bartable|2,720||.1}}
|-
| The full monty || {{bartable|18^2|%|sin(1)|2em|border:ridge red;}}
|-
|}
{| class="wikitable"
! Example || colspan="3" | Rendering
|-
| Only value || {{bartable|272||-1}}
|-
| Negative value || {{bartable|-72||-1}}
|-
| Math expression || {{bartable|exp(1)*1e2||-1}}
|-
| Value and unit (note added space) || {{bartable|272| km/h|-1}}
|-
| Value and unit (link to definition) || {{bartable|272|[[Degree_(angle)|°]]|-1}}
|-
| Value and unit (with formatting) || align="right"|''θ'' = {{bartable|272|°|-1}}
|-
| Value and unit (with conversion) || {{bartable|272|/km/mi|-1}}
|-
| Value and scale || {{bartable|272||-1/(2^0.5)}}
|-
| Value and height || {{bartable|272||-1|4px}}
|-
| Value and style || {{bartable|272||-1||background:blue;}}
|-
| Value with commas, and scale || {{bartable|2,720||-.1}}
|-
| The full monty || {{bartable|18^2|%|sin(-1)|2em|border:ridge red;}}
|-
|}