Bar plot hover shows incorrect bar length when base is used
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Python
- Estrelas
- 18.8k
- Forks
- 2.8k
- Merge médio
- 16h 26min
- PRs com merge (30d)
- 21
Descrição
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.
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece executando a reprodução mínima de pandas e plotly.express da issue com plotly 5.23.0 e compare os campos de hover da barra renderizada com Begin, End e Duration no dataframe. O trabalho estará concluído quando as posições das barras permanecerem corretas e o hover exibir o valor esperado de duração em vez de End.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- pandas, python
- Domínio
- data-visualization
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Claramente especificada
- Facilidade para iniciantes
- 45/100