Difference between revisions of "Template:Bar chart/bar"
Jump to navigation
Jump to search
imported>Kozuch m (moved Template:Bar graph/bar to Template:Bar chart/bar) |
imported>Jdlrobson (Tested here https://test.wikipedia.org/w/index.php?title=User:Jon/Bar_chart&mobileaction=toggle_view_desktop on various browsers (IE, Firefox, Chrome) * Bars in mobile are now hidden (see https://phabricator.wikimedia.org/T118767) * DIV inside the tab...) |
||
| Line 1: | Line 1: | ||
| − | <div style="height: 1.25em; | + | <div style="height: 1.25em; position:relative;"><div class="nomobile" style="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; top: 0; height:1.25em; 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> | ||
Revision as of 19:31, 3 December 2015
300,000
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 }}
widthis a number which determines the maximum width of the barwidth_unitsare the units associated with the width (em, px, or %). The default is em.dataandtotalare used to determine the width of the bar usingdata/totalto compute a percentage ofwidth.datais also used for the label on each bar.coloris 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.
bs:Šablon:Trakasti grafikon/traka mk:Шаблон:Столбен графикон/столб ur:سانچہ:Bar chart/bar
| The above documentation is transcluded from Template:Bar chart/bar/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |