☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Any good, working examples of tooltips with datetime formatting?

Community Support
Christopher_Jacoby
Christopher_Jacoby

I’m banging my head trying to get my tooltip to show day-month-year. What I need is a complete example plot/code to get past this. I THINK I’m following the documentation, but I’m not getting anywhere. I must be missing something basic. Thanks in advance.

image

⌁   Link to post
gmerritt123
gmerritt123

I gotchu

from bokeh.models import ColumnDataSource, HoverTool
from bokeh.plotting import figure, save

import pandas as pd

df=pd.DataFrame(data = {'Item':['A','B'],'x':[10,11],'y':[6,12],'Date':['Jan 1, 2018','Jan 2, 2018']})
df['Date'] = pd.to_datetime(df['Date'])

src = ColumnDataSource(df)
p = figure()

r = p.scatter(x='x',y='y',size=8,source=src)

hvr = HoverTool(renderers=[r]
                ,tooltips=[('dt','@Date{%d/%m/%Y}')] # see --> https://www.w3schools.com/python/python_datetime.asp
                ,formatters={'@Date':'datetime'})

p.add_tools(hvr)

save(p,'test.html')
⌁   Link to post

End of archived discussion · Replies are disabled