Pie Chart (Vega)

{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"description": "A simple pie chart with embedded data.",
"width": 400,
"height": 400,
"autosize": "none",
"data": [
{
"name": "table",
"values": [
{"category": "A", "amount": 28},
{"category": "B", "amount": 55},
{"category": "C", "amount": 43},
{"category": "D", "amount": 91},
{"category": "E", "amount": 81},
{"category": "F", "amount": 53},
{"category": "G", "amount": 19},
{"category": "H", "amount": 87}
],
"transform": [
{
"type": "pie",
"field": "amount"
}
]
}
],
"scales": [
{
"name": "color",
"type": "ordinal",
"domain": {"data": "table", "field": "category"},
"range": {"scheme": "category20"}
}
],
"marks": [
{
"type": "arc",
"from": {"data": "table"},
"encode": {
"enter": {
"fill": {"scale": "color", "field": "category"},
"x": {"signal": "width / 2"},
"y": {"signal": "height / 2"},
"startAngle": {"field": "startAngle"},
"endAngle": {"field": "endAngle"},
"innerRadius": {"value": 0},
"outerRadius": {"signal": "width / 2"}
}
}
}
]
}