Histogram should not prepend any text to axis and hover labels (e.g. "sum of ...")
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 18.8k
- Fork
- 2.8k
- Merge medio
- 16h 26m
- PR unite (30g)
- 21
Descrizione
Split from #2876
We need to localize all texts in our project. So, we can't rely on auto-generated, English labels such as "sum of" or "probability."
Issue
The following code produces the correct chart. However, the auto-generated phrase "sum of" appears in the axis label and hover text.
px.histogram(
chart_data,
x="role_name",
y="total_minutes",
color="work_type",
labels={
# notice here the use of _("") localization function
"role_name": _("Caregiver role"),
"total_minutes": _("total minutes"),
"work_type": _("Type of work"),
},
)


Expected outcome
The desired output would be that the y-axis label and hover text would be "total minutes" rather than "sum of total minutes," the latter of which we cannot localize. Specifically, when labels are defined for chart dimensions, the aggregation type ("sum of" in this case) should not be prepended to the text, since the content and data language may not be English.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con l’esempio px.histogram e il suo argomento labels, quindi traccia come vengono generate l’asse dell’istogramma e le etichette al passaggio del mouse. Verifica che le etichette di dimensione localizzate, come «minuti totali», vengano visualizzate in entrambi i punti senza una frase di aggregazione anteposta automaticamente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- data-visualization
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100