apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.25k stars 19.61k forks source link

[Bug] [Series][Label] Series data point labels are not visible when chart is saved as image file #19539

Open YogeshK-Itanta opened 8 months ago

YogeshK-Itanta commented 8 months ago

Version

5.3.2

Link to Minimal Reproduction

Example

Steps to Reproduce

Current Behavior

  const canvas = createCanvas(width, height);
  const chart = echarts.init(canvas);
  chart.setOption(options);
  //options can be found in the minimal reproduction link
  const data = canvas.toBuffer('image/png');
  fs.writeFileSync(filename, data, { mode: 0o644, flag: 'w' });

I do not see labels on data points of the series. echarts-1706075060739

Expected Behavior

Chart should save the image with labels like this:

image

Environment

- OS: Windows 11 pro 22H2
- Node: 20.10.0

Any additional comments?

No response

MatthiasMert commented 8 months ago

You can use the saveAsImage feature instead.

Ovilia commented 8 months ago

Yes, please use saveAsImage. Getting the canvas is not suggested because it breaks the capsulization and may break things down.