Pređi na sadržaj

Šablon:Pie chart

S Vikipedije, slobodne enciklopedije
Dokumentacija šablona[prikaži] [uredi] [istorija] [osveži]


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.

{{Pie chart
| thumb = 
| caption = 
| other = 
| label1 =remember 
| value1 =16.6
| color1 =2
| label2 =understand
| value2 =16.6
| color2 =3 
| label3 =apply
| value3 =16.6 
| color3 =5 
| label4 =analyze
| value4 =16.6
| color4 =6
| label5 =evaluate
| value5 =16.6
| color5 =9
| label6 =design
| value6 =16.6
| color6 =10
}}
  • The parameter |thumb= specifies which side of the page the chart is floated to and defaults to right, as with image files. To make the chart appear on the left side of the page, specify |thumb=left.
  • The parameter |caption= specifies a string of text that appears on a line just before the legend.
  • The parameter |other=, if specified, will cause an "Other" item to appear in the legend.
  • Each |labelN= 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.
  • Each |valueN= is the percentage that the slice represents. Do not 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.
  • Each |colorN= is a CSS color code or name. If omitted, it will default to the following hues:
  1.   red
  2.   green
  3.   blue
  4.   yellow
  5.   fuchsia
  6.   aqua
  7.   brown
  8.   orange
  9.   purple
  10.   sienna

Limitations

[uredi izvor]
  • Minor issues with printing exist. We also need to implement a good fallback for use with the Wikipedia book tool.
  • The values need to be percentages.
  • 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.)
  • No labels can be put on the slices themselves.
  • Inherently, it is not possible to save a copy of the chart using the browser's "Save Image" function.
  • Max. number of slices that can be displayed: 30

How it works

[uredi izvor]
  One (42%)
  Two (32%)
  Three (12%)
  Four (3%)
  Five (2%)
  Six (1%)
  ostali (8%)

This is an experimental template that draws pie charts using a single image, a lot of (inline) CSS code generated by parser functions, and absolutely no JavaScript. It uses a technique for drawing diagonal lines in CSS exploiting the fact that borders set on elements are miter joined. 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.

Note that in the legacy browser Internet Explorer 6, applying transparent borders the standard way does not work. A workaround is used in the form of the class transborder, which has been added to MediaWiki:Common.css to make this template usable.

Pie slices are drawn in clockwise order in a counterclockwise direction. These pie slices are positioned:

  • Below a 200×200px image having a transparent circle on a light-colored background (same as the background color used for CSS class thumbinner)
  • Inside a container element with overflow: hidden; set

This allows only the part of each slice that is inside the circle to be visible on the page.

