[Bug] chord `lineStyle.color: 'gradient'` uses the previous layout after resize or setOption
维护者通常 1 天内回复
@yqtian-se 已经在做这个了。
开始于 2026年11月22日。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 75/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
报告者将问题追溯到 ChordEdge.updateData:其中 applyEdgeFill() 在 graphic.updateProps(el, { shape }) 之前运行,因此渐变是根据旧的 el.shape 构建的。从这里开始,检查渐变是否根据新的形状计算。使用该代码片段复现:修改一个链接值,并确认在一次 setOption 调用中渐变会随色带一起移动。当单次更新或调整大小后,渐变与新建图表一致时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- TypeScript
- 星标
- 67.8k
- 派生
- 19.9k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/echarts 的其他 Issue
-
en pending
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
en pending
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
[Bug] String formatter templates only replace the first occurrence of `{a}`/`{b}`/`{c}`可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭en pending
难度 2/5 1-3 小时 新手友好度 80/100
apache/echarts#21843 · 3 条评论 ·
维护者通常 1 天内回复
-
[Bug] Inverse axis collapses the grid with outerBoundsContain when a tick is near the axis edge可能已有人在做 @schizophrenicmaniac 于 3 天前认领。 未关闭en pending
难度 2/5 1-3 小时 新手友好度 82/100
apache/echarts#21839 · 2 条评论 ·
维护者通常 1 天内回复
-
en pending
难度 2/5 1-3 小时 新手友好度 78/100
apache/echarts#21813 · 2 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
cursor/community-plugins#583 ·
维护者通常 1 天内回复
-
A model answer with prose after its fenced JSON is rejected as NOT_JSON可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭afk-ok importer size:S
难度 2/5 1-3 小时 新手友好度 72/100
enorm-labs/event-junkie#5404 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
Wavvon/Wavvon-clients#493 ·
维护者通常 1 天内回复
-
documentation
难度 1/5 1-3 小时 新手友好度 72/100
answerLoops/answerLoops#679 ·
维护者通常 1 天内回复