Is it possible to manage density of data labels (text marks) similarly to what the labelOverlap setting does with the axis labels? Ideally, I'd like them to be in sync.
{
"data": {"name": "dataset"},
"encoding": {
"x": {
"field": "Date",
"type": "nominal",
"axis": {"labelOverlap": true}
},
"y": {
"aggregate": "sum",
"field": "Sum of Value"
}
},
"layer": [
{"mark": {"type": "bar"}},
{
"mark": {
"type": "text",
"baseline": "top",
"align": "left",
"dx": 5,
"dy": -3,
"fontSize": 9,
"angle": 270
},
"encoding": {
"text": {"field": "Sum of Value"}
}
}
]
}
Here is a prototype solutions that I came up with.
Within PowerBI, I'll simply use a hardcoded threshold like "if the number of bars is more than 100, then hide every other label". If will be sufficient for my use case.