Skip to content

Plotly Express not displaying datetime #5101

Open
@Joshua-Powell-Lambda

Description

@Joshua-Powell-Lambda

the x-axis of my graph is displaying as the ns value of the timestamp, 1715000000000000000, instead of the corresponding readable timestamp.

The code is

        fig = go.Figure()
        local_df["reservation_start_week_utc"] = pd.to_datetime(local_df[
            "reservation_start_week_utc"
        ].apply(lambda x: pd.Timestamp(x).to_pydatetime()))

        fig.add_trace(
            go.Scatter(
                x=local_df["reservation_start_week_utc"],
                y=local_df["weighted_average_price"],
...

the datatype of the column that populates my x-axis is datetime64[ns, UTC]
I tried casting to different types, and also several different format settings on the plot. I couldnt get it to work. Rolling back plotly immediately fixed the bug

python versions used 3.13 and 3.10 no difference.

rolling back from plotly 6.0.1 to 5.24.1 fixed the formatting issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1needed for current cyclebugsomething brokenregressionthis used to work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions