要解决Bokeh / Python中TOOLTIPS无法悬停的问题,您可以尝试以下解决方法:
pip install --upgrade bokeh
TOOLTIPS = [
("x", "@x"),
("y", "@y")
]
tools
参数来启用所需的工具箱。例如,使用HoverTool
来启用悬停功能:from bokeh.plotting import figure
from bokeh.models import HoverTool
p = figure(tools=[HoverTool()], tooltips=TOOLTIPS)
Circle
对象,并将其添加到图表中:from bokeh.plotting import figure
from bokeh.models import Circle
p = figure(tools=[HoverTool()], tooltips=TOOLTIPS)
p.circle('x', 'y', source=source, size=10)
请注意,上述代码示例中的source
是将数据传递给图表的数据源对象。
希望以上解决方法能帮助您解决Bokeh / Python中TOOLTIPS无法悬停的问题!