how to create a dashboard in vega sound an elasticsearch query and a fixed value.
{
"$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}
]
},
"encoding": {
"theta": {"field": "value", "type": "quantitative", "stack": true},
"color": {"field": "category", "type": "nominal", "legend": null}
},
"layer": [{
"mark": {"type": "arc", "outerRadius": 80}
}, {
"mark": {"type": "text", "radius": 90},
"encoding": {
"text": {"field": "category", "type": "nominal"}
}
}],
"view": {"stroke": null}
}
I would like to leave one of the values fixed and the other taken from a query but not without how to do it:
I need something like this:
"values": [
{"category": "a",
{
"query": {
"constant_score": {
"filter": {
"terms": {
"objectid": [
143009,
122862
]
}
}
}
},
"aggs": {
"parada": { "sum": { "field": "seg" } }
}
}
},
{"category": "b", "value": 6}
]