Template:Data bars/doc

Usage
This is a template for displaying a bar chart.

Title, Scale, Source and Alignment
Optional named parameters include title, scale and source.
 * A title appears bolded and centered above the chart.
 * A scale is needed for handling very small or large numbers.
 * A source tells the viewer where the data came from.

Also, to center or to float a chart left or right, specify center, right or left in parameter align (aka float). For example:

Orientation, Borders, Details and Averages
There are sixteen styles to choose from.
 * Odd numbered styles are vertical.
 * Even numbered styles are horizontal.
 * Styles 3 and 4 have borders and shading.
 * Styles 5 thru 8 are the same as 1 thru 4, but show additional detail.
 * Styles 9 thru 16 are the same as 1 thru 8, but averages are displayed with the color key, instead of totals.

For example, here's one using style=8 :

Method
This template employs five "sub-templates." A table is created using the columns and rows of data.
 * draws each vertical or horizontal rectangle optionally colored and labeled with a name and/or a value.
 * handles one column of data.

If style is > 8, the data is passed along to other sub-templates to display averages instead of totals with the color key.
 * calculates the averages of all the rows of data.
 * assigns the averages to named parameters for display as a single complex bar.
 * draws a vertical labeled bar of averages serving as a color key.