How to add legend and hover tooltips to Bokeh objects created through a function? #13149
Closed
ScarletMcLearn
started this conversation in
Documentation
Replies: 1 comment
-
Fixed it through this:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello.
Hope you are all well.
I have created a Python function which creates a bokeh object.
Using this function, I can generate multiple objects - lines, shapes - on the same figure.
I have been trying to add legends and hover tools to the objects generated by the function, but having issues.
I am providing the code below for your reference:
If I uncomment the legend code, I get this error -
ValueError: failed to validate Legend(id='p13230', ...).items: expected an element of List(Instance(LegendItem)), got seq with invalid items [('Line 1', [figure(id='p12674', ...)]), ('Line 2', [figure(id='p12674', ...)])]
In a similar way, if I try to use Hover tools :
I get this error:
ValueError: failed to validate HoverTool(id='p13006', ...).renderers: expected an element of either Auto or List(Instance(DataRenderer)), got [figure(id='p12674', ...)]
Can you please guide me what is wrong here and how to fix it?
Thank you so much.
Beta Was this translation helpful? Give feedback.
All reactions