<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.tiffa.net/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://wiki.tiffa.net/w/index.php?action=history&amp;feed=atom&amp;title=Template%3APie_chart%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://wiki.tiffa.net/w/index.php?title=Template:Pie_chart/doc&amp;action=history"/>
	<updated>2026-04-14T20:58:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.tiffa.net/w/index.php?title=Template:Pie_chart/doc&amp;diff=1217&amp;oldid=prev</id>
		<title>imported&gt;Fire: ページの作成:「{{Documentation subpage}} &lt;!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE --&gt; __NOTOC__  {{二次利用}}  === Usage === The labels and values of up…」</title>
		<link rel="alternate" type="text/html" href="https://wiki.tiffa.net/w/index.php?title=Template:Pie_chart/doc&amp;diff=1217&amp;oldid=prev"/>
		<updated>2021-02-25T04:16:29Z</updated>

		<summary type="html">&lt;p&gt;ページの作成:「{{Documentation subpage}} &amp;lt;!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE --&amp;gt; __NOTOC__  {{二次利用}}  === Usage === The labels and values of up…」&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;
&lt;br /&gt;
{{二次利用}}&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
The labels and values 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;
| radius = 100&lt;br /&gt;
| thumb = &lt;br /&gt;
| caption = &lt;br /&gt;
| other = &lt;br /&gt;
| label1 =remember &lt;br /&gt;
| value1 =16.6&lt;br /&gt;
| color1 =2&lt;br /&gt;
| label2 =understand&lt;br /&gt;
| value2 =16.6&lt;br /&gt;
| color2 =3 &lt;br /&gt;
| label3 =apply&lt;br /&gt;
| value3 =16.6 &lt;br /&gt;
| color3 =5 &lt;br /&gt;
| label4 =analyze&lt;br /&gt;
| value4 =16.6&lt;br /&gt;
| color4 =6&lt;br /&gt;
| label5 =evaluate&lt;br /&gt;
| value5 =16.6&lt;br /&gt;
| color5 =9&lt;br /&gt;
| label6 =design&lt;br /&gt;
| value6 =16.6&lt;br /&gt;
| color6 =10&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The parameter {{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;
* The parameter {{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;
* The parameter {{para|caption}} specifies a string of text that appears on a line just before the legend.&lt;br /&gt;
* The parameter {{para|footer}} specifies a string of text that appears &amp;#039;&amp;#039;below&amp;#039;&amp;#039; the legend.&lt;br /&gt;
* The parameter {{para|other}}, if specified, will cause an &amp;quot;Other&amp;quot; item to appear in the legend.&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. Also note that it is shown in the legend as written (just after the label), 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, it will default to the following hues:&lt;br /&gt;
{{columns-list|colwidth=10em|&lt;br /&gt;
# {{legend|#a6cee3|light blue}}&lt;br /&gt;
# {{legend|#1f78b4|strong blue}}&lt;br /&gt;
# {{legend|#b2df8a|light green}}&lt;br /&gt;
# {{legend|#33a02c|strong green}}&lt;br /&gt;
# {{legend|#fb9a99|fuchsia}}&lt;br /&gt;
# {{legend|#e31a1c|red}}&lt;br /&gt;
# {{legend|#fdbf6f|light orange}}&lt;br /&gt;
# {{legend|#ff7f00|strong orange}}&lt;br /&gt;
# {{legend|#cab2d6|light purple}}&lt;br /&gt;
# {{legend|#6a3d9a|strong purple}}&lt;br /&gt;
# {{legend|#ffff99|light yellow}}&lt;br /&gt;
# {{legend|#b15928|brown}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
* Minor issues with printing exist. We also need to implement a good fallback for use with the [[WP:Books|Wikipedia book tool]].&lt;br /&gt;
* The values need to be percentages.&lt;br /&gt;
* Google Chrome and Safari do not appear to [[anti-alias]] borders, so the lines are a bit jagged. (For Chrome, this issue seems to be resolved; tested with version 26.)&lt;br /&gt;
* No labels can be put on the slices themselves.&lt;br /&gt;
* Inherently, it is not possible to save a copy of the chart using the browser&amp;#039;s &amp;quot;Save Image&amp;quot; function.&lt;br /&gt;
* Max. number of slices that can be displayed: &amp;#039;&amp;#039;&amp;#039;30&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
=== How it works ===&lt;br /&gt;
{{Pie chart&lt;br /&gt;
|other = yes&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;
}}&lt;br /&gt;
&lt;br /&gt;
This is an &amp;#039;&amp;#039;experimental&amp;#039;&amp;#039; template that draws pie charts 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;. It 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 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;
=== Example ===&lt;br /&gt;
{{Pie chart&lt;br /&gt;
| caption=[[Religion in the Czech Republic]] as of 2001.&lt;br /&gt;
| other = yes&lt;br /&gt;
| label1 = [[Atheist]]s and [[Agnosticism|agnostics]]&lt;br /&gt;
| value1 = 59&lt;br /&gt;
| color1 = silver&lt;br /&gt;
| label2 = [[Catholic Church|Catholics]]&lt;br /&gt;
| value2 = 26.8&lt;br /&gt;
| color2 = #008&lt;br /&gt;
| label3 = [[Protestantism|Protestants]]&lt;br /&gt;
| value3 = 2.5&lt;br /&gt;
| color3 = #08f&lt;br /&gt;
}}&lt;br /&gt;
The following example of [[Template:Pie chart]] generates the pie chart shown at right. &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]] as of 2001.&lt;br /&gt;
 | other = yes&lt;br /&gt;
 | label1 = [[Atheist]]s and [[Agnosticism|agnostics]]&lt;br /&gt;
 | value1 = 59 | color1 = silver&lt;br /&gt;
 | label2 = [[Catholic Church|Catholics]]&lt;br /&gt;
 | value2 = 26.8 | color2 = #008&lt;br /&gt;
 | label3 = [[Protestantism|Protestants]]&lt;br /&gt;
 | value3 = 2.5 | color3 = #08f&lt;br /&gt;
 }}&lt;br /&gt;
&amp;lt;/pre&amp;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:ウィキペディアのテンプレート]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;Fire</name></author>
	</entry>
</feed>