[BUG]: `hoverlabel.align` is ignored in `hovermode: "x unified"`
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 78/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- javascript
- Domínio
- data-visualization
Direção de pesquisa
Comece reproduzindo o exemplo de unified-hoverlabel fornecido e, em seguida, inspecione src/components/legend/draw.js por volta da linha 587, onde o issue relata que o alinhamento está fixado em 'start'. Considera-se concluído quando hoverlabel.align é respeitado para os hover labels unificados de x e y, preservando o comportamento existente.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Instructions (remove this section before submitting report)
Thanks for your interest in plotly.js!
- Before submitting a new bug report, please search for existing and closed issues. If your bug is not addressed yet, fill out the sections below and submit a new issue.
- Issues found on the example pages from https://plotly.com/javascript/ should be filed in our documentation repo with the exception of https://plotly.com/javascript/reference which should be filed here.
- Implementation questions ("How do I do ...?") should be asked on our Community Forum or on Stack Overflow (tagged 'plotly').
- Comments should add content to the discussions. Approbation comments such as +1 or I would like this feature to be implemented as well will be deleted by the maintainers. Please use GitHub reactions instead.
Description
Add a clear description of the issue that you're having.
layout.hoverlabel.align (and trace-level hoverlabel.align) has no effect when hovermode is 'x unified' or 'y unified'. Row text in the unified label is always left-aligned.
Reported on the forum: https://community.plotly.com/t/hoverlabel-align-right-is-not-honored-in-hovermode-x-unified/97717
Repro
import plotly.graph_objects as go
people = ["Person A", "Person B", "Person C"]
fig = go.Figure()
for name, values in {
"Series 1": [3944, 2810, 1675],
"Series 2": [-266, -1020, -85],
"Series 3": [-44, -310, -7],
"Series 4": [-43, -5, -390],
}.items():
fig.add_trace(go.Bar(x=people, y=values, name=name, hovertemplate="%{y:,.0f} €<extra></extra>"))
# --- secondary-axis line: delete this block to test without it ---
fig.add_trace(go.Scatter(
x=people, y=[0.91, 0.62, 0.785], name="Ratio",
mode="lines+markers", yaxis="y2", line=dict(color="black"),
hovertemplate="%{y:.1%}<extra></extra>",
))
fig.update_layout(yaxis2=dict(overlaying="y", side="right", tickformat=".0%"))
# --- end ---
fig.update_layout(
barmode="relative",
separators=". ",
hovermode="x unified",
hoverlabel=dict(align="right"),
# Same with
# hoverlabel_align="right",
)
fig.show()
Expected: values right-aligned within the unified label.
Actual: left-aligned.
Screenshots/Video
Add screenshots or a video of the issue.
Steps to reproduce
Reports must include steps to reproduce the issue. Alternatively, you can use codepen, jsfiddle or jsbin to share your example. Please use the latest (un-minified) version of plotly.js in your report unless not applicable.
- Go to '...'
- Click on X
- Note the issue with Y
Notes
Add info here that doesn't fit in the other sections.
This does appear to be a bug in plotly.js. The label is hardcoded to use 'start'.
It seems to lead to a 9 year old code (standardize on attr over style for text-anchor · plotly/plotly.js@3ad11f6 · GitHub).
- Linguagem predominante
- JavaScript
- Estrelas
- 18.4k
- Forks
- 2k
- Merge médio
- 1d 21h
- PRs com merge (30d)
- 18
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o 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.
Mais de plotly/plotly.js
-
chore P3 plotly-internal size: 3 task
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
plotly/plotly.js#8064 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
chore P1 plotly-internal size: 1 task
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
chore P3 plotly-internal size: 1 task
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
plotly/plotly.js#7648 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
bug infrastructure P2
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 65/100
Mantenedores costumam responder em até 1 dia
Todas as issues de plotly/plotly.js
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
type/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
Mantenedores costumam responder em até 1 dia
-
Edit: RTE News LogoAbertacheck:failed logos:edit
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
iptv-org/database#36354 · 1 comentário ·
Mantenedores costumam responder em até 4 dias
-
status:untriaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
midnightntwrk/midnight-wallet#791 ·
Mantenedores costumam responder em até 1 dia