Difference between revisions of "Template:Demo-inline"

From blackwiki
Jump to navigation Jump to search
test>Swpb
test>Swpb
Line 1: Line 1:
<includeonly>
+
<includeonly><!--color:--><div style="display: inline-block; position: absolute;
{{#ifexpr: {{datefmt|1/1/{{#expr: ({{{year-interval}}}*{{{1}}}-{{{year-interval}}})+2006}}}} < {{datefmt|{{{end-date}}}}} |
+
bottom: {{#expr: 100*({{component|{{{1}}}|3}}-{{component|{{{1}}}|2}})/(1.1*{{{max-tot|}}}) }}%;
 +
height: {{#expr: 100*{{component|{{{1}}}|2}}/(1.1*{{{max-tot|}}}) }}%;
 +
left: {{NPVIC chart/percent|date={{#if: {{component|{{{1}}}|start}}|{{component|{{{1}}}|start}}|12/31/{{rounddown|{{str rightc|{{#if: {{component|{{{1}}}|end}}|{{component|{{{1}}}|end}}|{{component|{{{1}}}|census}}}}|4}}}}}}|end-date={{{end-date}}}}}%;
 +
right: {{max|0|{{#expr: 100-{{NPVIC chart/percent|date={{#if: {{component|{{{1}}}|end}}|{{component|{{{1}}}|end}}|12/31/{{roundup|{{str rightc|{{#if: {{component|{{{1}}}|start}}|{{component|{{{1}}}|start}}|{{#expr: {{component|{{{1}}}|census}}+1}}}}|4}}|-1}}}}|end-date={{{end-date}}}}}}}}}%;
 +
border-top: 1px solid green;
 +
{{#if: {{component|{{{1}}}|old-tot}}||border-left: 1px solid green;}}
 +
border-width: 1px;
 +
background-color: rgba(136, 255, 136, .65);"></div>
  
<!--outer marker and label--><div style="display: inline-block; position: absolute; text-align:center;
+
{{#if: {{component|{{{1}}}|old-tot}} |
bottom: -10px;
+
<!--line:--><div style="display: inline-block; position: absolute;
height: 10px;
+
bottom: {{#ifexpr: {{component|{{{1}}}|3}} < {{component|{{{1}}}|old-tot}} | {{#expr: 100*({{component|{{{1}}}|3}})/(1.1*{{{max-tot|}}}) }} | {{#expr: 100*{{component|{{{1}}}|old-tot}}/(1.1*{{{max-tot|}}}) }} }}%;
left: {{#expr: 100*({{datefmt|1/1/{{#expr: ({{{year-interval}}}*{{{1}}}-{{{year-interval}}})+2006}}}}-{{datefmt|1/1/2006}})/({{datefmt|{{{end-date}}}}}-{{datefmt|1/1/2006}}) }}%;
+
height: {{#ifexpr: {{component|{{{1}}}|3}} < {{component|{{{1}}}|old-tot}} | {{#expr: 100*abs({{component|{{{1}}}|3}}-{{#if: {{component|{{{1}}}|old-tot}} | {{component|{{{1}}}|old-tot}} | 0}})/(1.1*{{{max-tot|}}}) }} | {{#expr: 100*({{component|{{{1}}}|3}}-{{component|{{{1}}}|old-tot}})/(1.1*{{{max-tot|}}}) }} }}%;
right: {{max|0|{{#expr: 100-(100*({{datefmt|1/1/{{#expr:({{{year-interval}}}*{{{1}}}-{{{year-interval}}})+2007}} }}-{{datefmt|1/1/2006}})/({{datefmt|{{{end-date}}}}}-{{datefmt|1/1/2006}})) }} }}%;
+
left: {{NPVIC chart/percent|date={{#if: {{component|{{{1}}}|start}}|{{component|{{{1}}}|start}}|12/31/{{rounddown|{{str rightc|{{#if: {{component|{{{1}}}|end}}|{{component|{{{1}}}|end}}|{{component|{{{1}}}|census}}}}|4}}}}}}|end-date={{{end-date}}}}}%;
border-left: 1px solid; font-size: {{#expr: 90*{{{size|500}}}/500 }}%;">{{#ifexpr: {{datefmt|7/1/{{#expr: {{{year-interval}}}*{{{1}}}-{{{year-interval}}}+2006}} }} < {{datefmt|{{{end-date}}}}} |''''{{str rightc|{{#expr: ({{{year-interval}}}*{{{1}}}-{{{year-interval}}})+2006}} |2}}'''|}}</div>
+
right: {{max|0|{{#expr: 100-{{NPVIC chart/percent|date={{#if: {{component|{{{1}}}|end}}|{{component|{{{1}}}|end}}|12/31/{{roundup|{{str rightc|{{#if: {{component|{{{1}}}|start}}|{{component|{{{1}}}|start}}|{{#expr: {{component|{{{1}}}|census}}+1}}}}|4}}|-1}}}}|end-date={{{end-date}}}}}}}}}%;
 
+
margin-bottom: 1px;
|}}</includeonly><noinclude>
+
border-left: 1px solid green;
 +
border-width: 1px;
 +
{{#if: {{component|{{{1}}}|end}} | border-right: 1px solid green; |}}"></div>
 +
|
 +
<!--state label:--><div style="display: inline-block; position: absolute; align: right;
 +
bottom: {{#expr: 100*({{component|{{{1}}}|3}})/(1.1*{{{max-tot|}}})+{{#if: {{component|{{{1}}}|y-offset}}|{{component|{{{1}}}|y-offset}}|0}} }}%;
 +
right: {{#expr: 100-{{NPVIC chart/percent|date={{#if: {{component|{{{1}}}|start}}|{{component|{{{1}}}|start}}|12/31/{{rounddown|{{str rightc|{{#if: {{component|{{{1}}}|end}}|{{component|{{{1}}}|end}}|{{component|{{{1}}}|census}}}}|4}}}}}}|end-date={{{end-date}}}}}-{{#if: {{component|{{{1}}}|x-offset}}|{{component|{{{1}}}|x-offset}}|0}} }}%;
 +
font-size: {{#expr: 75*{{{size|500}}}/500 }}%;">{{component|{{{1}}}|1}}</div>
 +
}}</includeonly><noinclude>
 
{{subtemplate}}
 
{{subtemplate}}
Draws horizontal markers and labels at the specified interval
+
Draws a div bar with the specified bottom, height, and start and end dates
 
</noinclude>
 
</noinclude>

Revision as of 14:38, 30 January 2017

Template:Subtemplate Draws a div bar with the specified bottom, height, and start and end dates