(better design) |
(half default height, add more options) |
||
Line 3: | Line 3: | ||
{{#if:{{{show_total|}}}|<div style="flex-basis:34%; text-align:center">Total: {{#expr: {{{1|46}}} + {{{2|154}}} }}</div>}} | {{#if:{{{show_total|}}}|<div style="flex-basis:34%; text-align:center">Total: {{#expr: {{{1|46}}} + {{{2|154}}} }}</div>}} | ||
<div style="flex-basis:{{#if:{{{show_total|}}}|33|50}}%; text-align:right;">{{{2|154}}} ({{#expr: 100 - ({{{1|46}}} / ({{{1|46}}} + {{{2|154}}})) * 100 round 0 }}%)</div> | <div style="flex-basis:{{#if:{{{show_total|}}}|33|50}}%; text-align:right;">{{{2|154}}} ({{#expr: 100 - ({{{1|46}}} / ({{{1|46}}} + {{{2|154}}})) * 100 round 0 }}%)</div> | ||
<div style="background-color:green; width:100%; height: | <div style="background-color:{{{color2|green}}}; width:100%; height:{{{height|2em}}}; border:1px black solid; box-sizing:border-box;> | ||
<div style="background-color:orange; height:100%; border-right:1px black solid; box-sizing:border-box; width:{{#expr: ({{{1|46}}} / ({{{1|46}}} + {{{2|154}}})) * 100 round 0 }}%"> | <div style="background-color:{{{color1|{{{color|orange}}}}}}; height:100%; border-right:1px black solid; box-sizing:border-box; width:{{#expr: ({{{1|46}}} / ({{{1|46}}} + {{{2|154}}})) * 100 round 0 }}%"> | ||
</div></div> | </div></div> | ||
</div><noinclude> | </div><noinclude> | ||
Line 23: | Line 23: | ||
"description": "The second value.", | "description": "The second value.", | ||
"required": true | "required": true | ||
}, | |||
"height": { | |||
"label": "Height", | |||
"type": "string", | |||
"description": "Customise the height of the bar.", | |||
"default": "2em" | |||
}, | |||
"color1": { | |||
"label": "1st value color", | |||
"aliases": ["color"], | |||
"type": "string", | |||
"description": "Customise the color of the first value.", | |||
"default": "orange" | |||
}, | |||
"color2": { | |||
"label": "2nd value color", | |||
"type": "string", | |||
"description": "Customise the color of the second value.", | |||
"default": "green" | |||
}, | }, | ||
"show_total": { | "show_total": { |
Latest revision as of 00:09, 12 December 2024
46 (23%)
154 (77%)
Compares two values. The percentages are of the total.
Parameter | Description | Type | Status | |
---|---|---|---|---|
1st value | 1 | The first value. | Number | required |
2nd value | 2 | The second value. | Number | required |
Height | height | Customise the height of the bar.
| String | optional |
1st value color | color1 color | Customise the color of the first value.
| String | optional |
2nd value color | color2 | Customise the color of the second value.
| String | optional |
Show total switch | show_total | Use with any input to show the total of the two values. | String | optional |