plotly / plotly/plotly.py

Unify hovertemplate title cannot be edited.

Aperta
#4,494 1 commento 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug P3 sev-3
Lingua principale
Python
Stelle
18.8k
Fork
2.8k
Merge medio
16h 26m
PR unite (30g)
21

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Esegui la riproduzione Python fornita con plotly 5.18.0 e confronta i casi date-axis e linear-axis. Leggi l’issue correlata #4278 e le discussioni della community collegate; il lavoro è completato quando unified hover su un linear axis consente di rimuovere o personalizzare il titolo di hovertemplate senza imporre un date axis, con copertura di regressione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
numpy, pandas, python
Ambito
data-visualization
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.