Difference between revisions of "Template:Bar chart/bar/sandbox"

From blackwiki
Jump to navigation Jump to search
imported>Paine Ellsworth
(test)
imported>Paine Ellsworth
(Undid revision 694791966 by Paine Ellsworth (talk) srv)
 
Line 1: Line 1:
<div style="height: 1.25em; width: {{{width|20}}}{{{width_units|em}}};"><div style="position: absolute; background-color: {{{color|rgb(206, 223, 242)}}}; width:{{#expr:{{{width|20}}}*{{formatnum:{{{1|300000}}}|R}}/{{formatnum:{{{2|600000}}}|R}} round 1}}{{{width_units|em}}}; height: 1.25em; margin: 0 0 0 0; z-index: 0;"></div><span style="position: absolute; height:1.25em; width: {{{width|20}}}{{{width_units|em}}}; padding: 0 0 0 2em; z-index: 10;">{{nowrap|{{formatnum:{{{1|300000}}}}}{{#if:{{{comment|}}}|<span style="font-size: 90%; padding-left: 1em;">({{{comment}}})</span>|}}}}</span></div><noinclude>
+
<div style="height: 1.25em; width: {{{width|40}}}{{{width_units|em}}};"><div style="position: absolute; background-color: {{{color|rgb(206, 223, 242)}}}; width:{{#expr:{{{width|40}}}*{{formatnum:{{{1|300000}}}|R}}/{{formatnum:{{{2|600000}}}|R}} round 1}}{{{width_units|em}}}; height: 1.25em; margin: 0 0 0 0; z-index: 0;"></div><span style="position: absolute; height:1.25em; width: {{{width|40}}}{{{width_units|em}}}; padding: 0 0 0 2em; z-index: 10;">{{nowrap|{{formatnum:{{{1|300000}}}}}{{#if:{{{comment|}}}|<span style="font-size: 90%; padding-left: 1em;">({{{comment}}})</span>|}}}}</span></div><noinclude>
 
{{documentation}}
 
{{documentation}}
 
</noinclude>
 
</noinclude>

Latest revision as of 16:15, 11 December 2015

300,000
Template documentation[view] [edit] [history] [purge]

This template can be used to create bars for a horizontal bar chart.

Usage

{{Bar chart/bar| data | total | width = width | width_units = width_units | color = color }}
  • width is a number which determines the maximum width of the bar
  • width_units are the units associated with the width (em, px, or %). The default is em.
  • data and total are used to determine the width of the bar using data/total to compute a percentage of width.
  • data is also used for the label on each bar.
  • color is used to override the default bar color.

See also

  • {{Bar chart}} – uses this template to generate bar charts.
  • {{Composition bar}} – used for displaying the number of seats held by a political party, or other single statistics.