Line 1: | Line 1: | ||
<graph> | <graph> | ||
{ | { | ||
" | "description": "A basic pie chart example.", | ||
"width": 200, | "width": 200, | ||
"height": 200, | "height": 200, | ||
"autosize": " | "autosize": "none", | ||
"data": [ | "data": [ | ||
Line 10: | Line 10: | ||
"name": "table", | "name": "table", | ||
"values": [ | "values": [ | ||
{"id": " | {"id": 1, "field": 4}, | ||
{"id": " | {"id": 2, "field": 6}, | ||
{"id": " | {"id": 3, "field": 10}, | ||
{"id": 4, "field": 3}, | |||
{"id": 5, "field": 7}, | |||
{"id": 6, "field": 8} | |||
], | ], | ||
"transform": [ | "transform": [ | ||
Line 18: | Line 21: | ||
"type": "pie", | "type": "pie", | ||
"field": "field", | "field": "field", | ||
"startAngle": | "startAngle": {"signal": "startAngle"}, | ||
"endAngle": | "endAngle": {"signal": "endAngle"}, | ||
"sort": | "sort": {"signal": "sort"} | ||
} | } | ||
] | ] | ||
Line 31: | Line 34: | ||
"type": "ordinal", | "type": "ordinal", | ||
"domain": {"data": "table", "field": "id"}, | "domain": {"data": "table", "field": "id"}, | ||
"range": {"scheme": " | "range": {"scheme": "category20"} | ||
} | } | ||
], | ], | ||
Line 43: | Line 46: | ||
"fill": {"scale": "color", "field": "id"}, | "fill": {"scale": "color", "field": "id"}, | ||
"x": {"signal": "width / 2"}, | "x": {"signal": "width / 2"}, | ||
"y": {"signal": "height / 2"}, | "y": {"signal": "height / 2"} | ||
}, | |||
"update": { | |||
"startAngle": {"field": "startAngle"}, | "startAngle": {"field": "startAngle"}, | ||
"endAngle": {"field": "endAngle"}, | "endAngle": {"field": "endAngle"}, | ||
"innerRadius": {" | "padAngle": {"signal": "padAngle"}, | ||
"innerRadius": {"signal": "innerRadius"}, | |||
"outerRadius": {"signal": "width / 2"}, | "outerRadius": {"signal": "width / 2"}, | ||
"cornerRadius": {" | "cornerRadius": {"signal": "cornerRadius"} | ||
} | } | ||
} | } |