Dear All
I have developed a small app.
It has scatter plot which update from a select .
Issue is Hover tool is not shown when i plot inside the call back .
it displays hover tool only if scatter plot is rendered outside call back
here is the code
source=ColumnDataSource(df_new)
hover=HoverTool(
tooltips=[
( ‘date’, ‘@bh_date{%F}’ ),
( ‘cell’, ‘@cell_name_new’ ), # use @{ } for field names with spaces
( ‘user’, ‘@avg_user_number{0.0 a}’ ),
( ‘thpt’, ‘@dl_user_thpt_mbps{0.0 a}’ ),
( ‘prb’, ‘@dlprb_util{0.0 a}’ ),
( ‘cqi’, ‘@cqi_2016_avg{0.0 a}’ ),
],
formatters={
'bh_date' : 'datetime', # use 'datetime' formatter for 'date' field
# 'adj close' : 'printf', # use 'printf' formatter for 'adj close' field
# use default 'numeral' formatter for other fields
},
# display a tooltip whenever the cursor is vertically in line with a glyph
mode='vline'
)
tools = [hover, BoxZoomTool(), ResetTool(), CrosshairTool(), BoxSelectTool(), WheelZoomTool()]
p1 = figure(x_axis_type=“datetime”, title=‘Users’, width = 600, height = 450,tools=tools,sizing_mode=“stretch_width”)
p1.scatter(x=‘bh_date’,y=‘avg_user_number’,source=source,legend_field=‘cell_name_new’,line_color=cell_cmp,fill_color=cell_cmp)
it works .
but when i bring p1.scatter inside call back ,plot updated fine but no display of hover tool
def update_plot(attr,old,new):
source.data=df_new
p1.scatter(x=‘bh_date’,y=‘avg_user_number’,source=source,legend_field=‘cell_name_new’,line_color=cell_cmp,fill_color=cell_cmp)
i need help how to update hover tool from call back
i am successfully updating dataframe from call back