Template:Bars

From Meta, a Wikimedia project coordination wiki
Jump to: navigation, search
[edit] [purge] Template documentation
This template is a work in progress, and some of the features listed below may not work (or may break). Don't use it!

{{bars}} generates bar charts and percentage bars. It supports up to 40 bars, with 6 data series each. The bars are defined as a set of arguments, in the form name_bar#_series#.

Contents

[edit] Terminology

A chart consists of one or more bars, each of which has one or more series. (The series are shown aligned below for simplicity, but their widths are independent of each other.)

chart bar
data series

[edit] Usage

[edit] Arguments

Data series
value_bar_series The numerical value for the given series, represented as a percentage width of the bar.
color_bar_series The color of the series, either as a CSS color name or a hexadecimal color code.
css_bar_series Inline Cascading Style Sheets declarations to apply to the data series.
Chart
total The total value represented by the bar. This is only needed if the total is not the sum of the series. If the sum of the series is less than the total, a default empty bar shows the unfilled portion.

[edit] Examples

[edit] Percentage bar

{{bars
 |value_1_1 = 6
 |total     = 37
}}

[edit] Comparison bar

{{bars
 |value_1_1 = 13
 |value_1_2 = 6
 |value_1_3 = 3
}}

[edit] Complex chart

{{bars
 |value_1_1 = 13
 |value_1_2 = 6
 |value_1_3 = 3
 |color_1_1 = green
 |color_1_2 = red
 |color_1_3 = grey

 |value_2_1 = 26
 |value_2_2 = 2
 |value_2_3 = 1
 |color_2_1 = green
 |color_2_2 = red
 |color_2_3 = grey

 |total     = 30
}}
The above documentation is transcluded from Template:Bars/doc. (edit | history)
Editors can experiment in this template's sandbox (create) and testcases (create) pages.
Please add categories and interwikis to the /doc subpage. Subpages of this template.
Personal tools
Namespaces

Variants
Actions
Navigation
Community
Beyond the Web
Toolbox