User:Darkid/Template:Chart Bar: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "<includeonly><div style="overflow:hidden; width:{{{width|100%}}}; margin: none; font-size:x-small; text-align:right; {{{style|}}}"><!-- --><span style=" width: {{#expr: {{...")
 
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
width: {{#expr: {{formatnum:{{{1|0}}}|R}} / {{formatnum:{{{max|100}}}|R}} * 100}}%;
width: {{#expr: {{formatnum:{{{1|0}}}|R}} / {{formatnum:{{{max|100}}}|R}} * 100}}%;
height: {{{height|16px}}};
height: {{{height|16px}}};
background:{{{hex|#F3A957}}};
background:{{{hex|#5081D1}}};
float:left;
float:left;
line-height:{{{height|16px}}};
line-height:{{{height|16px}}};
{{{style1|}}}
{{{style1|}}}
">&nbsp;{{#if:{{{hover|}}}|{{tooltip|{{formatnum:{{{1|}}}}}|{{{hover}}}}}|{{formatnum:{{{1|}}}}}}}&nbsp;</span><!--  
">&nbsp;{{#if:{{{hover|}}}|<span id="tooltip" style="cursor:help; border-bottom:1px dotted" title="{{{hover}}}">{{formatnum:{{{1|}}}}}</span>|{{formatnum:{{{1|}}}}}}}&nbsp;</span><!--  
--></div></includeonly><noinclude>
--></div></includeonly><noinclude>
Draws a single horizontal percentage bar. Does not display the input value to a percentage. Default max value is 100.
Draws a single horizontal percentage bar. Does not display the input value to a percentage. Default max value is 100.


<pre>
<pre>
{{User:Darkid/Chart bar|33}}
{{User:Darkid/Template:Chart Bar|33}}
</pre>
</pre>
Generates:
Generates:
{{User:Darkid/Chart bar|33}}
{{User:Darkid/Template:Chart Bar|33}}




The max value can be edited.
The max value can be edited.
<pre>
<pre>
{{User:Darkid/Chart bar|360|max=500}}
{{User:Darkid/Template:Chart Bar|360|max=500}}
</pre>
</pre>
Generates:
Generates:
{{User:Darkid/Chart bar|360|max=500}}
{{User:Darkid/Template:Chart Bar|360|max=500}}




The bar color can be changed, and text can be made to appear on rollover.
The bar color can be changed, and text can be made to appear on rollover.
<pre>
<pre>
{{User:Darkid/Chart bar|33|hex=#c5c5c5|hover=Light grey}}
{{User:Darkid/Template:Chart Bar|33|hex=#c5c5c5|hover=Light grey}}
{{User:Darkid/Chart bar|54|hex=#a4a4a4|hover=Dark grey}}
{{User:Darkid/Template:Chart Bar|54|hex=#a4a4a4|hover=Dark grey}}
{{User:Darkid/Chart bar|19|hex=#865839|hover=Brown}}
{{User:Darkid/Template:Chart Bar|19|hex=#865839|hover=Brown}}
</pre>
</pre>
Generates:
Generates:
{{User:Darkid/Chart bar|33|hex=#c5c5c5|hover=Light grey}}
{{User:Darkid/Template:Chart Bar|33|hex=#c5c5c5|hover=Light grey}}
{{User:Darkid/Chart bar|54|hex=#a4a4a4|hover=Dark grey}}
{{User:Darkid/Template:Chart Bar|54|hex=#a4a4a4|hover=Dark grey}}
{{User:Darkid/Chart bar|19|hex=#865839|hover=Brown}}
{{User:Darkid/Template:Chart Bar|19|hex=#865839|hover=Brown}}




The max width can be edited.
The max width can be edited.
<pre>
<pre>
{{User:Darkid/Chart bar|100|width=10%}}
{{User:Darkid/Template:Chart Bar|100|width=10%}}
{{User:Darkid/Chart bar|100|width=30%}}
{{User:Darkid/Template:Chart Bar|100|width=30%}}
{{User:Darkid/Chart bar|100|width=80%}}
{{User:Darkid/Template:Chart Bar|100|width=80%}}
</pre>
</pre>
Generates:
Generates:
{{User:Darkid/Chart bar|100|width=10%}}
{{User:Darkid/Template:Chart Bar|100|width=10%}}
{{User:Darkid/Chart bar|100|width=30%}}
{{User:Darkid/Template:Chart Bar|100|width=30%}}
{{User:Darkid/Chart bar|100|width=80%}}
{{User:Darkid/Template:Chart Bar|100|width=80%}}


</noinclude>
</noinclude>

Latest revision as of 14:51, 15 September 2015

Draws a single horizontal percentage bar. Does not display the input value to a percentage. Default max value is 100.

{{User:Darkid/Template:Chart Bar|33}}

Generates:

 33 


The max value can be edited.

{{User:Darkid/Template:Chart Bar|360|max=500}}

Generates:

 360 


The bar color can be changed, and text can be made to appear on rollover.

{{User:Darkid/Template:Chart Bar|33|hex=#c5c5c5|hover=Light grey}}
{{User:Darkid/Template:Chart Bar|54|hex=#a4a4a4|hover=Dark grey}}
{{User:Darkid/Template:Chart Bar|19|hex=#865839|hover=Brown}}

Generates:

 33 
 54 
 19 


The max width can be edited.

{{User:Darkid/Template:Chart Bar|100|width=10%}}
{{User:Darkid/Template:Chart Bar|100|width=30%}}
{{User:Darkid/Template:Chart Bar|100|width=80%}}

Generates:

 100 
 100 
 100