Hi,
Searching this strange behaviour and landed to this post.
I got this strange behaviour several times. 2 things i noticed,
-
it is due to legend overlay on top of plot. In the case even legend.visible is set to False, but it blocks the hover tool display properly.
-
unknown reason. annular wedge from following code gives the issue.
import pandas as pd
import numpy as np
from bokeh.plotting import figure
from bokeh.io import show
from bokeh.models import HoverTool, ColumnDataSource
from bokeh.palettes import Category20
from bokeh.transform import cumsum
###->data
data = {"Code": [11,8,4,2,6,1,13,10,5,9],
"Count": [820,277,272,164,94,67,62,53,17,2],
"Rate": [0.4486,0.1515,0.1488,0.0897,0.0514,0.0367,0.0339,0.0290,0.0093,0.0011]}
hover_issue_demo_df = pd.DataFrame(data)
hover_issue_demo_df["Colour"] = Category20[len(hover_issue_demo_df["Code"])]
hover_issue_demo_df["cum_s"] = (hover_issue_demo_df["Rate"].cumsum().shift(1).fillna(0))*2*np.pi
hover_issue_demo_df["cum"] = (hover_issue_demo_df["Rate"].cumsum())*2*np.pi
###->CDS source
CDS_hover_issue_demo_df = ColumnDataSource(hover_issue_demo_df)
##->figure
p_hover_issue_demo_df = figure(plot_width=400, plot_height=400, title="Demo", x_range=(-0.5, 0.5), y_range=(-1, 1))
p_hover_issue_demo_df.annular_wedge(x=0, y=0,
inner_radius=0.2, outer_radius=0.35,
source=CDS_hover_issue_demo_df,
start_angle="cum_s", end_angle="cum",
color="Colour"
)
###->add hovertool
hover = HoverTool(tooltips=[("Count", "@Count{0,0}"), ("Percentage", "@Rate{0.0000%}")], mode="mouse", point_policy="follow_mouse")
p_hover_issue_demo_df.add_tools(hover)
show(p_hover_issue_demo_df)
On the result plot, these areas are blind spot, hover does not display.
Regards
mhLearn