Difference between revisions of "Template:Data bars"
Jump to navigation
Jump to search
imported>Jonathan Lane Studeman |
imported>WOSlinker (tidy style for better HTML5 compatibility) |
||
| Line 4: | Line 4: | ||
{{#if:{{{{{#expr:3+(2*{{{columns|1}}})}}|}}}|| | {{#if:{{{{{#expr:3+(2*{{{columns|1}}})}}|}}}|| | ||
{{!}}- | {{!}}- | ||
| − | {{!}} | + | {{!}} style="text-align:center;" {{!}} {{{{{#expr:2+{{{columns|1}}}}}|}}}}} |
|- | |- | ||
| | | | ||
| − | {| {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}|cellspacing="8"|}}}} | + | {| {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}|cellspacing="8"|}}}} style="text-align:center;border-collapse:collapse;{{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}*{{#expr:{{{style|1}}}<>5}}*{{#expr:{{{style|1}}}<>6}}*{{#expr:{{{style|1}}}<>9}}*{{#expr:{{{style|1}}}<>10}}*{{#expr:{{{style|1}}}<>13}}*{{#expr:{{{style|1}}}<>14}}>2|background:#eee; border-left:1px solid #777; border-top:1px solid #777; border-right:1px solid #ccc; border-bottom:1px solid #ccc;|}}}}" |
| − | | | + | | style="text-align:center;" {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}*{{#expr:{{{style|1}}}<>5}}*{{#expr:{{{style|1}}}<>6}}*{{#expr:{{{style|1}}}<>9}}*{{#expr:{{{style|1}}}<>10}}*{{#expr:{{{style|1}}}<>13}}*{{#expr:{{{style|1}}}<>14}}>2|style="padding:8px 8px 8px 8px;"|}}}} | |
{| cellspacing="0" cellpadding="2" | {| cellspacing="0" cellpadding="2" | ||
| − | |- | + | |- style="vertical-align:bottom;" |
<!------------- | <!------------- | ||
-- Column 1 -- | -- Column 1 -- | ||
--------------> | --------------> | ||
{{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | ||
| − | ! | + | ! style="text-align:right;vertical-align:bottom;padding-right:4px;" {{!}} {{{1|xxx}}}|}}}} |
{{Data bars/column | {{Data bars/column | ||
| detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | | detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | ||
| Line 41: | Line 41: | ||
-------------->{{#ifexpr:{{{columns|1}}}>1| | -------------->{{#ifexpr:{{{columns|1}}}>1| | ||
{{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | ||
| − | ! | + | ! style="text-align:right;vertical-align:bottom;padding-right:4px;" {{!}} {{{2|xxx}}}|}}}} |
{{Data bars/column | {{Data bars/column | ||
| detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | | detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | ||
| Line 67: | Line 67: | ||
-------------->{{#ifexpr:{{{columns|1}}}>2| | -------------->{{#ifexpr:{{{columns|1}}}>2| | ||
{{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | ||
| − | ! | + | ! style="text-align:right;vertical-align:bottom;padding-right:4px;" {{!}} {{{3|xxx}}}|}}}} |
{{Data bars/column | {{Data bars/column | ||
| detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | | detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | ||
| Line 93: | Line 93: | ||
-------------->{{#ifexpr:{{{columns|1}}}>3| | -------------->{{#ifexpr:{{{columns|1}}}>3| | ||
{{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | ||
| − | ! | + | ! style="text-align:right;vertical-align:bottom;padding-right:4px;" {{!}} {{{4|xxx}}}|}}}} |
{{Data bars/column | {{Data bars/column | ||
| detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | | detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | ||
| Line 119: | Line 119: | ||
-------------->{{#ifexpr:{{{columns|1}}}>4| | -------------->{{#ifexpr:{{{columns|1}}}>4| | ||
{{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | ||
| − | ! | + | ! style="text-align:right;vertical-align:bottom;padding-right:4px;" {{!}} {{{5|xxx}}}|}}}} |
{{Data bars/column | {{Data bars/column | ||
| detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | | detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | ||
| Line 145: | Line 145: | ||
-------------->{{#ifexpr:{{{columns|1}}}>5| | -------------->{{#ifexpr:{{{columns|1}}}>5| | ||
{{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | ||
| − | ! | + | ! style="text-align:right;vertical-align:bottom;padding-right:4px;" {{!}} {{{6|xxx}}}|}}}} |
{{Data bars/column | {{Data bars/column | ||
| detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | | detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | ||
| Line 171: | Line 171: | ||
-------------->{{#ifexpr:{{{columns|1}}}>6| | -------------->{{#ifexpr:{{{columns|1}}}>6| | ||
{{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | ||
| − | ! | + | ! style="text-align:right;vertical-align:bottom;padding-right:4px;" {{!}} {{{7|xxx}}}|}}}} |
{{Data bars/column | {{Data bars/column | ||
| detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | | detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | ||
| Line 197: | Line 197: | ||
-------------->{{#ifexpr:{{{columns|1}}}>7| | -------------->{{#ifexpr:{{{columns|1}}}>7| | ||
{{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | ||
| − | ! | + | ! style="text-align:right;vertical-align:bottom;padding-right:4px;" {{!}} {{{8|xxx}}}|}}}} |
{{Data bars/column | {{Data bars/column | ||
| detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | | detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | ||
| Line 223: | Line 223: | ||
-------------->{{#ifexpr:{{{columns|1}}}>8| | -------------->{{#ifexpr:{{{columns|1}}}>8| | ||
{{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | ||
| − | ! | + | ! style="text-align:right;vertical-align:bottom;padding-right:4px;" {{!}} {{{9|xxx}}}|}}}} |
{{Data bars/column | {{Data bars/column | ||
| detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | | detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | ||
| Line 249: | Line 249: | ||
-------------->{{#ifexpr:{{{columns|1}}}>9| | -------------->{{#ifexpr:{{{columns|1}}}>9| | ||
{{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | ||
| − | ! | + | ! style="text-align:right;vertical-align:bottom;padding-right:4px;" {{!}} {{{10|xxx}}}|}}}} |
{{Data bars/column | {{Data bars/column | ||
| detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | | detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | ||
| Line 275: | Line 275: | ||
-------------->{{#ifexpr:{{{columns|1}}}>10| | -------------->{{#ifexpr:{{{columns|1}}}>10| | ||
{{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | ||
| − | ! | + | ! style="text-align:right;vertical-align:bottom;padding-right:4px;" {{!}} {{{11|xxx}}}|}}}} |
{{Data bars/column | {{Data bars/column | ||
| detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | | detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | ||
| Line 301: | Line 301: | ||
--------------->{{#ifexpr:{{{columns|1}}}>11| | --------------->{{#ifexpr:{{{columns|1}}}>11| | ||
{{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | ||
| − | ! | + | ! style="text-align:right;vertical-align:bottom;padding-right:4px;" {{!}} {{{12|xxx}}}|}}}} |
{{Data bars/column | {{Data bars/column | ||
| detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | | detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | ||
| Line 327: | Line 327: | ||
--------------->{{#ifexpr:{{{columns|1}}}>12| | --------------->{{#ifexpr:{{{columns|1}}}>12| | ||
{{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | ||
| − | ! | + | ! style="text-align:right;vertical-align:bottom;padding-right:4px;" {{!}} {{{13|xxx}}}|}}}} |
{{Data bars/column | {{Data bars/column | ||
| detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | | detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | ||
| Line 353: | Line 353: | ||
--------------->{{#ifexpr:{{{columns|1}}}>13| | --------------->{{#ifexpr:{{{columns|1}}}>13| | ||
{{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | ||
| − | ! | + | ! style="text-align:right;vertical-align:bottom;padding-right:4px;" {{!}} {{{14|xxx}}}|}}}} |
{{Data bars/column | {{Data bars/column | ||
| detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | | detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | ||
| Line 379: | Line 379: | ||
--------------->{{#ifexpr:{{{columns|1}}}>14| | --------------->{{#ifexpr:{{{columns|1}}}>14| | ||
{{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | ||
| − | ! | + | ! style="text-align:right;vertical-align:bottom;padding-right:4px;" {{!}} {{{15|xxx}}}|}}}} |
{{Data bars/column | {{Data bars/column | ||
| detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | | detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | ||
| Line 405: | Line 405: | ||
--------------->{{#ifexpr:{{{columns|1}}}>15| | --------------->{{#ifexpr:{{{columns|1}}}>15| | ||
{{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{#expr:{{{style|1}}} / 2 round 0 }}*2={{{style|1}}}| | ||
| − | ! | + | ! style="text-align:right;vertical-align:bottom;padding-right:4px;" {{!}} {{{16|xxx}}}|}}}} |
{{Data bars/column | {{Data bars/column | ||
| detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | | detailed = {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}<5||{{#ifexpr:{{{style|1}}}>8|{{#ifexpr:{{{style|1}}}<13||true}}|true}}}}}} | ||
| Line 438: | Line 438: | ||
----------------->|<!-------no labels if even---- | ----------------->|<!-------no labels if even---- | ||
----------------->|<!------- labels if odd ----> | ----------------->|<!------- labels if odd ----> | ||
| − | {{!}}- | + | {{!}}- style="vertical-align:top;" |
! style="padding-left:4px; padding-right:4px;" {{!}} {{{1|xxx}}} | ! style="padding-left:4px; padding-right:4px;" {{!}} {{{1|xxx}}} | ||
{{#ifexpr:{{{columns|1}}}>1| | {{#ifexpr:{{{columns|1}}}>1| | ||
| Line 473: | Line 473: | ||
|} | |} | ||
|} | |} | ||
| − | | | + | | style="vertical-align:top;" | |
{{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}>8|<!--- | {{#if:{{#ifexpr:1*{{{style|1}}}}}||{{#ifexpr:{{{style|1}}}>8|<!--- | ||
------------------------------ | ------------------------------ | ||
| Line 841: | Line 841: | ||
{{#if:{{{source|}}}| | {{#if:{{{source|}}}| | ||
{{!}}- | {{!}}- | ||
| − | {{!}} colspan="2" | + | {{!}} colspan="2" style="text-align:right;font-style:italic;" {{!}} <small>Source: {{{source|}}}</small>|}} |
|}</includeonly><noinclude> | |}</includeonly><noinclude> | ||
{{Documentation}} | {{Documentation}} | ||
<!-- Add categories to the /doc subpage, not here! --> | <!-- Add categories to the /doc subpage, not here! --> | ||
</noinclude> | </noinclude> | ||
Revision as of 23:02, 27 February 2015
Contents
Usage
This is a template for displaying a bar chart.
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
| Given multiple data rows that look like this: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ↔ Max. data columns: 16 ↔ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{{Data bars
| columns = 12 |Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec
| green| Apples| 60| 70| 90| 30| 50| 30|100|130|120| 90| 50|110
|yellow| Bananas| 90| 80|110| 60| 70| 80| 70| 70| 40| 50| 50| 60
|orange| Oranges| 50| 40| 60|110| 90| 60| 30| 60| 70| 60| 80| 40
}}
|
↕ Max. data rows: 8 ↕ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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:
| Berries | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Total: 272 |
{{Data bars
| align = right
| columns = 6 | Jan| Feb| Mar| Apr| May| Jun
| blue|Berries| 65| 38| 72| 47| 20| 30
}}
|
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:
| Horizontal, with borders, shading and visible detail. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| And here's exactly the same data in style=13, showing averages on the right instead of totals: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Method
This template employs five "sub-templates." A table is created using the columns and rows of data.
- {{Data bars/bar}} draws each vertical or horizontal rectangle optionally colored and labeled with a name and/or a value.
- {{Data bars/column}} 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.
- {{Data bars/averages}} calculates the averages of all the rows of data.
- {{Data bars/averages/display}} assigns the averages to named parameters for display as a single complex bar.
- {{Data bars/averages/column}} draws a vertical labeled bar of averages serving as a color key.
| The above documentation is transcluded from Template:Data bars/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |