[BUG]: percentTotal not shown as percentage
Maintainer thường phản hồi trong vòng 2 ngày
Một pull request liên quan đã được merge.
- #8139 của @ORITOMI — đã merge
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 93/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
- Lĩnh vực
- data-visualization, frontend
Hướng nghiên cứu
Đọc src/traces/bar/plot.js, nơi issue chỉ ra lỗi chính tả trong tên thuộc tính, và kiểm tra độ bao phủ của funnel trong test/jasmine/tests/funnel_test.js. Chạy các bài kiểm tra funnel và xác nhận rằng %{percentTotal} hiển thị là 50%, 33% và 17% với các giá trị được nêu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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 :
After :
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 !
- Ngôn ngữ chính
- JavaScript
- Star
- 18.4k
- Fork
- 2.1k
- Merge trung bình
- 4 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 15
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của plotly/plotly.js
-
bug P3 size: 3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
plotly/plotly.js#8108 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
chore P3 plotly-internal size: 3 task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
plotly/plotly.js#8064 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
chore P1 plotly-internal size: 1 task
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
chore P3 plotly-internal size: 1 task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[mkdocs] Update link in Edit this Page buttonCó thể làm lại được @AbhinavKumar-Jha đã nhận 156 ngày trước và không có pull request nào đang mở. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
plotly/plotly.js#7648 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của plotly/plotly.js
Issue tương tự
-
[Feature]: 建议导入源后,自动切换到新导入的源Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
lyswhut/lx-music-desktop#3026 ·
-
good first issue server
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
openstreetmap/iD#13054 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community marketing priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
TMHSDigital/Free-Game-Dev-Assets#151 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Read a vector index's quantization back on Neo4j 2026.10, which reports vector.quantization.typeĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
liberation-data/drivine#231 ·
Maintainer thường phản hồi trong vòng 1 ngày