This is my code. I am able to plot the rays at 90 degrees but unfortunately HoverTool is not working with my code. The thing is at other places when I don’t use CDS, the HoverTool works fine but whenever I explicitly declare a CDS, HoverTool fails to work. I am not sure what I am doing wrong.
Also, I am aware CDS is implicitly created whenever it isn’t explicitly created but HoverTool works fine when it is created implicitly.
inc = df.Type > 0
dec = ~inc
INC_COLOR = '#35762E'
DEC_COLOR = '#C80000'
inc_source = ColumnDataSource(data=dict(
x1=df.Position[inc],
pattern1=df.Pattern[inc]
))
dec_source = ColumnDataSource(data=dict(
x2=df.Position[dec],
pattern2=df.Pattern[dec]
))
#minVal is a scalar like 340.0
incFig = fig.ray(x='x1', y=minVal, source=inc_source, length=0, angle=90, angle_units="deg", color=INC_COLOR, name="patterns1")
decFig = fig.ray(x='x2', y=minVal, source=dec_source, length=0, angle=90, angle_units="deg", color=DEC_COLOR, name="patterns2")
fig.add_tools(HoverTool(
renderers=[incFig],
tooltips=[
("Patterns: ", "@pattern1")
],
mode='hline'
))
fig.add_tools(HoverTool(
renderers=[decFig],
tooltips=[
("Patterns: ", "@pattern2")
],
mode='hline'
))