Difference between revisions of "PieChartSegment"

From Sega Retro

Line 1: Line 1:
<includeonly>{{#vardefine:angle|{{{angle|}}}}}
+
<includeonly>{{#vardefine:angle|{{{angle|}}}}}{{#vardefine:colour|{{#if:{{{colour|}}}|{{{colour}}}|{{#sub:{{WikiColour|FG|{{#switch:{{#var:segmentCount}}
    #{{{colour}}} {{#var:totalAngles}}deg {{#expr:{{#var:totalAngles}}+{{#var:angle}}}}deg,{{#vardefine:totalAngles|{{#expr:{{#var:totalAngles}}+{{#var:angle}}}}}}{{#vardefine:legend|{{#var:legend}}
+
    |0=red
<div><div style="width:20px; height:20px; background-color: #{{{colour}}}; border:1px solid #000000; display:inline-block; vertical-align:middle;"></div> {{{caption|}}}</div>}}
+
    |1=orange
 +
    |2=yellow
 +
    |3=yellowgreen
 +
    |4=green
 +
    |5=cyan
 +
    |6=blue
 +
    |7=purple
 +
    |8=magenta
 +
    |9=redmagenta
 +
  }}}}|0|-1}}}}}}
 +
  #{{#var:colour}} {{#var:totalAngles}}deg {{#expr:{{#var:totalAngles}}+{{#var:angle}}}}deg,{{#vardefine:totalAngles|{{#expr:{{#var:totalAngles}}+{{#var:angle}}}}}}{{#vardefine:legend|{{#var:legend}}
 +
<div><div style="width:20px; height:20px; background-color: #{{#var:colour}}; border:1px solid #000000; display:inline-block; vertical-align:middle;"></div> {{{caption|}}}</div>}}{{incvar|segmentCount}}
 
</includeonly><noinclude>
 
</includeonly><noinclude>
{{#vardefine:totalAngles|0}}
+
{{#vardefine:segmentCount|0}}
 
{{PieChart|
 
{{PieChart|
 
{{PieChartSegment
 
{{PieChartSegment
| angle=45
+
| angle=10
| colour=0000FF
 
 
| caption=aaa
 
| caption=aaa
 
}}
 
}}
 
{{PieChartSegment
 
{{PieChartSegment
| angle=45
+
| angle=20
| colour=FF00FF
 
 
| caption=bbb
 
| caption=bbb
 
}}
 
}}
 
{{PieChartSegment
 
{{PieChartSegment
| angle=90
+
| angle=30
| colour=FFFF00
 
 
| caption=ccc
 
| caption=ccc
 
}}
 
}}
 
{{PieChartSegment
 
{{PieChartSegment
| angle=70
+
| angle=40
| colour=FF0000
 
 
| caption=ddd
 
| caption=ddd
 
}}
 
}}
 
{{PieChartSegment
 
{{PieChartSegment
| angle=110
+
| angle=50
| colour=00FF00
 
 
| caption=eee
 
| caption=eee
 +
}}
 +
{{PieChartSegment
 +
| angle=60
 +
| caption=fff
 +
}}
 +
{{PieChartSegment
 +
| angle=45
 +
| caption=ggg
 +
}}
 +
{{PieChartSegment
 +
| angle=45
 +
| caption=hhh
 +
}}
 +
{{PieChartSegment
 +
| angle=10
 +
| caption=iii
 +
| colour=555555
 
}}
 
}}
 
}}
 
}}
 
[[Category:Templates]]</noinclude>
 
[[Category:Templates]]</noinclude>

Revision as of 05:47, 10 March 2022


aaa
bbb
ccc
ddd
eee
fff
ggg
hhh
iii