plotly / plotly/plotly.py

Unify hovertemplate title cannot be edited.

オープン
#4,494 コメント 1 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug P3 sev-3
主要言語
Python
スター
18.8k
フォーク
2.8k
平均マージ
16時間 26分
マージ済み PR(30日)
21

説明

Hello

It seems that we cannot modify the title of the hovertemplate when the chart uses a unify hovermode whenever the axis has not a date type.

Here a short example with 2 scatter plots, the first one with a date axis and the second is linear:

import numpy as np
import pandas as pd
from plotly.subplots import make_subplots

dates = pd.date_range("2022-01-01", "2022-03-01")
values = np.random.randint(0, 10, len(dates))

fig = make_subplots(cols=2) 
fig.add_scatter(x=dates, y=values, row=1, col=1)
fig.add_scatter(x=values, y=values, mode="markers", row=1, col=2)

fig.update_traces(hovertemplate="%{y}<extra></extra>")
fig.update_xaxes(row=1, col=1, hoverformat=" ")
fig.update_xaxes(row=1, col=2, type="linear", hoverformat=" ")
fig.update_layout(hovermode="x unified")

fig.show()

image

If you force the second scatter to be a date type, the hovertemplate title is removed with the workaround hoverformat=" ". However, it only works for date axis.

Here some references/related issues:
https://github.com/plotly/plotly.py/issues/4278
https://community.plotly.com/t/customizing-text-on-x-unified-hovering/39440/18
https://community.plotly.com/t/pass-nothing-or-disable-x-axis-hoverformat/67496

plotly version = 5.18.0

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

提供された Python の再現コードを plotly 5.18.0 で実行し、date-axis のケースと linear-axis のケースを比較する。関連する issue #4278 とリンクされたコミュニティの議論を読む。完了の条件は、linear axis 上の unified hover で、date axis を強制せずに hovertemplate のタイトルを削除またはカスタマイズでき、回帰テストでカバーされていること。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
numpy, pandas, python
領域
data-visualization
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。