Bar plot hover shows incorrect bar length when base is used
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
Hello,
I tried making something like a Gantt chart and use the Bar plot type for that. It seems the hover effect is mixing up the columns somehow. Here is a minimal reproduction:
import pandas as pd
import plotly.express as px
gantt = []
gantt.append(dict(Begin=0, End=1, Word='Foo'))
gantt.append(dict(Begin=2, End=5, Word='Bar'))
gantt_df = pd.DataFrame(gantt)
gantt_df['Duration'] = (gantt_df['End'] - gantt_df['Begin'])
fig = px.bar(gantt_df, base="Begin", y="Duration", x="Word")
fig.show()
Here is the result:
Things of note:
- The position and size of the bars is correct
- The "Begin" annotation in the hover is correct
- The "Duration" annotation shows the value of the "End" column, which is not correct. I would expect "End=5" or "Duration=3" but not "Duration=5"
Examining the pandas dataframe itself shows that the data itself is correct:
This is my version according to conda:
plotly 5.23.0 pyhd8ed1ab_0 conda-forge
Thank you for providing this great library for free and I hope that you find my report helpful.
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
Comience ejecutando la reproducción mínima de pandas y plotly.express del issue con plotly 5.23.0 y compare los campos de hover de la barra renderizada con Begin, End y Duration en el dataframe. El trabajo estará terminado cuando las posiciones de las barras sigan siendo correctas y el hover muestre el valor de duración esperado en lugar de End.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- pandas, python
- Área
- data-visualization
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 45/100