Histogram should not prepend any text to axis and hover labels (e.g. "sum of ...")
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 18.8k
- Forks
- 2.8k
- Merge medio
- 16 h 26 min
- PR fusionados (30 d)
- 21
Descripción
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.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Empieza con el ejemplo de px.histogram y su argumento labels; después, sigue cómo se generan las etiquetas de los ejes y las etiquetas al pasar el cursor del histograma. Verifica que las etiquetas de dimensión localizadas, como «minutos totales», se muestren en ambos lugares sin una frase de agregación antepuesta automáticamente.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- data-visualization
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100