Difference between revisions of "Template:Chart bar"
(Created page with '<div style="overflow:hidden; width:{{{width|100%}}}; margin: none; font-size:x-small; text-align:right; {{{style|}}}"><!-- --><span style=" width: {{#expr: {{formatnum:{{{…') |
m |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | <div style="overflow:hidden; width:{{{width|100%}}}; margin: none; font-size:x-small; text-align:right; {{{style|}}}"><!-- | + | <includeonly><div style="overflow:hidden; width:{{{width|100%}}}; margin: none; font-size:x-small; text-align:right; {{{style|}}}"><!-- |
--><span style=" | --><span style=" | ||
− | width: {{#expr: {{formatnum:{{{1|0 | + | width: {{#expr: {{formatnum:{{{1|0}}}|R}} / {{formatnum:{{{max|100}}}|R}} * 100}}%; |
height: {{{height|16px}}}; | height: {{{height|16px}}}; | ||
− | background:{{{ | + | background:{{{hex|#F3A957}}}; |
float:left; | float:left; | ||
line-height:{{{height|16px}}}; | line-height:{{{height|16px}}}; | ||
{{{style1|}}} | {{{style1|}}} | ||
− | "> {{formatnum:{{{1| | + | "> {{#if:{{{hover|}}}|{{tooltip|{{formatnum:{{{1|}}}}}|{{{hover}}}}}|{{formatnum:{{{1|}}}}}}} </span><!-- |
− | --></div><noinclude> | + | --></div></includeonly><noinclude> |
{{Template doc}} | {{Template doc}} | ||
[[Category:Templates|Chart bar]] | [[Category:Templates|Chart bar]] | ||
</noinclude> | </noinclude> |
Latest revision as of 14:18, 10 March 2015
Draws a single horizontal percentage bar. Does not display the input value to a percentage. Default max value is 100.
{{Chart bar|33}}
Generates:
The max value can be edited.
{{Chart bar|360|max=500}}
Generates:
The bar color can be changed, and text can be made to appear on rollover.
{{Chart bar|33|hex=#c5c5c5|hover=Light grey}} {{Chart bar|54|hex=#a4a4a4|hover=Dark grey}} {{Chart bar|19|hex=#865839|hover=Brown}}
Generates:
The max width can be edited.
{{Chart bar|100|width=10%}} {{Chart bar|100|width=30%}} {{Chart bar|100|width=80%}}
Generates: