Difference between revisions of "Template:Data bars/column"

From blackwiki
Jump to navigation Jump to search
imported>Jonathan Lane Studeman
imported>WOSlinker
(tidy style for better HTML5 compatibility)
 
Line 45: Line 45:
 
--->|name=<!----
 
--->|name=<!----
 
---------->{{#if:{{{detailed|}}}|{{{1|0}}}|}}}}
 
---------->{{#if:{{{detailed|}}}|{{{1|0}}}|}}}}
{{!}} |}} valign="bottom" style="padding-left:2px;padding-bottom:2px;" {{!}} <small><!----------------------
+
{{!}} |}} style="vertical-align:bottom;padding-left:2px;padding-bottom:2px;" {{!}} <small><!----------------------
 
---                        ---
 
---                        ---
 
---  adding up the column  ---
 
---  adding up the column  ---
Line 69: Line 69:
 
{{!}}
 
{{!}}
 
{{{!}} align="center" cellpadding="0" cellspacing="0"
 
{{{!}} align="center" cellpadding="0" cellspacing="0"
{{!}} align="center" {{!}}  
+
{{!}} style="text-align:center;" {{!}}  
 
{{{!}} cellpadding="0" cellspacing="0"
 
{{{!}} cellpadding="0" cellspacing="0"
{{!}}  width="32px" align="center" {{!}} <sub>{{#expr:<!--------
+
{{!}}  width="32px" style="text-align:center;" {{!}} <sub>{{#expr:<!--------
 
---->{{{1|0}}}<!---
 
---->{{{1|0}}}<!---
 
--->+{{{2|0}}}<!---
 
--->+{{{2|0}}}<!---
Line 119: Line 119:
  
 
{|
 
{|
|- valign="top"
+
|- style="vertical-align:top;"
 
! style="padding-right:32px;" | Examples:
 
! style="padding-right:32px;" | Examples:
 
|
 
|

Latest revision as of 23:16, 27 February 2015


This sub-template handles one "column" of data (zero and positive numbers only) to produce a bar for display inside a barchart table.

No more than eight numbers are accepted as unnamed parameters
Colors are named color1, color2, color3, and so on, up to eight colors.
A style number may be specified. If even, the bar is horizontal.
A scale number may be specified. If so, the bar size in pixels becomes scale times data.

The template call must be enclosed within a table.

Examples:
Default style = 1, scale = 1
{| <!------ begin table ------>

{{Data bars/column
|16|color1=red
|32|color2=yellow
|64|color3=green
|48|color4=blue
}}

|} <!------ end table ------>
160
Specified style = 2, scale = 0.001
{| <!------ begin table ------>

{{Data bars/column
|style = 2
|scale = 0.001
|16000|color1=red
|32000|color2=yellow
|64000|color3=green
|48000|color4=blue
}} 

|} <!------ end table ------> 
160000