Here I wanted to show distinct 'd' field values for each 'a' field in tooltip. For text it's giving correct but A and B are overlapping and in tooltip it's giving only B.
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"description": "A simple bar chart with embedded data with tooltip.",
"width":500,
"height":300,
"data": {
"values": [
{"a": "A", "b": 28,"d": "A"},
{"a": "A", "b": 55,"d": "A"},
{"a": "A", "b": 43,"d": "B"},
{"a": "A", "b": 91,"d": "B"},
{"a": "B", "b": 81,"d": "A"},
{"a": "B", "b": 53,"d": "A"},
{"a": "G", "b": 19,"d": "B"},
{"a": "H", "b": 87,"d": "A"},
{"a": "I", "b": 52,"d": "B"}
]
},
"encoding": {
"x": {"field": "a", "type": "nominal"}
},
"layer":[
{
"encoding": {
"y": {"aggregate":"distinct", "field": "d",
"scale": {"domain": [0, 10]},
"type": "quantitative",
"title": "Open Rate (%)",
"axis": {"titleColor":"#54b399"}
}
},
"layer":[{
"mark": {"stroke": "#54b399", "type": "line", "interpolate": "monotone", "point": true}
},
{
"mark": {
"type": "text",
"align": "left",
"baseline": "middle",
"fontSize": 24,
"dx": 3,
"dy": -13
},
"encoding": {
"text": {"field": "d"},
"tooltip": {"field": "d"}
}
}
]
} ],
"resolve": {"scale": {"y": "independent"}}
}
can I know how to get both A and B values in tooltip ?