This site is supported by donations to The OEIS Foundation.
Template:Pie chart/slice
From OeisWiki
The following documentation is located at Template:Pie chart/slice/doc. [<Edit> Template:Pie chart/slice/doc]
[⧼Purge⧽ Template:Pie chart/slice]
[⧼Purge⧽ Template:Pie chart/slice]
This template is not intended to be used directly. It is used to draw individual slices of pie charts within {{Pie chart}}. Please see that template's documentation for more information.
Contents
Usage
-
{{Pie chart/slice|color|value}}
where
-
color
is a CSS color code or name. -
value
is the percentage that the slice represents. Do not include the percent sign.
Example
{{canvas|float = center| {{Pie chart/slice|red|20}} {{Pie chart/slice|green|40}} {{Pie chart/slice|yellow|60}} {{Pie chart/slice|blue|80}} {{Pie chart/slice|purple|100}} }} |
gives |
|
<!-- <style type="text/css"> /* thumbnails */ div.thumb { border: none; width: auto; margin-top: 0.5em; margin-bottom: 0.8em; background-color: transparent; } /* @noflip */ div.tleft { float: left; clear: left; margin: 0.5em 1.4em 0.8em 0; } /* @noflip */ div.tright { float: right; clear: right; margin: 0.5em 0 0.8em 1.4em; } /* Minimum thumb width */ .thumbinner { min-width: 100px; } </style> --><div class="thumb t{{{thumb|right}}}" style="border: none; width: auto; margin-top: 0.5em; margin-bottom: 0.8em; background-color: transparent; {{#switch: t{{{thumb|right}}} | tleft = float: left; clear: left; margin: 0.5em 1.4em 0.8em 0; | tright = float: right; clear: right; margin: 0.5em 0 0.8em 1.4em; }} "><div class="thumbinner" style="min-width: 100px; width: 200px;"> <!-- Pie --> <div style="background-color: white; margin: auto; position: relative; width: 200px; height: 200px; overflow: hidden;"> {{Pie chart/slice | <!--{{{color3|blue}}}-->blue | <!--{{#expr: {{{value1}}}+{{{value2}}}+{{{value3}}} }}-->{{#expr: 60 }} }} {{Pie chart/slice | <!--{{{color2|green}}}-->green | <!--{{#expr: {{{value1}}}+{{{value2}}} }}-->{{#expr: 25 }} }} {{Pie chart/slice | <!--{{{color1|red}}}-->red | <!--{{{value1}}}-->15 }} <div style="position: absolute; left: 0; top: 0">[[File:Circle frame.svg|200px|link=]]</div> </div> </div></div> |
gives |
|
See also
- {{Pie chart}}