You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/09/06 09:02:12 UTC

[GitHub] [echarts] Cyberhan123 opened a new issue, #17623: [Bug] echarts 在node:16.17.0 docker 镜像下通过node canvas生成图片背景颜色出错

Cyberhan123 opened a new issue, #17623:
URL: https://github.com/apache/echarts/issues/17623

   ### Version
   
   5.3.3
   
   ### Link to Minimal Reproduction
   
   _No response_
   
   ### Steps to Reproduce
   
   镜像需要安装字体
   
   ```bash
   RUN apt-get -y update \
   && apt-get -y install ttf-wqy-zenhei fonts-wqy-microhei
   ```
   下面是复现demo
   ```js
   var echarts = require('echarts');
   const { createCanvas } = require('canvas');
   
   const canvas = createCanvas(800, 600);
   // ECharts 可以直接使用 node-canvas 创建的 Canvas 实例作为容器
   const chart = echarts.init(canvas);
   
   // 像正常使用一样 setOption
   chart.setOption({
     title: {
       show: true,
       text: '复现测试,这里会变成黑色的背景',
       left: 'center',
       top: 'center',
       fontSize: 30,
     },
     tooltip: {
       trigger: 'item',
     },
     legend: {
       width: 30,
       icon: 'circle',
     },
     series: [
       {
         // name: 'Access From',
         type: 'pie',
         radius: ['40%', '70%'],
         label: {
           show: false,
         },
         labelLine: {
           show: false,
         },
         data: [],
       },
     ],
   });
   
   // 通过 Response 输出 PNG 图片
   res.writeHead(200, {
     'Content-Type': 'image/png'
   });
   res.write(renderChart().toBuffer('image/png'));
   res.end();
   
   ### Current Behavior
   
   echatrs 默认背景为透明,但是实际生成的背景却变成黑色
   
   ### Expected Behavior
   
   期待生成的背景为透明的背景
   
   ### Environment
   
   ```markdown
   - OS: node:16.17.0
   - Browser: node- canvas
   - Framework:
   ```
   
   
   ### 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


[GitHub] [echarts] Cyberhan123 commented on issue #17623: [Bug] echarts 在node:16.17.0 docker 镜像下通过node canvas生成图片背景颜色出错

Posted by GitBox <gi...@apache.org>.
Cyberhan123 commented on issue #17623:
URL: https://github.com/apache/echarts/issues/17623#issuecomment-1326186698

   > Have u solved this problem? I have the same problem:(
   
   需要设置颜色为白色


-- 
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


[GitHub] [echarts] fufuuuu commented on issue #17623: [Bug] echarts 在node:16.17.0 docker 镜像下通过node canvas生成图片背景颜色出错

Posted by GitBox <gi...@apache.org>.
fufuuuu commented on issue #17623:
URL: https://github.com/apache/echarts/issues/17623#issuecomment-1326025409

   Have u solved this problem? I have the same problem:(


-- 
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


[GitHub] [echarts] echarts-bot[bot] commented on issue #17623: [Bug] echarts 在node:16.17.0 docker 镜像下通过node canvas生成图片背景颜色出错

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #17623:
URL: https://github.com/apache/echarts/issues/17623#issuecomment-1237866698

   @Cyberhan123 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
   <details><summary><b>TRANSLATED</b></summary><br>
   
   **TITLE**
   
   [Bug] Echarts generated an error in the background color of the image through node canvas under node:16.17.0 docker image
   
   **BODY**
   
   ### Version
   
   5.3.3
   
   ### Link to Minimal Reproduction
   
   _No response_
   
   ### Steps to Reproduce
   
   Mirroring requires fonts to be installed
   
   ```bash
   RUN apt-get -y update \
   && apt-get -y install ttf-wqy-zenhei fonts-wqy-microhei
   ````
   The following is the reproduction demo
   ````js
   var echarts = require('echarts');
   const { createCanvas } = require('canvas');
   
   const canvas = createCanvas(800, 600);
   // ECharts can directly use the Canvas instance created by node-canvas as a container
   const chart = echarts.init(canvas);
   
   // as normal use setOption
   chart.setOption({
     title: {
       show: true,
       text: 'Reproduce the test, this will become a black background',
       left: 'center',
       top: 'center',
       fontSize: 30,
     },
     tooltip: {
       trigger: 'item',
     },
     legend: {
       width: 30,
       icon: 'circle',
     },
     series: [
       {
         // name: 'Access From',
         type: 'pie',
         radius: ['40%', '70%'],
         label: {
           show: false,
         },
         labelLine: {
           show: false,
         },
         data: [],
       },
     ],
   });
   
   // Output PNG image through Response
   res.writeHead(200, {
     'Content-Type': 'image/png'
   });
   res.write(renderChart().toBuffer('image/png'));
   res.end();
   
   ### Current Behavior
   
   The default background of echatrs is transparent, but the actual generated background turns black
   
   ### Expected Behavior
   
   Expect the generated background to be a transparent background
   
   ### Environment
   
   ````markdown
   - OS: node:16.17.0
   - Browser: node-canvas
   - Framework:
   ````
   
   
   ### Any additional comments?
   
   _No response_
   </details>


-- 
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