'Altair: persistent tooltip

I have a horizontal line that changes height depending on brush selection. Is there anyway to constantly display the line as the line goes up and down? Below is the code for the line plot:

q1 = alt.Chart(df).mark_rule(color='black').encode(
    y=alt.Y(col, aggregate='q1', type="quantitative"),
    size=alt.SizeValue(3),
    tooltip=alt.Tooltip(col, aggregate='q1', type="quantitative")
).transform_filter(
    brush_merged
)

At the moment the tooltip only shows up when hovering over the line. Also, is there a way to add a label to the q1 value? At the moment, only a number pops up when hovered over. It would be nice to also tell what the line actually means (i.e. first quartile).



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source