Template:Bar box/doc

This  template documentation is transcluded for all Bar box/doc including templates'' [ [ edit] ].

Bar box, bar percent, bar pixel, bar log, bar stacked, bar box break, and bar gap are a family of templates for construction of horizontal bar charts.

Chart contents
The chart can contain any number of bars. There are four types:

Percentage bar If value label is not provided, it is constructed from the percentage and "%". This bar type also has the bar percent 2 and bar percent 3 variations which display more bars for the same row label.

Pixel bar If value label is provided, value suffix is ignored. Otherwise, the value label is constructed from the value and the value suffix. This is used as shorthand. Both following examples give identical results: This bar type also has the bar pixel 2 variation which displays two bars for the same row label.

Logarithmic bar Identical to Pixel bar, except the width is calculated as log$base$(value)&times; 30. Default base is 2, which makes a regular sidebar sized graph for values <100. Increase the base to handle larger numbers and make the bars shorter. As with bar pixel, when, they display the same:

Stacked bars sets the "tooltip" of the respective bar and is viewed when hovered over. sets the text-alignment (left, center, right or default) for each column based on the respective initials. All parameters are optional, but if  is not supplied,   has no effect. Use a custom toggle as the default toggle will distort the chart (see the last example).

Gap bar Omitting the  generates a blank row. Another useful  is   which produces a horizontal line.

Break Bar box break is a template to split bar box tables into multiple charts while maintaining alignment of the columns.

Examples
Using bar percent:

Using bar pixel:

Using bar log:

Using bar percent 2:

Using bar stacked:

Alternatives to avoid Wikipedia's Post-expand include size limit
Pages with many boxes and charts may come close to or exceed Wikipedia's Post-expand include size limit. In these cases consider using Module:Bar as follows:
 * Bar box →
 * Bar percent →
 * Bar pixel →
 * Bar log →
 * Bar stacked →
 * Bar gap →