简体   繁体   English

Python 散景翻转颜色

[英]Python Bokeh rollover color

I use Python comprehensive list to display several charts (under bokeh env) and use HoverTool to display some data values.我使用 Python 综合列表显示多个图表(在 bokeh env 下)并使用 HoverTool 显示一些数据值。

[p.line(x='newindex', y='count', source=result.loc[result.index.year == i],\
color=next(colors),line_width=4,legend_label=str(i)) for i in unique_sorted_date]
hover_tool = HoverTool(tooltips='Date: @oldindex <br>  deces: @count')
p.add_tools(hover_tool)

I would like to highlight the line where I want to retrieve information (from tooltips).我想突出显示我想要检索信息的行(从工具提示)。 For instance, the selected line will be red and the others one greys.例如,选定的行将是红色的,而其他行是灰色的。 Is there an easy way to this?有没有简单的方法?

此选项突出显示曲线 hover_line_color="red"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM