« Modèle:Pie chart/slice » : différence entre les versions
De Los Plantos Wiki
Aucun résumé des modifications |
Aucun résumé des modifications |
||
(Une version intermédiaire par le même utilisateur non affichée) | |||
Ligne 1 : | Ligne 1 : | ||
<includeonly><div | <includeonly><div style="border:solid transparent;background-color: initial;position:absolute;width:{{{radius|100}}}px;line-height:0;{{#switch:{{#expr:floor({{{2}}}/25)}} | ||
<!-- 0-25% --> |0= | <!-- 0-25% --> |0= | ||
left: | left:{{{radius|100}}}px; | ||
top:{{#expr:100- | top:{{#expr:{{{radius|100}}}*(1-sin(pi/50*{{{2}}}))}}px; | ||
border-width:0 0 {{#expr:100*sin(pi/50*{{{2}}})}}px {{#expr:100*cos(pi/50*{{{2}}})}}px; | border-width:0 0 {{#expr:{{{radius|100}}}*sin(pi/50*{{{2}}})}}px {{#expr:{{{radius|100}}}*cos(pi/50*{{{2}}})}}px; | ||
border-bottom-color:{{{1}}} | border-bottom-color:{{{1}}} | ||
"></div> | "></div> | ||
<!-- 25-50% --> |1= | <!-- 25-50% --> |1= | ||
right: | right:{{{radius|100}}}px; | ||
top:0; | top:0; | ||
border-width:0 {{#expr:100*tan(pi/50*({{{2}}}-25))}}px | border-width:0 {{#expr:{{{radius|100}}}*tan(pi/50*({{{2}}}-25))}}px {{{radius|100}}}px 0; | ||
border-right-color:{{{1}}} | border-right-color:{{{1}}} | ||
"></div> | "></div> | ||
<div style="position:absolute;line-height:0;border-style:solid;right:0;top:0;border-width:0 | <div style="position:absolute;line-height:0;border-style:solid;right:0;top:0;border-width:0 {{{radius|100}}}px {{{radius|100}}}px 0;border-color:{{{1}}}"></div> | ||
<!-- 50-75% --> |2= | <!-- 50-75% --> |2= | ||
right: | right:{{{radius|100}}}px; | ||
top: | top:{{{radius|100}}}px; | ||
border-width:{{#expr:100*sin(pi/50*({{{2}}}-50))}}px {{#expr:100*cos(pi/50*({{{2}}}-50))}}px 0 0; | border-width:{{#expr:{{{radius|100}}}*sin(pi/50*({{{2}}}-50))}}px {{#expr:{{{radius|100}}}*cos(pi/50*({{{2}}}-50))}}px 0 0; | ||
border-top-color:{{{1}}} | border-top-color:{{{1}}} | ||
"></div> | "></div> | ||
<div style="position:absolute;line-height:0;border-style:solid;left:0;top:0;border-width:0 | <div style="position:absolute;line-height:0;border-style:solid;left:0;top:0;border-width:0 {{#expr:2*{{{radius|100}}}}}px {{{radius|100}}}px 0;border-color:{{{1}}}"></div> | ||
<!-- 75%-100% --> |3= | <!-- 75%-100% --> |3= | ||
left: | left:{{{radius|100}}}px; | ||
top: | top:{{{radius|100}}}px; | ||
border-width: | border-width:{{{radius|100}}}px 0 0 {{#expr:{{{radius|100}}}*tan(pi/50*({{{2}}}-25))}}px; | ||
border-left-color:{{{1}}} | border-left-color:{{{1}}} | ||
"></div> | "></div> | ||
<div style="position:absolute;line-height:0;border-style:solid;left:0;top:0;border-width:0 | <div style="position:absolute;line-height:0;border-style:solid;left:0;top:0;border-width:0 {{#expr:2*{{{radius|100}}}}}px {{{radius|100}}}px 0;border-color:{{{1}}}"></div> | ||
<div style="position:absolute;line-height:0;border-style:solid;left:0;top:0;border-width:0 | <div style="position:absolute;line-height:0;border-style:solid;left:0;top:0;border-width:0 {{{radius|100}}}px {{#expr:2*{{{radius|100}}}}}px 0;border-color:{{{1}}}"></div> | ||
<!-- 100% --> |4= | <!-- 100% --> |4= | ||
left:0; | left:0; | ||
top:0; | top:0; | ||
border-width:0 | border-width:0 {{#expr:2*{{{radius|100}}}}}px {{#expr:2*{{{radius|100}}}}}px 0; | ||
border-color:{{{1}}} | border-color:{{{1}}} | ||
"></div> | "></div> | ||
Ligne 37 : | Ligne 37 : | ||
=== Usage === | === Usage === | ||
'''This template is not intended to be used directly.''' It is used to draw individual slices of pie charts within {{ | '''This template is not intended to be used directly.''' It is used to draw individual slices of pie charts within {{[[Template:Pie_chart|Pie chart]]}}. Please see that template's documentation for more information. | ||
=== See also === | === See also === | ||
* {{ | * {{[[Template:Pie_chart|Pie chart]]}} | ||
<!-- Add categories and interwikis to the /doc subpage, not here! --> | <!-- Add categories and interwikis to the /doc subpage, not here! --> | ||
</noinclude> | </noinclude> |