2016-07-29 144 views
1

有没有办法删除工具提示上的小黑色指针箭头(指示当point_policy='follow_mouse'时鼠标的位置)? 任何帮助表示赞赏如何删除工具提示上的箭头从散景图

enter image description here

+0

不知道如果不修改散景源代码是否可能。您可以设置'hover.attachment = None',但会禁用点策略。 –

回答

1

答案是不是目前这方面的任何配置选项,散景0.12.1的。


但是,以下是一些可能有用的附加信息。我会鼓励你打开一个问题有关项目问题跟踪这一潜在功能的讨论:

https://github.com/bokeh/bokeh/issues

这是可能的,这可能与一些CSS技巧来完成,但我不知道某些。或者,现在也可以用您自己的自定义扩展名来扩展Bokeh。你可以找到更多相关信息写在这里自定义扩展:

http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html

然而,这至少是一个较为复杂的任务,可能迫使那种背和问题,并帮助该StackOverflow上是不适合对于。请随时停止该项目mailing listgitter chat channel的帮助。

1

作为散景0.12.2的,存在选项用于:

hover.show_arrow = False 

这是一个完整的例子中,从official documentation采取:

#!/usr/bin/env python 
# coding: utf-8 
# 

from bokeh.plotting import figure, output_file, show 
from bokeh.models import HoverTool 


def main(): 
    # prepare some data 
    x = [1, 2, 3, 4, 5] 
    y = [6, 7, 2, 4, 5] 

    # output to static HTML file 
    output_file("lines.html") 

    # create a new plot with a title and axis labels 
    p = figure(title="simple line example", x_axis_label='x', y_axis_label='y', tools='hover') 

    # add a line renderer with legend and line thickness 
    p.line(x, y, legend="Temp.", line_width=2) 

    # hover 
    hover = p.select_one(HoverTool) 
    hover.point_policy = "follow_mouse" 
    hover.tooltips = [ 
     ("Name", "@name"), 
     ("Unemployment rate)", "@rate%"), 
     ("(Long, Lat)", "($x, $y)"), 
    ] 
    # disable tooltip arrow 
    hover.show_arrow = False 

    # show the results 
    show(p) 

    return 0 

if __name__ == '__main__': 
    exit(main()) 

(对于历史)

由于bigreddot说,我打开issue,我做了patch禁用箭头。如果被接受,您将能够禁用箭头:

hover.show_arrow = False