Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

[BUG]: percentTotal not shown as percentage

Aberta Para iniciantes
#8,137 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

@ORITOMI já está trabalhando nisso.

Desde 21/10/2026.

  • #8139 de @ORITOMI — aberto

Avaliação

Dificuldade
1/5
Tempo estimado
Menos de uma hora
Facilidade para iniciantes
93/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
javascript

Direção de pesquisa

Leia src/traces/bar/plot.js, onde a issue aponta um erro de digitação no nome de uma propriedade, e examine a cobertura de funnel em test/jasmine/tests/funnel_test.js. Execute os testes de funnel e confirme que %{percentTotal} é exibido como 50%, 33% e 17% para os valores informados.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

bug
Description

This issue is related to plotly.py#4368, which was addressed in Plotly.py 5.17.0. However, the issue is still reproducible with Plotly.py 7.1.0 and Plotly.js 4.1.2.

The root cause is a typo in src/traces/bar/plot.js. Plotly.js correctly computes percentTotal, but assigns the formatted percentage to percenTotalLabel instead of percentTotalLabel (missing "t").

As a result, funnel text templates using %{percentTotal} display the raw ratio rather than the formatted percentage.

Screenshots/Video

Before :

Image

After :

Image
Steps to reproduce
python
import plotly
import plotly.graph_objects as go

print("Plotly version:", plotly.__version__)

fig = go.Figure(
    go.Funnel(
        name="X",
        y=["A", "B", "C"],
        x=[40, 30, 20],
        textposition="inside",
        texttemplate=(
            "%{value}<br>"
            "%{percentPrevious}<br>"
            "%{percentTotal}"
        ),
    )
)

fig.show()
Solution

The issue was fixed by correcting the property name in src/traces/bar/plot.js.

A regression test was also added to test/jasmine/tests/funnel_test.js to verify that %{percentTotal} renders as 50%, 33%, and 17% for the corresponding funnel values.

Validation

The funnel test suite failed before the fix because the labels contained raw ratios.
All 63 funnel tests passed after the fix.
Linting and type checking passed.
To validate the fix locally in Plotly.py, the build issue was worked around, Plotly.js was built and packed, and the resulting local bundle was imported in Plotly.py 4.1.0.
The local test ran successfully and confirmed that the percentage labels were formatted correctly.

Notes

I'm new in contributing on open source project, any advice are welcome !

Linguagem predominante
JavaScript
Estrelas
18.4k
Forks
2k
Merge médio
3d 2h
PRs com merge (30d)
15

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de plotly/plotly.js

Todas as issues de plotly/plotly.js

Issues semelhantes

Mais issues de JavaScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.