<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://suk.frl/w/index.php?action=history&amp;feed=atom&amp;title=Template%3APie_chart%2Fdoc</id>
	<title>Template:Pie chart/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://suk.frl/w/index.php?action=history&amp;feed=atom&amp;title=Template%3APie_chart%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://suk.frl/w/index.php?title=Template:Pie_chart/doc&amp;action=history"/>
	<updated>2026-06-20T14:57:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.1</generator>
	<entry>
		<id>https://suk.frl/w/index.php?title=Template:Pie_chart/doc&amp;diff=3852&amp;oldid=prev</id>
		<title>Ainin: 1 revision imported from :wikipedia:en:Template:Pie_chart/doc</title>
		<link rel="alternate" type="text/html" href="https://suk.frl/w/index.php?title=Template:Pie_chart/doc&amp;diff=3852&amp;oldid=prev"/>
		<updated>2022-08-14T12:05:14Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported from &lt;a href=&quot;https://en.wikipedia.org/wiki/en:Template:Pie_chart/doc&quot; class=&quot;extiw&quot; title=&quot;wikipedia:en:Template:Pie chart/doc&quot;&gt;wikipedia:en:Template:Pie_chart/doc&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:05, 14 August 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Ainin</name></author>
	</entry>
	<entry>
		<id>https://suk.frl/w/index.php?title=Template:Pie_chart/doc&amp;diff=3851&amp;oldid=prev</id>
		<title>wikipedia:en&gt;Dcljr: /* Limitations */ just 100</title>
		<link rel="alternate" type="text/html" href="https://suk.frl/w/index.php?title=Template:Pie_chart/doc&amp;diff=3851&amp;oldid=prev"/>
		<updated>2022-03-12T22:47:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Limitations: &lt;/span&gt; just 100&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Documentation subpage}}&lt;br /&gt;
