Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[BUG]: percentTotal not shown as percentage

Closed Beginner friendly
#8,137 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

A pull request for this has already been merged.

  • #8139 by @ORITOMI — merged

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
93/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript

Research direction

Read src/traces/bar/plot.js, where the issue identifies a property-name typo, and inspect the funnel coverage in test/jasmine/tests/funnel_test.js. Run the funnel tests and confirm that %{percentTotal} renders as 50%, 33%, and 17% for the reported values.

Written by the indexing model from the issue text.

Description

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 !

Dominant language
JavaScript
Stars
18.4k
Forks
2.1k
Avg merge
4d 15h
Merged PRs (30d)
16

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from plotly/plotly.js

All issues in plotly/plotly.js

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.