是否可以在 vega-lite 散点图中的每个圆圈内放置一个标签?

问题描述 投票:0回答:0

有没有办法在气泡图的圆圈内放置标签,我在 Vega-lite 中开发了以下图表。我也在上传我的脚本,在圆圈内我想显示给圆圈内“标签”的值。我正在使用以下代码

“$schema”: “https://vega.github.io/schema/vega-lite/v5.json”,
“data”: {
“values”: [
{
“A”: 16506,
“B”: “”,
“C”: “Estimate Line Type 1”,
“D”: 30347707.14,
“E”: null,
“Label”: “”,
“F”: null
}

]
},
“width”: 600,
“height”: 400,
“layer”: [
{
“transform”: [
{
“filter”: {
“field”: “C”,
“oneOf”: [“Amount (inflation adjusted NEW)”]
}
}
],
“mark”: {
“type”: “circle”,
“opacity”: 0.8,
“stroke”: “black”,
“strokeWidth”: 1
},
“encoding”: {
“x”: {
“field”: “A”,
“type”: “quantitative”,
“axis”: {“grid”: false}
},
“y”: {
“field”: “F”,
“type”: “quantitative”,
“axis”: {“title”: “F”}
},
“size”: {
“field”: “E”,
“type”: “quantitative”,
“title”: “E”,
“legend”: {“clipHeight”: 30},
“scale”: {“rangeMax”: 5000}
},
“color”: {“field”: “B”, “type”: “nominal”}
}
},
{
“transform”: [
{
“filter”: {
“field”: “C”,
“oneOf”: [“Estimate Line Type 1”, “Estimate Line Type 2”]
}
}
],
“mark”: {“type”: “line”},
“encoding”: {
“x”: {“field”: “A”, “type”: “quantitative”},
“y”: {“field”: “D”, “type”: “quantitative”},
“color”: {“field”: “C”, “type”: “nominal”}
}
}
],
“config”: {}
}

我正在尝试文本字段,但由于我是新手,所以我不确定如何将其标记出来。 dashboard in which I need the text in circle

powerbi dashboard vega-lite vega deneb
© www.soinside.com 2019 - 2024. All rights reserved.