Template:Graph:MaterialPie: Difference between revisions
mNo edit summary Tag: Reverted |
Tag: Undo |
||
Line 1: | Line 1: | ||
<includeonly>{{#tag:graph| | <includeonly>{{#tag:graph| | ||
{ | { | ||
"version": 2, | |||
"width": {{{width|100}}}, | |||
"height": {{{height|100}}}, | |||
" | "data": [ | ||
" | { | ||
"name": "table", | |||
"values": [ | |||
" | |||
{"name":"AFF","value":{{{val1|10}}}}, | {"name":"AFF","value":{{{val1|10}}}}, | ||
{"name":"MQ","value":{{{val2|10}}}}, | {"name":"MQ","value":{{{val2|10}}}}, | ||
Line 111: | Line 15: | ||
{"name":"HH","value":{{{val6|10}}}} | {"name":"HH","value":{{{val6|10}}}} | ||
], | ], | ||
"transform": [{"type": "pie","field": "value"}] | |||
{ | } | ||
"type": " | ], | ||
"field": "value" | "scales": [ | ||
} | { | ||
"name": "r", | |||
"type":"sqrt", | |||
"domain": {"data": "table","field": "value"}, | |||
} | "range": [20,{{{size|100}}}] | ||
</includeonly> | }, | ||
{ | |||
"name":"color", | |||
"type":"ordinal", | |||
"domain":{"data":"table","field":"name"}, | |||
"range":"category10" | |||
} | |||
], | |||
"marks": [ | |||
{ | |||
"type": "arc", | |||
"from": {"data": "table"}, | |||
"properties": { | |||
"enter": { | |||
"x": {"field": {"group": "width"},"mult": 0.5}, | |||
"y": {"field": {"group": "height"},"mult": 0.5}, | |||
"startAngle": {"field": "layout_start"}, | |||
"endAngle": {"field": "layout_end"}, | |||
"innerRadius": {"value": 20}, | |||
"outerRadius": {"scale": "r","field": "value"}, | |||
"stroke": {"value": "#fff"}, | |||
"fill":{"scale":"color","field":"name"} | |||
} | |||
} | |||
} | |||
], | |||
"legends":[{ | |||
"fill":"color", | |||
"title":"", | |||
"offset": {{{offset|100}}}, | |||
"properties":{ | |||
"symbols":{ | |||
"strokeWidth":{"value":0}, | |||
"shape":{"value":"square"}, | |||
"size":{"value":175} | |||
} | |||
} | |||
}] | |||
} | |||
}}</includeonly> |