Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

[BUG]: percentTotal not shown as percentage

Offen Anfängerfreundlich
#8,137 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

@ORITOMI arbeitet bereits daran.

Seit 21.10.2026.

  • #8139 von @ORITOMI — offen

Bewertung

Schwierigkeit
1/5
Geschätzter Aufwand
Unter einer Stunde
Anfängerfreundlichkeit
93/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
javascript

Rechercherichtung

Lies src/traces/bar/plot.js, wo der Issue auf einen Tippfehler im Eigenschaftsnamen hinweist, und prüfe die Funnel-Abdeckung in test/jasmine/tests/funnel_test.js. Führe die Funnel-Tests aus und bestätige, dass %{percentTotal} für die angegebenen Werte als 50%, 33% und 17% dargestellt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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 !

Vorherrschende Sprache
JavaScript
Sterne
18.4k
Forks
2k
Ø Merge
3 T. 2 Std.
Gemergte PRs (30 T.)
15

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus plotly/plotly.js

Alle Issues in plotly/plotly.js

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.