I’d been wondering about this too, so this is helpful. One thing: the value seems to not always update correctly. For instance, hovering on B only seems to update to B a fraction of the time. Maybe this is a quirk about how vega reads hover events?
Yeah, that’s weird. I’m not familiar enough with Vega to know immediately what could cause this behavior, but if I remember I’ll investigate further and possibly file an issue with them.
Edit: the strange behavior seems to be caused by the "nearest": true setting on the selection. Removing this field produces more expected behavior.
This is a feature of the vega lite spec I provided, which as Mike said, probably shouldn’t have "nearest": true. If you look carefully, what’s happening is that vega is finding the nearest ‘top of the bar’ to the cursor. So if you move your cursor near to the top of the ‘b’ bar, it will update correctly.