… as the arrow is still shown.
show_arrow=False, attachment=‘horizontal’ works as expected.
Bokeh bug or am I doing something wrong?
Sample demonstrating issue:
···
Demonstrates HoverTool with properties: show_arrow=False, attachment=‘vertical’
doesn’t work properly – as arrow is still shown
from bokeh.plotting import figure, output_file, save
from bokeh.models import HoverTool, ColumnDataSource
from bokeh.layouts import gridplot
data = {‘x’:range(10),
‘y0’:range(10),
‘y1’:range(10)[::-1],
}
source = ColumnDataSource(data=data)
fig = figure(tools=[‘crosshair’])
fig.tools[0].dimensions = ‘height’
plots =
plots.append( fig.line(x=‘x’,y=‘y0’, name=“first”, source=source) )
plots.append( fig.line(x=‘x’,y=‘y1’, name=“second”, source=source) )
ATTACHMENT=‘vertical’ # always shows arrow, regardless of value of show_arrow
#ATTACHMENT=‘horizontal’ # works OK with show_arrow = True/False
TOOLTIPS = [ (“x”, “~x"), ("y", "~y”) ]
fig.add_tools( HoverTool(
mode=‘vline’,
line_policy=‘interp’,
show_arrow=False,
attachment=ATTACHMENT,
renderers=[plots[0]],
names=[plots[0].name],
tooltips=dict( [(‘name’,plots[0].name)]+TOOLTIPS ),
)
)
fig.add_tools( HoverTool(
mode=‘vline’,
line_policy=‘interp’,
show_arrow=True,
attachment=ATTACHMENT,
renderers=[plots[1]],
names=[plots[1].name],
tooltips=dict( [(‘name’,plots[1].name)]+TOOLTIPS ),
)
)
grid = gridplot([[fig]])
output_file( ‘tooltips.html’ )
save( grid )
``