Skip to content

Gantt chart export with kaleido v1.0.0 shows 1970 epoch #392

Open

Description

@jishnukoliyadan

Problem Description

I'm reporting a bug with the new kaleido v1.0.0 engine, when I make a Gantt chart with plotly.express.timeline. The issue is how it handles my datetime objects (and with sting date) when I try to save a static image.

I found the problem in a couple of ways:

  1. When I run fig.show() in my Jupyter Notebook, the chart looks perfect with the right 2025 dates. But when I save that same figure with fig.write_image(), I get a broken image. Its x-axis starts at 1970.
  2. I get the exact same broken image with 1970 dates when I run my code as a normal Python script.

It really makes me think this is a regression bug in the kaleido v1.0.0 renderer.

Minimal Reproducible Example

This script will always create the error. The /// script part is there for anyone using a tool like Astral's uv.

# /// script
# requires-python = "==3.13.1"
# dependencies = [
#     "pandas==2.3.1",
#     "plotly==6.3.0",
#     "kaleido==1.0.0",
# ]
# ///

import pandas as pd
import plotly.express as px

data: list[dict] = [
    dict(Start="2025-08-16", Finish="2025-08-30", Task="Data Collection"),
    dict(Start="2025-08-25", Finish="2025-09-15", Task="Identifying Problem"),
    dict(Start="2025-09-13", Finish="2025-09-30", Task="Review & Submission"),
]

df: pd.DataFrame = pd.DataFrame(data)
df.Start = pd.to_datetime(df.Start)
df.Finish = pd.to_datetime(df.Finish)

fig = px.timeline(df, x_start="Start", x_end="Finish", y="Task", color="Task")
fig.update_layout(template="presentation")
fig.update_layout(autosize=False, width=1000, height=300, margin=dict(l=270, r=10))

fig.update_layout(
    showlegend=False,
    title="Gantt Chart",
    bargap=0.45,
)

# This makes the wrong image
fig.write_image("Gantt_Chart.png")

Expected Behavior

I expected my saved file Gantt_Chart.png to show a chart with an x-axis properly showing dates in August and September 2025.

Image

Actual Behavior

What I actually got in Gantt_Chart.png was a chart where the x-axis starts near January 5, 1970.

Image

Working Environment Confirmation

I ran a control test to be sure. I tested my same code in an environment with older libraries:

  • plotly==6.0.0
  • kaleido==0.2.1

In that setup, the bug is gone. My list of confirmations show that the static image Gantt_Chart.png saves perfect with the right 2025 dates.

Image

This points me to think the problem is a regression in the newer code.

Failing Environment

  • Python: 3.13.1
  • pandas: 2.3.1
  • plotly: 6.3.0
  • kaleido: 1.0.0

Activity

  1. added
    bugsomething broken
    P2needed for current cycle
    on Aug 22, 2025
  2. jishnukoliyadan commented on Sep 23, 2025

    @jishnukoliyadan
    Author

    Issue still persist with below version details.

    /// script
    requires-python = "==3.13.2"
    dependencies = [
        "pandas==2.3.2",
        "plotly==6.3.0",
        "kaleido==1.1.0",
    ]
    ///
  3. lapanquecita commented on Sep 28, 2025

    @lapanquecita

    I am having a similar issue with DateTime values.

    My setup is:

    • Plotly==6.3.0 (from GitHub)
    • Kaleido==1.1.0
    • Pandas==2.3.2
    import pandas as pd
    import plotly.graph_objects as go
    
    df = pd.DataFrame(
        {
            "d": pd.to_datetime(["2025-07-01", "2025-08-01", "2025-09-01"]),
            "v": [1, 2, 3],
        }
    )
    
    
    fig = go.Figure()
    
    fig.add_trace(go.Scatter(x=df["d"], y=df["v"]))
    
    fig.write_image("test.png")

    This is the resulting figure:

    Image

    As you can notice in the x-axis, the dates are not correctly interpreted.

    This used to work fine pre Kaleido 1.0

  4. niklasvm commented on Oct 8, 2025

    @niklasvm

    I am also experiencing this issue with creating a timeline chart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2needed for current cyclebugsomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions