You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "bangbang93 (via GitHub)" <gi...@apache.org> on 2025/02/25 07:18:16 UTC
[I] [Bug] Missing line label when ssr to png [echarts]
bangbang93 opened a new issue, #20789:
URL: https://github.com/apache/echarts/issues/20789
### Version
5.5.1-5.6.0
### Link to Minimal Reproduction
https://github.com/bangbang93/echarts-png-reproduce
### Steps to Reproduce
Use the same options from the frontend, and render it to png in backend.
But the line label is missing in png, other label shows normally.
And if render to SVG, the line label shows normal.
### Current Behavior
the png

the svg

### Expected Behavior
png should as same as svg
### Environment
```markdown
- OS: Manjaro
- Browser: Not Browser
- Framework: Express
```
### Any additional comments?
_No response_
--
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: commits-unsubscribe@echarts.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] Missing line label when ssr to png [echarts]
Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #20789:
URL: https://github.com/apache/echarts/issues/20789#issuecomment-2682945131
noticed you are missing the buffer format in ```toBuffer('image/png')```.
Also add ```animation:false``` in option, it's a semi-documented **solution** to the problem, see similar #20783.
I tested with following code and it works.
```
canvas = document.createElement("canvas");
canvas.width = 640;
canvas.height = 480;
myChart = echarts.init(canvas)
myChart.setOption(option)
const dataURL = canvas.toDataURL('image/png');
// Create a temporary link element to trigger the download
const link = document.createElement('a');
link.href = dataURL;
link.download = 'canvas_image.png'; // Set the file name for the download
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
```
--
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: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] Missing line label when ssr to png [echarts]
Posted by "bangbang93 (via GitHub)" <gi...@apache.org>.
bangbang93 closed issue #20789: [Bug] Missing line label when ssr to png
URL: https://github.com/apache/echarts/issues/20789
--
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: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org