Export to png ; Export to html/png requires explicit range specified for dates (pd.DateTimeIndex)
@ayjayt がすでに取り組んでいます。
2025年8月26日 から。
評価
この issue はまだ評価されていません。
説明
kaleido==1.0.0
plotly==6.3.0
The Scatter plot below using pandas dates look fine on the Notebook, but
- When exporting to html and png, the range needs to be set explicitly
range=[dates.min(), dates.max()]. Otherwise the default starts from Jan 2000. - For png export, after the explicit fix above, the x-axis range is corrected, but the line disappeared.
There's a workaround which is to convert the dates to str for the x data values first x=dates.strftime("%Y-%m-%d") but this is a gotcha.
# Sample time series data
dates = pd.date_range(start="2024-01-01", periods=30, freq="D")
values = [20 + i + (i % 7) * 3 for i in range(30)] # Trending data with weekly pattern
# Create line chart with Graph Objects
fig = go.Figure()
fig.add_trace(
go.Scatter(
x=dates, # Plotly handles pandas DatetimeIndex directly
y=values,
mode="lines+markers",
name="Daily Values",
line=dict(color="blue", width=2),
marker=dict(size=4),
)
)
# Update layout with explicit date range
fig.update_layout(
title="Basic Line Chart - Graph Objects API",
xaxis_title="Date",
yaxis_title="Value",
width=800,
height=600,
showlegend=True,
xaxis=dict(
type="date",
# Explicitly set the date range for html and image export
range=[dates.min(), dates.max()]
),
)
# Save as HTML and PNG
fig.write_html(data_dir / "01_basic_line.html")
fig.write_image(data_dir / "01_basic_line.png")
- 主要言語
- Python
- スター
- 504
- フォーク
- 65
- 平均マージ
- 6日 9時間
- マージ済み PR(30日)
- 2
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
plotly/kaleido のほかの issue
-
Writing to an existing directory whose name has a dot fails with "Invalid format"対応中かも @RaphaelFakhri が 13 日前に担当しました。 オープンbug P3 size: 1
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
-
Deterministic Rendering Challenges再び着手できるかも @camdecoster が 67 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンenhancement feature P2 size: 5
-
[FEATURE]: Embed custom fonts into vector exports (no system install)対応中かも @camdecoster が 124 日前に担当しました。 オープンenhancement P3 size: 3
-
enhancement feature P3 size: 5
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
GlobalKaleidoServer is not thread-safe対応中かも @talleibman が 250 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
似ている issue
-
area:cli bug difficulty:1
難易度 1/5 1〜3時間 初心者へのやさしさ 87/100
MakazhanAlpamys/Soup#2491 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
microsoft/onnxscript#3155 ·
メンテナーはふだん 4 日以内に返信
-
IFEval nth-paragraph checker reads the wrong paragraph when a blank separator is present対応中かも @chetana1410 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
EleutherAI/lm-evaluation-harness#4530 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
sv_SE vat_id() has 14 digits: the "16" organisation number prefix is kept対応中かも @kevin9327 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 19 日以内に返信