Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider showing UTC offset in tooltip for datetimes #4844

Open
MarcoGorelli opened this issue Nov 1, 2024 · 0 comments
Open

Consider showing UTC offset in tooltip for datetimes #4844

MarcoGorelli opened this issue Nov 1, 2024 · 0 comments
Labels
feature something new P2 considered for next cycle

Comments

@MarcoGorelli
Copy link
Contributor

Say I have

import pandas as pd
dfa = pd.DataFrame(
    {
        "datetime": ["2020-10-25T01:30"] * 2,
        "price": [40, 50],
    }
)
dfa['datetime'] = pd.to_datetime(dfa['datetime']).dt.tz_localize('Europe/London', ambiguous=[True, False])
dfa
                   datetime  price
0 2020-10-25 01:30:00+01:00     40
1 2020-10-25 01:30:00+00:00     50

and I plot

px.scatter(dfa, x="datetime", y="price")

then I get

Image

Notice how the two points are stacked one on top of each other, even though they are actually 1 hour apart

If Plotly's design decision for time zones is to display the local datetime, then I think this makes perfect sense, nice one 👍 However, I think the tooltip should give enough information to distinguish the two points, whereas currently, they both show:

datetime=Oct 25, 2020, 01:30

I would expect the bottom one to show datetime=Oct 25, 2020, 01:30 +01:00 and the top one to show datetime=Oct 25, 2020, 01:30 +00:00

@gvwilson gvwilson added feature something new P2 considered for next cycle labels Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new P2 considered for next cycle
Projects
None yet
Development

No branches or pull requests

2 participants