[Bug] chord `lineStyle.color: 'gradient'` uses the previous layout after resize or setOption
Maintainer thường phản hồi trong vòng 1 ngày
@yqtian-se đang làm issue này rồi.
Từ ngày 22/11/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 75/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ệ
- typescript
- Lĩnh vực
- data-visualization
Hướng nghiên cứu
Người báo lỗi truy ra lỗi tại ChordEdge.updateData, nơi applyEdgeFill() chạy trước graphic.updateProps(el, { shape }), nên gradient được tính từ el.shape cũ. Hãy bắt đầu từ đó và kiểm tra xem gradient có được tính từ hình dạng mới hay không. Tái hiện bằng đoạn mã mẫu: thay đổi một giá trị liên kết và xác nhận gradient di chuyển cùng dải ruy băng trong một lần gọi setOption. Hoàn thành khi gradient khớp với biểu đồ được tạo mới sau một lần cập nhật hoặc thay đổi kích thước.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version
6.1.0 (also current master 34f4d927e)
Link to Minimal Reproduction
option = {
animation: false,
series: [{
type: 'chord',
data: [{ name: 'A' }, { name: 'B' }, { name: 'C' }],
lineStyle: { color: 'gradient', opacity: 0.9 },
links: [
{ source: 'A', target: 'B', value: 40 },
{ source: 'B', target: 'C', value: 20 },
{ source: 'A', target: 'C', value: 10 }
]
}]
};
// 1 s: change the data. Ribbons get their new shape, but the gradients are computed from the old shape.
setTimeout(() => {
option.series[0].links[0].value = 2;
option.series[0].links[2].value = 60;
myChart.setOption(option);
}, 1000);
// 3 s: call setOption again with the SAME option. Nothing changes, yet the gradients jump to the correct position.
setTimeout(() => myChart.setOption(option), 3000);
Steps to Reproduce
- Create the chord chart above with
lineStyle.color: 'gradient'. - Update the data so the layout changes (resizing the chart triggers it too).
- Compare with a chart created directly with the final size or data.
- Calling
setOptionagain with the same option makes the gradients jump to the correct position.
Current Behavior
The ribbons have the new shape, but the source→target gradient is still positioned for the old shape. The colour transition is
offset from the ribbons. Each update uses the shape from one layout earlier.
Expected Behavior
The gradient follows the current ribbon shape, as in a fresh chart.
Environment
- OS: any (also reproduced with the SVG renderer in Node.js SSR)
- Browser: any
- Framework: none
Any additional comments?
Cause: in ChordEdge.updateData, for an existing element applyEdgeFill() runs before graphic.updateProps(el, { shape }).
applyEdgeFill builds the LinearGradient from el.shape, which still holds the old shape. 'source' and 'target' colours are not
affected. I can send a PR.
- Ngôn ngữ chính
- TypeScript
- Star
- 67.8k
- Fork
- 19.9k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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 apache/echarts
-
en pending
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
en pending
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] String formatter templates only replace the first occurrence of `{a}`/`{b}`/`{c}`Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởen pending
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
apache/echarts#21843 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] Inverse axis collapses the grid with outerBoundsContain when a tick is near the axis edgeCó thể đã có người làm @schizophrenicmaniac đã nhận 3 ngày trước. Đang mởen pending
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
apache/echarts#21839 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
en pending
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/echarts#21813 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/echarts
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
cursor/community-plugins#583 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
afk-ok importer size:S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
enorm-labs/event-junkie#5404 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ 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 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Wavvon/Wavvon-clients#493 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
answerLoops/answerLoops#679 ·
Maintainer thường phản hồi trong vòng 1 ngày