Add_annotation only shows at x=0 on a datetime64 x-axis

After researching, I see I need to convert datetime64 to Timestamp. The chart xaxis must be doing that automatically. So I resolved this issue by calling pandas to_datetime for my x value in add_annotation…

import pandas as pd
fig.add_annotation(x=pd.to_datetime(mark_time),
                              y=mark_price,
                              text=label1,
                              showarrow=True,
                              arrowhead=1)
1 Like