【发布时间】:2021-10-22 17:36:06
【问题描述】:
我如何知道 vega-lite 会产生多少分组?示例用例是:说..我想派生该分组信息以显示一条消息,说“您有太多分组”或根据分组数量找出更好的配色方案。 此处为 vega-lite 规范示例:
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"description": "A simple pie chart with labels.",
"data": {
"values": [
{"category": "a", "value": 4},
{"category": "b", "value": 6},
{"category": "c", "value": 10},
{"category": "d", "value": 3},
{"category": "e", "value": 7},
{"category": "f", "value": 8},{"category": "f", "value": 8}
]
},
"encoding": {
"theta": {"field": "value", "type": "quantitative", "stack": true},
"color": {"field": "category", "type": "nominal"}
},
"layer": [{
"mark": {"type": "arc", "outerRadius": 80}
}, {
"mark": {"type": "text", "radius": 90},
"encoding": {
"text": {"field": "category", "type": "nominal"}
}
}]
}
【问题讨论】:
标签: vega-lite