[Bug] saveAsImage with pixelRatio > 1 renders 3D / echarts-gl components blank

未关闭
#21,700 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
typescript

调研方向

从链接的 CodePen 复现开始,跟踪 pixelRatio 大于 1 时的 toolbox.feature.saveAsImage 和 chart.getDataURL。检查 echarts-gl 的 WebGL 离屏渲染以及 framebuffer 调整大小路径。完成的标准是:line3D、surface 和 bar3D 的导出包含更高分辨率的 3D 内容,同时 2D 元素保持正确。

由索引模型根据 Issue 内容生成。

描述

bug en gl pending regression
Version

6.1.0

Link to Minimal Reproduction

https://codepen.io/Danish-Munib/pen/raWzBYG

Steps to Reproduce
  1. Create a 3D chart using echarts-gl (e.g., line3D, surface, or bar3D).
  2. Add the toolbox.feature.saveAsImage configuration.
  3. Set pixelRatio in saveAsImage to a value greater than 1 (e.g., pixelRatio: 2).
  4. Trigger saveAsImage via the toolbox button or programmatically using chart.getDataURL().
Current Behavior

When pixelRatio is set to 1, the exported image renders correctly.

However, setting pixelRatio > 1 results in an exported image where the WebGL viewport/3D canvas content is entirely blank. Only 2d elements (such as the visualMap legend) are rendered.

Image Image
Expected Behavior

The exported image should render the complete 3D chart at high resolution corresponding to the specified pixelRatio.

Environment
- OS: Windows 10 Pro 22H2
- Browser: Brave 1.92.140 (Official Build)
- Framework: Vanilla JS
Any additional comments?

The issue appears to stem from how WebGL framebuffers handle resizing during off-screen rendering when target pixel ratios are increased.

主要语言
TypeScript
星标
67.7k
派生
19.9k
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/echarts 的其他 Issue

查看 apache/echarts 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。