Most of the code in {{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.

Example

[uredi izvor]

Religion in the Czech Republic as of 2001.

  Atheists and agnostics (59%)
  Catholics (26,8%)
  Protestants (2,5%)
  ostali (11,7%)

The following example of Template:Pie chart generates the pie chart show at right.

 {{Pie chart
 | caption=[[Religion in the Czech Republic]] as of 2001.
 | other = yes
 | label1 = [[Atheist]]s and [[Agnosticism|agnostics]]
 | value1 = 59 | color1 = silver
 | label2 = [[Catholic Church|Catholics]]
 | value2 = 26.8 | color2 = #008
 | label3 = [[Protestantism|Protestants]]
 | value3 = 2.5 | color3 = #08f
 }}

See also

[uredi izvor]
Formatted/colorized template source for Template:Pie chart

<includeonly><div class="PieChartTemplate thumb t{{{thumb|right}}}" style="{{{style|}}}"><div class="thumbinner" style="width:200px"> <!-- Graph --> <div style="background-color:white;margin:auto;position:relative;width:200px;height:200px;overflow:hidden;border-radius:100px;border:1px solid black"> {{#if:{{{value30|}}}
    |{{Pie chart/slice|{{{color30|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}}+{{replace|{{{value13}}}
                |,
                |.}}+{{replace|{{{value14}}}
                |,
                |.}}+{{replace|{{{value15}}}
                |,
                |.}}+{{replace|{{{value16}}}
                |,
                |.}}+{{replace|{{{value17}}}
                |,
                |.}}+{{replace|{{{value18}}}
                |,
                |.}}+{{replace|{{{value19}}}
                |,
                |.}}+{{replace|{{{value20}}}
                |,
                |.}}+{{replace|{{{value21}}}
                |,
                |.}}+{{replace|{{{value22}}}
                |,
                |.}}+{{replace|{{{value23}}}
                |,
                |.}}+{{replace|{{{value24}}}
                |,
                |.}}+{{replace|{{{value25}}}
                |,
                |.}}+{{replace|{{{value26}}}
                |,
                |.}}+{{replace|{{{value27}}}
                |,
                |.}}+{{replace|{{{value28}}}
                |,
                |.}}+{{replace|{{{value29}}}
                |,
                |.}}+{{replace|{{{value30}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value29|}}}
    |{{Pie chart/slice|{{{color29|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}}+{{replace|{{{value13}}}
                |,
                |.}}+{{replace|{{{value14}}}
                |,
                |.}}+{{replace|{{{value15}}}
                |,
                |.}}+{{replace|{{{value16}}}
                |,
                |.}}+{{replace|{{{value17}}}
                |,
                |.}}+{{replace|{{{value18}}}
                |,
                |.}}+{{replace|{{{value19}}}
                |,
                |.}}+{{replace|{{{value20}}}
                |,
                |.}}+{{replace|{{{value21}}}
                |,
                |.}}+{{replace|{{{value22}}}
                |,
                |.}}+{{replace|{{{value23}}}
                |,
                |.}}+{{replace|{{{value24}}}
                |,
                |.}}+{{replace|{{{value25}}}
                |,
                |.}}+{{replace|{{{value26}}}
                |,
                |.}}+{{replace|{{{value27}}}
                |,
                |.}}+{{replace|{{{value28}}}
                |,
                |.}}+{{replace|{{{value29}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value28|}}}
    |{{Pie chart/slice|{{{color28|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}}+{{replace|{{{value13}}}
                |,
                |.}}+{{replace|{{{value14}}}
                |,
                |.}}+{{replace|{{{value15}}}
                |,
                |.}}+{{replace|{{{value16}}}
                |,
                |.}}+{{replace|{{{value17}}}
                |,
                |.}}+{{replace|{{{value18}}}
                |,
                |.}}+{{replace|{{{value19}}}
                |,
                |.}}+{{replace|{{{value20}}}
                |,
                |.}}+{{replace|{{{value21}}}
                |,
                |.}}+{{replace|{{{value22}}}
                |,
                |.}}+{{replace|{{{value23}}}
                |,
                |.}}+{{replace|{{{value24}}}
                |,
                |.}}+{{replace|{{{value25}}}
                |,
                |.}}+{{replace|{{{value26}}}
                |,
                |.}}+{{replace|{{{value27}}}
                |,
                |.}}+{{replace|{{{value28}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value27|}}}
    |{{Pie chart/slice|{{{color27|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}}+{{replace|{{{value13}}}
                |,
                |.}}+{{replace|{{{value14}}}
                |,
                |.}}+{{replace|{{{value15}}}
                |,
                |.}}+{{replace|{{{value16}}}
                |,
                |.}}+{{replace|{{{value17}}}
                |,
                |.}}+{{replace|{{{value18}}}
                |,
                |.}}+{{replace|{{{value19}}}
                |,
                |.}}+{{replace|{{{value20}}}
                |,
                |.}}+{{replace|{{{value21}}}
                |,
                |.}}+{{replace|{{{value22}}}
                |,
                |.}}+{{replace|{{{value23}}}
                |,
                |.}}+{{replace|{{{value24}}}
                |,
                |.}}+{{replace|{{{value25}}}
                |,
                |.}}+{{replace|{{{value26}}}
                |,
                |.}}+{{replace|{{{value27}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value26|}}}
    |{{Pie chart/slice|{{{color26|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}}+{{replace|{{{value13}}}
                |,
                |.}}+{{replace|{{{value14}}}
                |,
                |.}}+{{replace|{{{value15}}}
                |,
                |.}}+{{replace|{{{value16}}}
                |,
                |.}}+{{replace|{{{value17}}}
                |,
                |.}}+{{replace|{{{value18}}}
                |,
                |.}}+{{replace|{{{value19}}}
                |,
                |.}}+{{replace|{{{value20}}}
                |,
                |.}}+{{replace|{{{value21}}}
                |,
                |.}}+{{replace|{{{value22}}}
                |,
                |.}}+{{replace|{{{value23}}}
                |,
                |.}}+{{replace|{{{value24}}}
                |,
                |.}}+{{replace|{{{value25}}}
                |,
                |.}}+{{replace|{{{value26}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value25|}}}
    |{{Pie chart/slice|{{{color25|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}}+{{replace|{{{value13}}}
                |,
                |.}}+{{replace|{{{value14}}}
                |,
                |.}}+{{replace|{{{value15}}}
                |,
                |.}}+{{replace|{{{value16}}}
                |,
                |.}}+{{replace|{{{value17}}}
                |,
                |.}}+{{replace|{{{value18}}}
                |,
                |.}}+{{replace|{{{value19}}}
                |,
                |.}}+{{replace|{{{value20}}}
                |,
                |.}}+{{replace|{{{value21}}}
                |,
                |.}}+{{replace|{{{value22}}}
                |,
                |.}}+{{replace|{{{value23}}}
                |,
                |.}}+{{replace|{{{value24}}}
                |,
                |.}}+{{replace|{{{value25}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value24|}}}
    |{{Pie chart/slice|{{{color24|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}}+{{replace|{{{value13}}}
                |,
                |.}}+{{replace|{{{value14}}}
                |,
                |.}}+{{replace|{{{value15}}}
                |,
                |.}}+{{replace|{{{value16}}}
                |,
                |.}}+{{replace|{{{value17}}}
                |,
                |.}}+{{replace|{{{value18}}}
                |,
                |.}}+{{replace|{{{value19}}}
                |,
                |.}}+{{replace|{{{value20}}}
                |,
                |.}}+{{replace|{{{value21}}}
                |,
                |.}}+{{replace|{{{value22}}}
                |,
                |.}}+{{replace|{{{value23}}}
                |,
                |.}}+{{replace|{{{value24}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value23|}}}
    |{{Pie chart/slice|{{{color23|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}}+{{replace|{{{value13}}}
                |,
                |.}}+{{replace|{{{value14}}}
                |,
                |.}}+{{replace|{{{value15}}}
                |,
                |.}}+{{replace|{{{value16}}}
                |,
                |.}}+{{replace|{{{value17}}}
                |,
                |.}}+{{replace|{{{value18}}}
                |,
                |.}}+{{replace|{{{value19}}}
                |,
                |.}}+{{replace|{{{value20}}}
                |,
                |.}}+{{replace|{{{value21}}}
                |,
                |.}}+{{replace|{{{value22}}}
                |,
                |.}}+{{replace|{{{value23}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value22|}}}
    |{{Pie chart/slice|{{{color22|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}}+{{replace|{{{value13}}}
                |,
                |.}}+{{replace|{{{value14}}}
                |,
                |.}}+{{replace|{{{value15}}}
                |,
                |.}}+{{replace|{{{value16}}}
                |,
                |.}}+{{replace|{{{value17}}}
                |,
                |.}}+{{replace|{{{value18}}}
                |,
                |.}}+{{replace|{{{value19}}}
                |,
                |.}}+{{replace|{{{value20}}}
                |,
                |.}}+{{replace|{{{value21}}}
                |,
                |.}}+{{replace|{{{value22}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value21|}}}
    |{{Pie chart/slice|{{{color21|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}}+{{replace|{{{value13}}}
                |,
                |.}}+{{replace|{{{value14}}}
                |,
                |.}}+{{replace|{{{value15}}}
                |,
                |.}}+{{replace|{{{value16}}}
                |,
                |.}}+{{replace|{{{value17}}}
                |,
                |.}}+{{replace|{{{value18}}}
                |,
                |.}}+{{replace|{{{value19}}}
                |,
                |.}}+{{replace|{{{value20}}}
                |,
                |.}}+{{replace|{{{value21}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value20|}}}
    |{{Pie chart/slice|{{{color20|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}}+{{replace|{{{value13}}}
                |,
                |.}}+{{replace|{{{value14}}}
                |,
                |.}}+{{replace|{{{value15}}}
                |,
                |.}}+{{replace|{{{value16}}}
                |,
                |.}}+{{replace|{{{value17}}}
                |,
                |.}}+{{replace|{{{value18}}}
                |,
                |.}}+{{replace|{{{value19}}}
                |,
                |.}}+{{replace|{{{value20}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value19|}}}
    |{{Pie chart/slice|{{{color19|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}}+{{replace|{{{value13}}}
                |,
                |.}}+{{replace|{{{value14}}}
                |,
                |.}}+{{replace|{{{value15}}}
                |,
                |.}}+{{replace|{{{value16}}}
                |,
                |.}}+{{replace|{{{value17}}}
                |,
                |.}}+{{replace|{{{value18}}}
                |,
                |.}}+{{replace|{{{value19}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value18|}}}
    |{{Pie chart/slice|{{{color18|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}}+{{replace|{{{value13}}}
                |,
                |.}}+{{replace|{{{value14}}}
                |,
                |.}}+{{replace|{{{value15}}}
                |,
                |.}}+{{replace|{{{value16}}}
                |,
                |.}}+{{replace|{{{value17}}}
                |,
                |.}}+{{replace|{{{value18}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value17|}}}
    |{{Pie chart/slice|{{{color17|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}}+{{replace|{{{value13}}}
                |,
                |.}}+{{replace|{{{value14}}}
                |,
                |.}}+{{replace|{{{value15}}}
                |,
                |.}}+{{replace|{{{value16}}}
                |,
                |.}}+{{replace|{{{value17}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value16|}}}
    |{{Pie chart/slice|{{{color16|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}}+{{replace|{{{value13}}}
                |,
                |.}}+{{replace|{{{value14}}}
                |,
                |.}}+{{replace|{{{value15}}}
                |,
                |.}}+{{replace|{{{value16}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value15|}}}
    |{{Pie chart/slice|{{{color15|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}}+{{replace|{{{value13}}}
                |,
                |.}}+{{replace|{{{value14}}}
                |,
                |.}}+{{replace|{{{value15}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value14|}}}
    |{{Pie chart/slice|{{{color14|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}}+{{replace|{{{value13}}}
                |,
                |.}}+{{replace|{{{value14}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value13|}}}
    |{{Pie chart/slice|{{{color13|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}}+{{replace|{{{value13}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value12|}}}
    |{{Pie chart/slice|{{{color12|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}}+{{replace|{{{value12}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value11|}}}
    |{{Pie chart/slice|{{{color11|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}}+{{replace|{{{value11}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value10|}}}
    |{{Pie chart/slice|{{{color10|sienna}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}}+{{replace|{{{value10}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value9|}}}
    |{{Pie chart/slice|{{{color9|purple}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}}+{{replace|{{{value9}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value8|}}}
    |{{Pie chart/slice|{{{color8|orange}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}}+{{replace|{{{value8}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value7|}}}
    |{{Pie chart/slice|{{{color7|brown}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}}+{{replace|{{{value7}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value6|}}}
    |{{Pie chart/slice|{{{color6|aqua}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}}+{{replace|{{{value6}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value5|}}}
    |{{Pie chart/slice|{{{color5|fuchsia}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}}+{{replace|{{{value5}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value4|}}}
    |{{Pie chart/slice|{{{color4|yellow}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}}+{{replace|{{{value4}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value3|}}}
    |{{Pie chart/slice|{{{color3|blue}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}}+{{replace|{{{value3}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value2|}}}
    |{{Pie chart/slice|{{{color2|green}}}
        |{{#expr: {{replace|{{{value1}}}
                |,
                |.}}+{{replace|{{{value2}}}
                |,
                |.}} }}}}}}<!-- -->{{#if:{{{value1|}}}
    |{{Pie chart/slice|{{{color1|red}}}
        | {{replace|{{{value1}}}
            |,
            |.}} }}}} </div> <!-- Legend --> <div class="thumbcaption"> {{{caption|}}} {{#if:{{{label1|}}}
    |{{legend|{{{color1|red}}}
        |{{{label1}}} ({{replace|{{{value1}}}
            |.
            |,}}%)}} }}{{#if:{{{label2|}}}
    |{{legend|{{{color2|green}}}
        |{{{label2}}} ({{replace|{{{value2}}}
            |.
            |,}}%)}} }}{{#if:{{{label3|}}}
    |{{legend|{{{color3|blue}}}
        |{{{label3}}} ({{replace|{{{value3}}}
            |.
            |,}}%)}} }}{{#if:{{{label4|}}}
    |{{legend|{{{color4|yellow}}}
        |{{{label4}}} ({{replace|{{{value4}}}
            |.
            |,}}%)}} }}{{#if:{{{label5|}}}
    |{{legend|{{{color5|fuchsia}}}
        |{{{label5}}} ({{replace|{{{value5}}}
            |.
            |,}}%)}} }}{{#if:{{{label6|}}}
    |{{legend|{{{color6|aqua}}}
        |{{{label6}}} ({{replace|{{{value6}}}
            |.
            |,}}%)}} }}{{#if:{{{label7|}}}
    |{{legend|{{{color7|<!-- brown --> #a52a2a}}}
        |{{{label7}}} ({{replace|{{{value7}}}
            |.
            |,}}%)}} }}{{#if:{{{label8|}}}
    |{{legend|{{{color8|<!-- orange --> #ffa500}}}
        |{{{label8}}} ({{replace|{{{value8}}}
            |.
            |,}}%)}} }}{{#if:{{{label9|}}}
    |{{legend|{{{color9|purple}}}
        |{{{label9}}} ({{replace|{{{value9}}}
            |.
            |,}}%)}} }}{{#if:{{{label10|}}}
    |{{legend|{{{color10|sienna}}}
        |{{{label10}}} ({{replace|{{{value10}}}
            |.
            |,}}%)}} }}{{#if:{{{label11|}}}
    |{{legend|{{{color11|sienna}}}
        |{{{label11}}} ({{replace|{{{value11}}}
            |.
            |,}}%)}} }}{{#if:{{{label12|}}}
    |{{legend|{{{color12|sienna}}}
        |{{{label12}}} ({{replace|{{{value12}}}
            |.
            |,}}%)}} }}{{#if:{{{label13|}}}
    |{{legend|{{{color13|sienna}}}
        |{{{label13}}} ({{replace|{{{value13}}}
            |.
            |,}}%)}} }}{{#if:{{{label14|}}}
    |{{legend|{{{color14|sienna}}}
        |{{{label14}}} ({{replace|{{{value14}}}
            |.
            |,}}%)}} }}{{#if:{{{label15|}}}
    |{{legend|{{{color15|sienna}}}
        |{{{label15}}} ({{replace|{{{value15}}}
            |.
            |,}}%)}} }}{{#if:{{{label16|}}}
    |{{legend|{{{color16|sienna}}}
        |{{{label16}}} ({{replace|{{{value16}}}
            |.
            |,}}%)}} }}{{#if:{{{label17|}}}
    |{{legend|{{{color17|sienna}}}
        |{{{label17}}} ({{replace|{{{value17}}}
            |.
            |,}}%)}} }}{{#if:{{{label18|}}}
    |{{legend|{{{color18|sienna}}}
        |{{{label18}}} ({{replace|{{{value18}}}
            |.
            |,}}%)}} }}{{#if:{{{label19|}}}
    |{{legend|{{{color19|sienna}}}
        |{{{label19}}} ({{replace|{{{value19}}}
            |.
            |,}}%)}} }}{{#if:{{{label20|}}}
    |{{legend|{{{color20|sienna}}}
        |{{{label20}}} ({{replace|{{{value20}}}
            |.
            |,}}%)}} }}{{#if:{{{label21|}}}
    |{{legend|{{{color21|sienna}}}
        |{{{label21}}} ({{replace|{{{value21}}}
            |.
            |,}}%)}} }}{{#if:{{{label22|}}}
    |{{legend|{{{color22|sienna}}}
        |{{{label22}}} ({{replace|{{{value22}}}
            |.
            |,}}%)}} }}{{#if:{{{label23|}}}
    |{{legend|{{{color23|sienna}}}
        |{{{label23}}} ({{replace|{{{value23}}}
            |.
            |,}}%)}} }}{{#if:{{{label24|}}}
    |{{legend|{{{color24|sienna}}}
        |{{{label24}}} ({{replace|{{{value24}}}
            |.
            |,}}%)}} }}{{#if:{{{label25|}}}
    |{{legend|{{{color25|sienna}}}
        |{{{label25}}} ({{replace|{{{value25}}}
            |.
            |,}}%)}} }}{{#if:{{{label26|}}}
    |{{legend|{{{color26|sienna}}}
        |{{{label26}}} ({{replace|{{{value26}}}
            |.
            |,}}%)}} }}{{#if:{{{label27|}}}
    |{{legend|{{{color27|sienna}}}
        |{{{label27}}} ({{replace|{{{value27}}}
            |.
            |,}}%)}} }}{{#if:{{{label28|}}}
    |{{legend|{{{color28|sienna}}}
        |{{{label28}}} ({{replace|{{{value28}}}
            |.
            |,}}%)}} }}{{#if:{{{label29|}}}
    |{{legend|{{{color29|sienna}}}
        |{{{label29}}} ({{replace|{{{value29}}}
            |.
            |,}}%)}} }}{{#if:{{{label30|}}}
    |{{legend|{{{color30|sienna}}}
        |{{{label30}}<--- error? ({{replace|{{{value30}}}
            |.
            |,}}%)}} }}{{#if:{{{other|}}}
    |{{legend|white
        |{{{other_text|остали}}} ({{replace|{{#expr:100-{{replace|{{{value1|0}}}
                    |,
                    |.}}-{{replace|{{{value2|0}}}
                    |,
                    |.}}-{{replace|{{{value3|0}}}
                    |,
                    |.}}-{{replace|{{{value4|0}}}
                    |,
                    |.}}-{{replace|{{{value5|0}}}
                    |,
                    |.}}-{{replace|{{{value6|0}}}
                    |,
                    |.}}-{{replace|{{{value7|0}}}
                    |,
                    |.}}-{{replace|{{{value8|0}}}
                    |,
                    |.}}-{{replace|{{{value9|0}}}
                    |,
                    |.}}-{{replace|{{{value10|0}}}
                    |,
                    |.}}-{{replace|{{{value11|0}}}
                    |,
                    |.}}-{{replace|{{{value12|0}}}
                    |,
                    |.}}-{{replace|{{{value13|0}}}
                    |,
                    |.}}-{{replace|{{{value14|0}}}
                    |,
                    |.}}-{{replace|{{{value15|0}}}
                    |,
                    |.}}-{{replace|{{{value16|0}}}
                    |,
                    |.}}-{{replace|{{{value17|0}}}
                    |,
                    |.}}-{{replace|{{{value18|0}}}
                    |,
                    |.}}-{{replace|{{{value19|0}}}
                    |,
                    |.}}-{{replace|{{{value20|0}}}
                    |,
                    |.}}-{{replace|{{{value21|0}}}
                    |,
                    |.}}-{{replace|{{{value22|0}}}
                    |,
                    |.}}-{{replace|{{{value23|0}}}
                    |,
                    |.}}-{{replace|{{{value24|0}}}
                    |,
                    |.}}-{{replace|{{{value25|0}}}
                    |,
                    |.}}-{{replace|{{{value26|0}}}
                    |,
                    |.}}-{{replace|{{{value27|0}}}
                    |,
                    |.}}-{{replace|{{{value28|0}}}
                    |,
                    |.}}-{{replace|{{{value29|0}}}
                    |,
                    |.}}-{{replace|{{{value30|0}}}
                    |,
                    |.}}}}
            |.
            |,}}%)}}}} </div> </div></div></includeonly><noinclude> {{documentation}} <!-- Add categories to the /doc subpage, interwikis to Wikidata. --> </noinclude>:

Formatted/colorized template source for Template:Pie chart/slice

<includeonly><div style="border:solid transparent;position:absolute;width:100px;line-height:0;{{#switch:{{#expr:floor({{{2}}}/25)}} <!-- 0-25% -->
    |0= left:100px; top:{{#expr:100-100*sin(pi/50*{{{2}}})}}px; border-width:0 0 {{#expr:100*sin(pi/50*{{{2}}})}}px {{#expr:100*cos(pi/50*{{{2}}})}}px; border-bottom-color:{{{1}}} "></div> <!-- 25-50% -->
    |1= right:100px; top:0; border-width:0 {{#expr:100*tan(pi/50*({{{2}}}-25))}}px 100px 0; border-right-color:{{{1}}} "></div> <div style="position:absolute;line-height:0;border-style:solid;right:0;top:0;border-width:0 100px 100px 0;border-color:{{{1}}}"></div> <!-- 50-75% -->
    |2= right:100px; top:100px; border-width:{{#expr:100*sin(pi/50*({{{2}}}-50))}}px {{#expr:100*cos(pi/50*({{{2}}}-50))}}px 0 0; border-top-color:{{{1}}} "></div> <div style="position:absolute;line-height:0;border-style:solid;left:0;top:0;border-width:0 200px 100px 0;border-color:{{{1}}}"></div> <!-- 75%-100% -->
    |3= left:100px; top:100px; border-width:100px 0 0 {{#expr:100*tan(pi/50*({{{2}}}-25))}}px; border-left-color:{{{1}}} "></div> <div style="position:absolute;line-height:0;border-style:solid;left:0;top:0;border-width:0 200px 100px 0;border-color:{{{1}}}"></div> <div style="position:absolute;line-height:0;border-style:solid;left:0;top:0;border-width:0 100px 200px 0;border-color:{{{1}}}"></div> <!-- 100% -->
    |4= left:0; top:0; border-width:0 200px 200px 0; border-color:{{{1}}} "></div> }}</includeonly><noinclude> {{documentation}} <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude>:

Formatted/colorized template source for Template:Legend

#Преусмери [[Шаблон:Легенда]]:

Formatted/colorized template source for Template:Trim

<includeonly>{{safesubst:#if:1|{{{1|}}}}}</includeonly><noinclude> {{Documentation}} </noinclude>: