« 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 class="transborder" style="position:absolute;width:100px;line-height:0;{{#switch:{{#expr:floor({{{2}}}/25)}}
<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:100px;
left:{{{radius|100}}}px;
top:{{#expr:100-100*sin(pi/50*{{{2}}})}}px;
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:100px;
right:{{{radius|100}}}px;
top:0;
top:0;
border-width:0 {{#expr:100*tan(pi/50*({{{2}}}-25))}}px 100px 0;
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 100px 100px 0;border-color:{{{1}}}"></div>
<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:100px;
right:{{{radius|100}}}px;
top:100px;
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 200px 100px 0;border-color:{{{1}}}"></div>
<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:100px;
left:{{{radius|100}}}px;
top:100px;
top:{{{radius|100}}}px;
border-width:100px 0 0 {{#expr:100*tan(pi/50*({{{2}}}-25))}}px;
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 200px 100px 0;border-color:{{{1}}}"></div>
<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 100px 200px 0;border-color:{{{1}}}"></div>
<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 200px 200px 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 {{tl|Pie chart}}. Please see that template's documentation for more information.
'''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 ===
* {{tl|Pie chart}}
* {{[[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>

Dernière version du 17 janvier 2024 à 20:19


Usage

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.

See also