I am new to Python and Bokeh. I have a pandas dataframe which contains Events. I am using Bokeh charts to Visualize events. EventTime is displayed on the x-axis and EventName is projected on the y-axis. The visualization is rendered as expected. I am then trying to add a Span(annotation) on the x-axis(with height dimension) to show when the last event occurred(Max of EventTime). The Span is not displayed where it is expected. Please advise.
Thank you for trying
Code Snippet:
source = ColumnDataSource(data=dict(
x = events_to_analyse.EventTime,
y = events_to_analyse.EventName
))
span_last_udapted = time.mktime(datetime(d_last_updated.year, d_last_updated.month, d_last_updated.day, d_last_updated.hour, d_last_updated.minute, 0).timetuple())*1000
v_span_last_udapted = Span(location=span_last_udapted, dimension='height', line_color='orange', line_width=2)
p = figure(x_axis_type='datetime', y_range=list(set(source.data['y'])), plot_width=1500, plot_height=7000)
p.circle('x', 'y', size=10, line_color='w', fill_color='z', line_width=2, source=source)
p.add_layout(v_span_last_udapted)
show(p)
Note: here d_last_updated = max(EventTime)