&amp;lt;!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE --&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This is a template that draws [[pie chart]]s using a single image, a lot of (inline) CSS code generated by parser functions, and &amp;#039;&amp;#039;absolutely no JavaScript&amp;#039;&amp;#039;. Some details of how it works are given [[#How it works|below]].&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
The labels, values, and colors of up to 30 slices may be specified. All the parameters for six slices are included below; to include more slices, copy the code for one of the others, changing the digit at the end of each parameter name.&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{{Pie chart&lt;br /&gt;
| thumb  = &lt;br /&gt;
| radius = &lt;br /&gt;
| caption= &lt;br /&gt;
| footer = &lt;br /&gt;
| label1 = &lt;br /&gt;
| value1 = &lt;br /&gt;
| color1 = &lt;br /&gt;
| label2 = &lt;br /&gt;
| value2 = &lt;br /&gt;
| color2 = &lt;br /&gt;
| label3 = &lt;br /&gt;
| value3 = &lt;br /&gt;
| color3 = &lt;br /&gt;
| label4 = &lt;br /&gt;
| value4 = &lt;br /&gt;
| color4 = &lt;br /&gt;
| label5 = &lt;br /&gt;
| value5 = &lt;br /&gt;
| color5 = &lt;br /&gt;
| label6 = &lt;br /&gt;
| value6 = &lt;br /&gt;
| color6 = &lt;br /&gt;
| other  = &lt;br /&gt;
| other-color = &lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
{{Pie chart&lt;br /&gt;
| radius = 100&lt;br /&gt;
| caption = Default colors&lt;br /&gt;
| label1  = {{gcolor|1}}  | value1 = 7&lt;br /&gt;
| label2  = {{gcolor|2}}  | value2 = 7&lt;br /&gt;
| label3  = {{gcolor|3}}  | value3 = 7&lt;br /&gt;
| label4  = {{gcolor|4}}  | value4 = 7&lt;br /&gt;
| label5  = {{gcolor|5}}  | value5 = 7&lt;br /&gt;
| label6  = {{gcolor|6}}  | value6 = 7&lt;br /&gt;
| label7  = {{gcolor|7}}  | value7 = 7&lt;br /&gt;
| label8  = {{gcolor|8}}  | value8 = 7&lt;br /&gt;
| label9  = {{gcolor|9}}  | value9 = 7&lt;br /&gt;
| label10 = {{gcolor|10}} | value10 = 7&lt;br /&gt;
| label11 = {{gcolor|11}} | value11 = 7&lt;br /&gt;
| label12 = {{gcolor|12}} | value12 = 7&lt;br /&gt;
| label13 = {{gcolor|13}} | value13 = 7&lt;br /&gt;
| label14 = {{gcolor|14}} | value14 = 7&lt;br /&gt;
| other   = y&lt;br /&gt;
}}&lt;br /&gt;
* {{para|thumb}} specifies which side of the page the chart is floated to and defaults to &amp;lt;code&amp;gt;right&amp;lt;/code&amp;gt;, as with image files. To make the chart appear on the &amp;#039;&amp;#039;left&amp;#039;&amp;#039; side of the page, specify {{para|thumb|left}}.&lt;br /&gt;
* {{para|radius}} specifies the radius of the pie chart in pixels. Do not include a &amp;quot;px&amp;quot; suffix. If omitted, it will default to 100.&lt;br /&gt;
* {{para|caption}} specifies a string of text that appears on a line just before the legend.&lt;br /&gt;
* {{para|footer}} specifies a string of text that appears &amp;#039;&amp;#039;below&amp;#039;&amp;#039; the legend.&lt;br /&gt;
* {{para|other}}, if set equal to any visible string (even &amp;quot;0&amp;quot; or &amp;quot;no&amp;quot;), an &amp;quot;Other&amp;quot; item will appear in the legend, corresponding to the final slice that makes the values add up to 100. (If the total is already over 100, then the &amp;quot;Other&amp;quot; percentage will be negative.)&lt;br /&gt;
* {{para|other-color}} can be used to override the default white color of the &amp;quot;Other&amp;quot; slice.&lt;br /&gt;
* Each {{para|label&amp;#039;&amp;#039;N&amp;#039;&amp;#039;}} is a string of text that appears in the legend entry for a slice. Omitting it will cause a legend entry to not be shown for that slice.&lt;br /&gt;
* Each {{para|value&amp;#039;&amp;#039;N&amp;#039;&amp;#039;}} is the percentage that the slice represents. Do &amp;#039;&amp;#039;not&amp;#039;&amp;#039; include the percent sign (e.g., for eighty percent, use the value &amp;quot;80&amp;quot;, not &amp;quot;80%&amp;quot; or &amp;quot;.80&amp;quot;). Collectively, the values must add to 100 or less (in the latter case, a final slice completes the pie, whether {{para|other}} is specified or not). Also note that each value is shown in the legend exactly as written, without any rounding or other reformatting.&lt;br /&gt;
* Each {{para|color&amp;#039;&amp;#039;N&amp;#039;&amp;#039;}} is a [[Web colors|CSS color code or name]]. If omitted, the default color palette seen in the pie chart to the right is used. If you need to graph more than 14 values (not counting the &amp;quot;Other&amp;quot; slice), then you should specify {{para|color15}} onwards in the template call.&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
* Google Chrome and Safari do not appear to [[Spatial anti-aliasing|anti-alias]] borders, so the lines are a bit jagged. (For Chrome, this issue seems to be resolved, as of version 26.)&lt;br /&gt;
* Due to how the graphing is implemented, it is not possible to save a copy of the chart using the browser&amp;#039;s &amp;quot;Save Image&amp;quot; function (however, a [[screenshot]] can be taken).&lt;br /&gt;
* If {{para|other}} is set, the final slice is always labeled as &amp;quot;Other&amp;quot; in the legend. This is not configurable. If you don&amp;#039;t like that, just add to the template call another slice with the appropriate value (to sum to 100) and the desired label, and don&amp;#039;t use {{para|other}}.&lt;br /&gt;
* No labels can be put on the slices themselves.&lt;br /&gt;
* The maximum number of slices that can be displayed is &amp;#039;&amp;#039;&amp;#039;30&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
* Currently the default colors used for slices 15 onwards are all the same as the default color of slice 14.&amp;lt;!-- this can be fixed by adding more cases to Template:Graph color --&amp;gt;&lt;br /&gt;
* If the specified values add to 100 and {{para|other}} is set, the calculated percentage for that slice can sometimes turn out to be very strange (e.g., &amp;quot;1.4210854715202E-14%&amp;quot; instead of &amp;quot;0%&amp;quot;)&amp;lt;!-- this can be fixed by, say, optionally rounding the result to a level of precision specified by a parameter --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{-}}&lt;br /&gt;
&lt;br /&gt;
=== Examples ===&lt;br /&gt;
The following code generates the pie chart shown at right. Note that the default chart size and colors are used, and the value of &amp;quot;1&amp;quot; for the &amp;quot;other&amp;quot; parameter is only used for its &amp;quot;truth value&amp;quot; as a visible string—i.e., to say, yes, we want an &amp;quot;Other&amp;quot; entry in the legend (the same chart would result if &amp;quot;0&amp;quot; were used).&lt;br /&gt;
{{Pie chart&lt;br /&gt;
|value1 = 42&lt;br /&gt;
|label1 = One&lt;br /&gt;
|value2 = 32&lt;br /&gt;
|label2 = Two&lt;br /&gt;
|value3 = 12&lt;br /&gt;
|label3 = Three&lt;br /&gt;
|value4 = 3&lt;br /&gt;
|label4 = Four&lt;br /&gt;
|value5 = 2&lt;br /&gt;
|label5 = Five&lt;br /&gt;
|value6 = 1&lt;br /&gt;
|label6 = Six&lt;br /&gt;
|other = 1&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;pre style=&amp;quot;overflow:auto&amp;quot;&amp;gt;&lt;br /&gt;
{{Pie chart&lt;br /&gt;
|value1 = 42&lt;br /&gt;
|label1 = One&lt;br /&gt;
|value2 = 32&lt;br /&gt;
|label2 = Two&lt;br /&gt;
|value3 = 12&lt;br /&gt;
|label3 = Three&lt;br /&gt;
|value4 = 3&lt;br /&gt;
|label4 = Four&lt;br /&gt;
|value5 = 2&lt;br /&gt;
|label5 = Five&lt;br /&gt;
|value6 = 1&lt;br /&gt;
|label6 = Six&lt;br /&gt;
|other = 1&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&amp;#039;s a more real-world example.&lt;br /&gt;
{{Pie chart&lt;br /&gt;
| caption= [[Religion in the Czech Republic]] in 2001.&lt;br /&gt;
| label1 = [[Atheist]]s and [[agnostic]]s&lt;br /&gt;
| value1 = 59&lt;br /&gt;
| color1 = darkgreen&lt;br /&gt;
| label2 = [[Catholic]]s&lt;br /&gt;
| value2 = 26.8&lt;br /&gt;
| color2 = brown&lt;br /&gt;
| label3 = [[Protestant]]s&lt;br /&gt;
| value3 = 2.5&lt;br /&gt;
| color3 = #08f&lt;br /&gt;
| other  = yes&lt;br /&gt;
| other-color = silver&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;pre style=&amp;quot;overflow:auto&amp;quot;&amp;gt;&lt;br /&gt;
{{Pie chart&lt;br /&gt;
| caption= [[Religion in the Czech Republic]] in 2001.&lt;br /&gt;
| label1 = [[Atheist]]s and [[agnostic]]s&lt;br /&gt;
| value1 = 59&lt;br /&gt;
| color1 = darkgreen&lt;br /&gt;
| label2 = [[Catholic]]s&lt;br /&gt;
| value2 = 26.8&lt;br /&gt;
| color2 = brown&lt;br /&gt;
| label3 = [[Protestant]]s&lt;br /&gt;
| value3 = 2.5&lt;br /&gt;
| color3 = #08f&lt;br /&gt;
| other  = yes&lt;br /&gt;
| other-color = silver&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How it works ===&lt;br /&gt;
This template uses a technique for [http://erezsh.wordpress.com/2008/07/31/drawing-diagonal-lines-with-css/ drawing diagonal lines in CSS] exploiting the fact that borders set on elements are [[miter join]]ed. Thus, it is possible to set one border to an opaque color, with the others fully transparent, to form a diagonal line. The angle of the line can be controlled by adjusting the widths of two adjacent borders (one of them opaque) relative to each other.&lt;br /&gt;
&lt;br /&gt;
Pie slices are drawn in clockwise order in a counterclockwise direction. These pie slices are positioned:&lt;br /&gt;
* Inside a square element of (2 * &amp;lt;i&amp;gt;radius&amp;lt;/i&amp;gt;)x(2 * &amp;lt;i&amp;gt;radius&amp;lt;/i&amp;gt;) pixels&lt;br /&gt;
* with &amp;lt;code&amp;gt;border-radius: &amp;lt;i&amp;gt;radius&amp;lt;/i&amp;gt;px&amp;lt;/code&amp;gt; for a circular shape&lt;br /&gt;
* with a white (or other specified color) background visible in the empty space that occurs if the &amp;quot;other&amp;quot; slice is present&lt;br /&gt;
* and with &amp;lt;code&amp;gt;overflow: hidden;&amp;lt;/code&amp;gt; set.&lt;br /&gt;
This allows only the part of each slice that is inside the circle to be visible on the page.&lt;br /&gt;
&lt;br /&gt;
Most of the code in {{tlx|Pie chart/slice}} is divided into five sections, the first four corresponding to quadrants of the circle and the last to cleanly cover the case in which one slice occupies 100% of the chart.&lt;br /&gt;
{{-}}&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
* {{tl|Brick chart}}&lt;br /&gt;
* {{tl|Composition bar}}&lt;br /&gt;
* [[Module:Chart]]&lt;br /&gt;
&lt;br /&gt;
{{collapse top|Formatted/colorized template source for Template:Pie chart}}&lt;br /&gt;
{{#invoke:FormatTemplate|format}}&lt;br /&gt;
{{collapse bottom}}&lt;br /&gt;
{{collapse top|Formatted/colorized template source for Template:Pie chart/slice}}&lt;br /&gt;
{{#invoke:FormatTemplate|format|page=Template:Pie chart/slice}}&lt;br /&gt;
{{collapse bottom}}&lt;br /&gt;
{{collapse top|Formatted/colorized template source for Template:Legend}}&lt;br /&gt;
{{#invoke:FormatTemplate|format|page=Template:Legend}}&lt;br /&gt;
{{collapse bottom}}&lt;br /&gt;
{{collapse top|Formatted/colorized template source for Template:Trim}}&lt;br /&gt;
{{#invoke:FormatTemplate|format|page=Template:Trim}}&lt;br /&gt;
{{collapse bottom}}&lt;br /&gt;
{{Template:Graph, chart and plot templates}}&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{Sandbox other|&lt;br /&gt;
| &amp;lt;!-- CATEGORIES BELOW THIS LINE, PLEASE: --&amp;gt;&lt;br /&gt;
[[Category:Chart, diagram and graph formatting and function templates]]&lt;br /&gt;
[[Category:Graph, chart and plot templates]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>wikipedia:en&gt;Dcljr</name></author>
	</entry>
</feed>