hello,
i have a problem that many values are showing superposed in place of one value .the image represent the problème.
this is my code vega:
{
$schema: https://vega.github.io/schema/vega-lite/v2.json
"autosize":
{
"type": "pad",
"resize": false
},
"data":
{
"url": {
"%context%": true,
"index": "index"
"body":
{
"aggs" : {
"eqpt_buckets": {
"composite" : {
"size": 5000,
"sources" :
[
{
"code_pays":
{"terms" :
{
"field": "code_pays.keyword"
}
}
},
{
"proposed_contacts_total":
{"terms" :
{
"field": "proposed_contacts_total"
}
}
},
{
"customers_total":
{"terms" :
{"field": "customers_total"
}
}
}
]
}
}
}
}
}
"format": {property: "aggregations.eqpt_buckets.buckets"}
},
"transform":
[
{"filter": "datum.key.proposed_contacts_total >= 0"},
{"calculate": "datum.key.code_pays",
"as": "code_pays.keyword"
},
{"calculate": "datum.key.proposed_contacts_total",
"as": "proposed_contacts_total"},
{"calculate": "datum.key.customers_total",
"as": "customers_total"},
{
"window": [{"op": "sum", "field": "proposed_contacts_total", "as": "num",}],
"groupby": ["code_pays"],
}
{
"window": [{"op": "sum", "field": "customers_total", "as": "denum"}],
"groupby": ["code_pays"],
}
{"calculate": "datum.num/datum.denum * 100", "as": "result"},
],
"mark": "bar",
"encoding": {
"x": {
"field": "result",
"title":"",
"type":"quantitative",
"scale":{"padding":10},
}
"y": {"field": "code_pays.keyword" , "type":"ordinal","title":""}
"tooltip": {"field": "result", "type": "quantitative","format":".2f"}
},
"layer": [{
"mark": "bar"
},
{
"mark": {
"type": "text",
"align": "left",
"xOffset": 0,
"dx":3
"aria": false
},
"encoding": {
"text": {"field": "result", "type": "quantitative","format":".2f"}
}
}]
}
thank you for help.