英文:
Column facet: how to align header title to the bottom?
问题
我想将我的分面列标题底部对齐。
我得到了以下结果,标题未向下对齐,每个标题与图形底部的距离不同。
如何将这些标题对齐到底部?
谢谢
英文:
I would like to align to the bottom all the header titles of my facet columns.
And I get the below result, the titles are not aligned downwards, each one has a different distance from the graphic bottom.
How to align these titles to the bottom?
Thank you
答案1
得分: 0
这似乎是一个错误。你可以在GitHub上提出吗?这里有一个解决方法。
{
"data": {"name": "data-eb2eb4918524c908955f7797d7245a00"},
"facet": {
"column": {
"field": "f",
"header": {"labelOrient": "bottom", "labelFontSize": 20, "title": ""}
}
},
"spec": {
"layer": [
{
"mark": {"type": "arc", "outerRadius": 100},
"encoding": {
"color": {
"field": "k",
"legend": {"title": ""},
"sort": {"field": "n"},
"type": "nominal"
},
"theta": {"field": "v", "stack": true, "type": "quantitative"}
}
},
{
"mark": {"type": "text", "fill": "black", "radius": 115},
"encoding": {
"color": {
"field": "k",
"legend": {"title": ""},
"sort": {"field": "n"},
"type": "nominal"
},
"text": {"field": "v", "format": ",.1f", "type": "quantitative"},
"theta": {"field": "v", "stack": true, "type": "quantitative"}
}
}
]
},
"resolve": {"scale": {"theta": "independent"}},
"$schema": "https://vega.github.io/schema/vega-lite/v5.2.0.json",
"datasets": {
"data-eb2eb4918524c908955f7797d7245a00": [
{"n": 1, "f": "非森林", "k": "N", "v": 32.20114689016321},
{"n": 2, "f": "非森林", "k": "E", "v": 22.30554330245552},
{"n": 3, "f": "非森林", "k": "S", "v": 14.350830760182326},
{"n": 4, "f": "非森林", "k": "W", "v": 31.14247904719894},
{"n": 5, "f": "森林", "k": "N", "v": 24.525745257452574},
{"n": 6, "f": "森林", "k": "E", "v": 20.460704607046072},
{"n": 7, "f": "森林", "k": "S", "v": 21.00271002710027},
{"n": 8, "f": "森林", "k": "W", "v": 34.010840108401084},
{"n": 9, "f": "未分类", "k": "N", "v": 29.437706725468576},
{"n": 10, "f": "未分类", "k": "E", "v": 32.08379272326351},
{"n": 11, "f": "未分类", "k": "S", "v": 16.427783902976845},
{"n": 12, "f": "未分类", "k": "W", "v": 22.05071664829107}
]
}
}
英文:
Looks like a bug. Can you raise it on GitHub? Here is a workaround.
{
"data": {"name": "data-eb2eb4918524c908955f7797d7245a00"},
"facet": {
"column": {
"field": "f",
"header": {"labelOrient": "bottom", "labelFontSize": 20, "title": ""}
}
},
"spec": {
"layer": [
{
"mark": {"type": "arc", "outerRadius": 100},
"encoding": {
"color": {
"field": "k",
"legend": {"title": ""},
"sort": {"field": "n"},
"type": "nominal"
},
"theta": {"field": "v", "stack": true, "type": "quantitative"}
}
},
{
"mark": {"type": "text", "fill": "black", "radius": 115},
"encoding": {
"color": {
"field": "k",
"legend": {"title": ""},
"sort": {"field": "n"},
"type": "nominal"
},
"text": {"field": "v", "format": ",.1f", "type": "quantitative"},
"theta": {"field": "v", "stack": true, "type": "quantitative"}
}
}
]
},
"resolve": {"scale": {"theta": "independent"}},
"$schema": "https://vega.github.io/schema/vega-lite/v5.2.0.json",
"datasets": {
"data-eb2eb4918524c908955f7797d7245a00": [
{"n": 1, "f": "Non Forest", "k": "N", "v": 32.20114689016321},
{"n": 2, "f": "Non Forest", "k": "E", "v": 22.30554330245552},
{"n": 3, "f": "Non Forest", "k": "S", "v": 14.350830760182326},
{"n": 4, "f": "Non Forest", "k": "W", "v": 31.14247904719894},
{"n": 5, "f": "Forest", "k": "N", "v": 24.525745257452574},
{"n": 6, "f": "Forest", "k": "E", "v": 20.460704607046072},
{"n": 7, "f": "Forest", "k": "S", "v": 21.00271002710027},
{"n": 8, "f": "Forest", "k": "W", "v": 34.010840108401084},
{"n": 9, "f": "Unclassified", "k": "N", "v": 29.437706725468576},
{"n": 10, "f": "Unclassified", "k": "E", "v": 32.08379272326351},
{"n": 11, "f": "Unclassified", "k": "S", "v": 16.427783902976845},
{"n": 12, "f": "Unclassified", "k": "W", "v": 22.05071664829107}
]
}
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论