☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

HoverTool w/ multiple renderers not highlighting all points that share a row in the ColumnDataSource

Community Support
bpuchala
bpuchala

Between 0.12.6 and 0.12.7 the behavior of HoverTool with multiple renderers changes so that it no longer highlights all the points that share a row in the ColumnDataSource when any one is hovered over individually. How can I get the 0.12.6 and earlier behavior?

Thanks!

In the following, I want the squares and circles that share a row in the ColumnDataSource to both be highlighted when either one is hovered over.

···

from bokeh.plotting import figure, output_file, show

from bokeh.models import HoverTool, ColumnDataSource

from bokeh.sampledata.glucose import data

output_file(“styling_hover.html”)

subset = data.ix[‘2010-10-06’]

y = subset[‘glucose’]

x = list(range(len(y)))

x_shift = [2.*x[i] for i in range(len(x))]

y_shift = [2.*y[i] for i in range(len(y))]

src = ColumnDataSource(data={“x”:x, “y”:y, “x_shift”:x_shift, “y_shift”:y_shift})

Basic plot setup

plot = figure(plot_width=600, plot_height=300, x_axis_type=“datetime”, tools=“”,

          toolbar_location=None, title='Hover over points')

plot.line(“x”, “y”, source=src, line_dash=“4 4”, line_width=1, color=‘gray’)

cr = plot.circle(“x”, “y”, source=src, size=20,

            fill_color="grey", hover_fill_color="firebrick",

            fill_alpha=0.05, hover_alpha=0.3,

            line_color=None, hover_line_color="white")

sq = plot.square(“x_shift”, “y_shift”, source=src, size=20,

            fill_color="grey", hover_fill_color="yellow",

            fill_alpha=0.05, hover_alpha=0.3,

            line_color=None, hover_line_color="white")

plot.add_tools(HoverTool(tooltips=None, renderers=[sq, cr], mode=‘mouse’))

show(plot)

⌁   Link to post

End of archived discussion · Replies are disabled