Difference between revisions of "PieChartSegment"

From Sega Retro

 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><div style="display:none;">{{incvar|zindex}}{{#vardefine:skewangle|{{#expr:90-{{{angle|}}}}}}}
+
<includeonly>{{#vardefine:angle|{{{angle|}}}}}{{#vardefine:colour|{{#if:{{{colour|}}}|{{{colour}}}|{{#sub:{{WikiColour|FG|{{#switch:{{#var:segmentCount}}
{{#vardefine:opp|{{#var:radius}}}}
+
    |0=blue
{{#vardefine:hyp|{{#expr:{{#var:opp}}/sin({{Deg2Rad|{{#expr:90-{{#var:skewangle}}}}}})}}}}
+
    |1=red
{{#vardefine:adj|{{#expr:sqrt(({{#var:hyp}}^2) - ({{#var:opp}}^2))}}}}
+
    |2=orange
 +
    |3=green
 +
    |4=purple
 +
    |5=cyan
 +
    |6=yellow
 +
    |7=redmagenta
 +
    |8=yellowgreen
 +
    |9=magenta
 +
  }}}}|0|-1}}{{#ifexpr:{{#var:segmentCount}}>9|{{#switch:{{#var:segmentCount}}
 +
    |10=666666
 +
    |11=FFFFFF
 +
    |12=AAAAAA
 +
    |13=000000
 +
    |14=FFAAAA
 +
    |15=AAFFAA
 +
    |16=AAAAFF
 +
    |17=FFFFAA
 +
    |18=AAFFFF
 +
    |19=FFAAFF
 +
    |#default:000000
 +
  }}}}}}}}
 +
  #{{#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|}}} ({{#expr:({{#var:angle}}/360)*100 round 2}}%)</div>}}{{incvar|segmentCount}}
 +
</includeonly><noinclude>
  
{{#vardefine:translationX|{{#expr:{{#var:radius}}+({{#var:adj}}/2)}}}}
+
{{PieChart|
{{#vardefine:translationY|{{#var:radius}}}}
+
{{PieChartSegment
 
+
| angle=10
</div><div style="transform:translate({{#var:translationX}}px, {{#expr:(-{{#var:oldTranslationY}}) + {{#var:translationY}}}}px)><div style="width:{{#var:radius}}px; height:{{#var:radius}}px; background-color:#{{{colour|}}}{{{color|}}}; border:0px; transform: skew({{#var:skewangle}}deg); position:relative;"></div></div>{{
+
| caption=aaa
#vardefine:oldTranslationX|{{#var:translationX}}}}{{
+
}}
#vardefine:oldTranslationY|{{#var:translationY}}}}{{
+
{{PieChartSegment
#vardefine:oldAngle|{{{angle|}}}
+
| angle=20
 +
| caption=bbb
 +
}}
 +
{{PieChartSegment
 +
| angle=30
 +
| caption=ccc
 
}}
 
}}
</includeonly><noinclude>
 
{{#vardefine:oldTranslationX|0}}{{#vardefine:oldTranslationY|0}}{{#vardefine:oldAngle|0}}
 
{{PieChart|
 
 
{{PieChartSegment
 
{{PieChartSegment
 
| angle=40
 
| angle=40
| colour=0000FF
+
| caption=ddd
 +
}}
 +
{{PieChartSegment
 +
| angle=50
 +
| caption=eee
 +
}}
 +
{{PieChartSegment
 +
| angle=60
 +
| caption=fff
 +
}}
 +
{{PieChartSegment
 +
| angle=45
 +
| caption=ggg
 
}}
 
}}
 
{{PieChartSegment
 
{{PieChartSegment
| angle=20
+
| angle=45
| colour=FF00FF
+
| caption=hhh
 +
}}
 +
{{PieChartSegment
 +
| angle=10
 +
| caption=iii
 +
| colour=555555
 
}}
 
}}
 
}}
 
}}
 +
<div style="display:inline-block">{{PieChartGenre|diameter=200|system=SG-1000}}</div>
 +
<div style="display:inline-block">{{PieChartGenre|diameter=200|system=Dreamcast}}</div>
 +
<div style="display:inline-block">{{PieChartReleaseDate|diameter=200|system=Mega Drive}}</div>
 
[[Category:Templates]]</noinclude>
 
[[Category:Templates]]</noinclude>

Latest revision as of 12:36, 12 April 2022


aaa (2.78%)
bbb (5.56%)
ccc (8.33%)
ddd (11.11%)
eee (13.89%)
fff (16.67%)
ggg (12.5%)
hhh (12.5%)
iii (2.78%)
SG-1000







Action (43) (40.95%)
Adventure (1) (0.95%)
Educational (0) (0%)
Fighting (0) (0%)
Racing (6) (5.71%)
RPG (1) (0.95%)
Shoot-'em-up (22) (20.95%)
Simulation (0) (0%)
Sports (23) (21.9%)
Table (6) (5.71%)
Miscellaneous (3) (2.86%)
Dreamcast







Action (69) (10.21%)
Adventure (138) (20.41%)
Educational (0) (0%)
Fighting (29) (4.29%)
Racing (54) (7.99%)
RPG (33) (4.88%)
Shoot-'em-up (44) (6.51%)
Simulation (106) (15.68%)
Sports (69) (10.21%)
Table (76) (11.24%)
Miscellaneous (58) (8.58%)
Mega Drive














1988 (4) (0.38%)
1989 (24) (2.26%)
1990 (79) (7.42%)
1991 (156) (14.66%)
1992 (152) (14.29%)
1993 (199) (18.7%)
1994 (216) (20.3%)
1995 (128) (12.03%)
1996 (47) (4.42%)
1997 (16) (1.5%)
1998 (17) (1.6%)
1999 (7) (0.66%)
2000 (2) (0.19%)
2001 (7) (0.66%)
2002 (6) (0.56%)
2003 (4) (0.38%)