Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[BUG]: percentTotal not shown as percentage

Aperta Adatta ai principianti
#8,137 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@ORITOMI ci sta già lavorando.

Dal 21/10/2026.

  • #8139 di @ORITOMI — aperta

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
93/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript

Direzione di ricerca

Leggi src/traces/bar/plot.js, dove l’issue segnala un errore di battitura nel nome di una proprietà, e controlla la copertura di funnel in test/jasmine/tests/funnel_test.js. Esegui i test di funnel e conferma che %{percentTotal} viene visualizzato come 50%, 33% e 17% per i valori indicati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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 !

Lingua principale
JavaScript
Stelle
18.4k
Fork
2k
Merge medio
3g 2h
PR unite (30g)
15

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di plotly/plotly.js

Tutte le issue di plotly/plotly.js

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.