DaZuiZui commented on issue #21700: URL: https://github.com/apache/echarts/issues/21700#issuecomment-5043256366
I traced this to the canvas export path. The CodePen loads ECharts 6.1.0 and echarts-gl 2.1.0. In zrender 6.1.0, `CanvasPainter.getRenderedCanvas` has two relevant branches: - When `opts.pixelRatio <= this.dpr`, it composites every painter layer and invokes `renderToCanvas` for non-builtin layers. - When `opts.pixelRatio > this.dpr`, it repaints only the zrender storage display list through `brush(...)`. `LayerGL` is a custom/non-builtin layer and is not part of that display list, so the exported image keeps 2D components such as `visualMap` but omits the WebGL content. Therefore, the exact trigger is `pixelRatio > chart.getDevicePixelRatio()`, rather than necessarily every value greater than 1. echarts-gl 2.1.0 removed its previous `getRenderedCanvas` override because native zrender export was expected to handle non-builtin layers. That is true for the first branch, but not for the high-pixel-ratio branch. Proposed fix direction: 1. Make the high-pixel-ratio export path include non-builtin layers through their `renderToCanvas` hook. 2. Preserve z-level ordering between custom layers and built-in displayables while composing the export. 3. Add a regression test with a custom layer, painter DPR 1, and export pixel ratio 2, verifying that the custom layer is included. A GL-only workaround could reintroduce export integration in echarts-gl, but fixing zrender is more general because the current behavior affects any custom painter layer. I will prepare a zrender patch and link the PR here. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
