I have a waterfall-like Vega graph that is constructed from vertical and horizontal rectangle marks:
The graph supports multiple series at once, each in different colors by id (only one is shown in the image above).
Is there a way to hightlight the entire series on hover, rather than just a single column as shown? eg. if I hover on the blue series, the whole blue series should turn firebrick. If I hover on the orange series (not shown), it should turn firebrick instead. etc.
marks: [
{
type: 'group',
from: {
facet:
{data: 'datatable', name: 'curve', groupby: 'id'}
},
marks: [{
type: 'rect',
from: {data: 'curve'},
encode: {
update: {
xc: {scale: 'x', field: 'x'},
width: {value: 10},
y: {scale: 'y', field: 'y'},
'y2': {scale: 'y', field: 'prevY'},
fill: {scale: 'color', field: 'id'}
},
hover: {fill: {value: 'firebrick'}}
}
},{
type: 'rect',
from: {data: 'curve'},
encode: {
update: {
x: {scale: 'x', field: 'prevX'},
'x2': {scale: 'x', field: 'x'},
y: {scale: 'y', field: 'prevY'},
height: {value: 1},
fill: {scale: 'color', field: 'id'},
},
}
}]
},
]
