Hover ToolTips at fixed position

LS,
How can the tooltips be shown at a fixed position ?

I have a long text string in my data source. It is a short story. When I’m over a circle nI want the text to be shown next to the plot, not at the position of the cursor because the tooltips then covers the whole plot.

Thanks !

Arthur

Got it !

Added a DIV as container for the tooltip:

Title

<span style="font-size: 12px; color: #696;">@title</span>
</div>
···

Op dinsdag 19 mei 2015 10:52:33 UTC+2 schreef Arthur Dijkstra:

LS,
How can the tooltips be shown at a fixed position ?

I have a long text string in my data source. It is a short story. When I’m over a circle nI want the text to be shown next to the plot, not at the position of the cursor because the tooltips then covers the whole plot.

Thanks !

Arthur


For information, services and offers, please visit our web site: http://www.klm.com.

This e-mail and any attachment may contain confidential and privileged material intended for the addressee only.

If you are not the addressee, you are notified that no part of the e-mail or any attachment may be disclosed, copied or distributed,

and that any other action related to this e-mail or attachment is strictly prohibited, and may be unlawful.

If you have received this e-mail by error, please notify the sender immediately by return e-mail, and delete this message.

Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its employees shall not be liable for the incorrect or

incomplete transmission of this e-mail or any attachments, nor responsible for any delay in receipt.

Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch Airlines) is registered in Amstelveen, The Netherlands,

with registered number 33014286


Great thanks for this! Do you know how to modify it, so that the tooltip is at the same position relative the figure, rather than relative the page as in the code above? In my case, i would like the tooltip to always show up just under the plot, even if I scroll on the page.

···

On Thursday, June 4, 2015 at 4:25:06 AM UTC-4, [email protected] wrote:

Op dinsdag 19 mei 2015 10:52:33 UTC+2 schreef Arthur Dijkstra:

LS,
How can the tooltips be shown at a fixed position ?

I have a long text string in my data source. It is a short story. When I’m over a circle nI want the text to be shown next to the plot, not at the position of the cursor because the tooltips then covers the whole plot.

Thanks !

Arthur

Got it !

Added a DIV as container for the tooltip:

Title

<span style="font-size: 12px; color: #696;">@title</span>
</div>

For information, services and offers, please visit our web site: http://www.klm.com.

This e-mail and any attachment may contain confidential and privileged material intended for the addressee only.

If you are not the addressee, you are notified that no part of the e-mail or any attachment may be disclosed, copied or distributed,

and that any other action related to this e-mail or attachment is strictly prohibited, and may be unlawful.

If you have received this e-mail by error, please notify the sender immediately by return e-mail, and delete this message.

Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its employees shall not be liable for the incorrect or

incomplete transmission of this e-mail or any attachments, nor responsible for any delay in receipt.

Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch Airlines) is registered in Amstelveen, The Netherlands,

with registered number 33014286


Joel,

I’ve been able to do this via dom manipulation in the hovertool callback. Essentially bokeh.js sets the relative coordinates and then you unset what it wrote and overwrite it with your own before the layout renders:

from bokeh.models import CustomJS
from bokeh.models import HoverTool

callback = CustomJS(code=“”"
var tooltips = document.getElementsByClassName(“bk-tooltip”);

for (var i = 0, len = tooltips.length; i < len; i ++) {

tooltips[i].style.top = “”; // unset what bokeh.js sets

tooltips[i].style.left = “”;

tooltips[i].style.bottom = “0px”;

tooltips[i].style.left = “0px”;

}

“”")
hover = HoverTool(renderers=[your_renderer], callback=callback)
your_figure.add_tools(hover)

``

You may want to be more specific about getting the tooltip dom if you have more than one figure on your page.

This is non ideal, however I know of no other way.

···

On Monday, June 20, 2016 at 4:51:02 PM UTC-6, Joel wrote:

Great thanks for this! Do you know how to modify it, so that the tooltip is at the same position relative the figure, rather than relative the page as in the code above? In my case, i would like the tooltip to always show up just under the plot, even if I scroll on the page.

On Thursday, June 4, 2015 at 4:25:06 AM UTC-4, [email protected] wrote:

Op dinsdag 19 mei 2015 10:52:33 UTC+2 schreef Arthur Dijkstra:

LS,
How can the tooltips be shown at a fixed position ?

I have a long text string in my data source. It is a short story. When I’m over a circle nI want the text to be shown next to the plot, not at the position of the cursor because the tooltips then covers the whole plot.

Thanks !

Arthur

Got it !

Added a DIV as container for the tooltip:

Title

<span style="font-size: 12px; color: #696;">@title</span>
</div>

For information, services and offers, please visit our web site: http://www.klm.com.

This e-mail and any attachment may contain confidential and privileged material intended for the addressee only.

If you are not the addressee, you are notified that no part of the e-mail or any attachment may be disclosed, copied or distributed,

and that any other action related to this e-mail or attachment is strictly prohibited, and may be unlawful.

If you have received this e-mail by error, please notify the sender immediately by return e-mail, and delete this message.

Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its employees shall not be liable for the incorrect or

incomplete transmission of this e-mail or any attachments, nor responsible for any delay in receipt.

Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch Airlines) is registered in Amstelveen, The Netherlands,

with registered number 33014286