我有一个饼图,我想将其转换为半饼图。我尝试了不同的设置,但无法让它工作。可以吗?
你需要一个秤。
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"mark": {"type": "arc", "radius2": 50},
"data": {"values": [{"type": "+", "value": 60}, {"type": "-", "value": 40}]},
"encoding": {
"theta": {
"field": "value",
"type": "quantitative",
"scale": {
"type": "linear",
"rangeMax": 1.5708,
"rangeMin": -1.5708
}
},
"color": {"field": "type", "type": "nominal"}
},
"config": {"legend": {"disable": true}}
}