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 2020/08/18 03:20:01 UTC

[GitHub] [incubator-echarts] qiaoxiayu opened a new issue #13143: 导出图片 backgroundColor只有为颜色时才能正常导出

qiaoxiayu opened a new issue #13143:
URL: https://github.com/apache/incubator-echarts/issues/13143


   Version
   ^4.8.0
   
   Steps to reproduce
   配置如下
   var img = new Image(); //新建对象
   img.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAA2CAYAAADUOvnEAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA5tJREFUeNrcWE1oE0EUnp0kbWyUpCiNYEpCFSpIMdpLRTD15s2ePHixnj00N4/GoyfTg2fbiwdvvagHC1UQ66GQUIQKKgn1UAqSSFua38b3prPJZDs7s5ufKn0w7CaZ2W/fe9/73kyMRqNB3Nrj1zdn4RJ6du9T2u1a2iHYSxjP4d41oOHGQwAIwSUHIyh8/RA8XeiXh0kLGFoaXiTecw/hoTG4ZCSAaFkY0+BpsZceLtiAoV2FkepZSDk5EpppczBvpuuQCqx0YnkYcVVoqQYMyeCG+lFdaGkXeVOFNu4aEBalOBk6sbQrQF7gSdK5JXjuHXuYVIVyr0TZ0FjKDeCs6km7JYMUdrWAUVmZUBtmRnVPK+x6nIR2xomH06R35ggwJPeofWphr/W5UjPIxq8B2bKgE8C4HVHWvg+2gZjXj19PkdFztY7bk9TDCH/g6oafDPpaoMvZIRI5WyMB/0Hv++HkpTKE0kM+A+h20cPAfN4GuRyp9G+LMTW+z8rCLI8b46XO9zRcYZTde/j0AZm8WGb3Y2F9KLlE2nqYkjFLJAsDOl/lea0q55mqxXcL7YBc++bsCPMe8mUyU2ZIpnCoblca6TZA/ga2Co8PGg7UGUlEDd0ueptglbrRZLLE7poti6pCaWUo2pu1oaYI1CF9b9cCZPO3F8ikJQ/rPpQT5YETht26ss+uCIL2Y8vHwJGpA96GI5mjOlaKhowUy6BcNcgIhDviTGWCGFaqEuufWz4pgcbCh+w0gEOyOjTlTtYYlIWPYWKEsLDzOs+nhzaO1KEpd+MXpOoTUgKiNyhdy5aSMPNVqxtSsJFgza5EWA4zKt
 CJ2OGbLn0JSLu8+SL4G86p1Fpr7ABXdGFF/UTD4rfmFYFw4G9VAJ9SM3aF8l3yok4/J6IV9sDVb36ynmtJ2M5+CwxTYBdKNMBaocKGV2nYgkz6r+cHBP30MzAfi4Sy+BebSoPIOi8PW1PpCCvr/KOD4k9Zu0WSH0Y0+SxJ2awp/nlwKtcGyHOJ8vNHtRJzhPlsHr8MogtlVtwUU0tSM1x58upSKbfJnSKUR07GVMKkDNfXpzpv0RTHy3nZMVx5IOWdZIaPabGFvfpwpjnvfmJHXLaEvZUTseu/TeLc+xgAPhEAb/PbjO6PBaOTf6LQRh/dERde23zxLtOXbaKNhfq2L/1fAOPHDUhOpIf5485h7l+GNHHiSYPKE3Myz9sFxoJuAyazvwIMAItferha5LTqAAAAAElFTkSuQmCC';
   
   //图片的地址
   option = {
   backgroundColor: {
   // type: 'pattern',
   repeat: 'no-repeat',
   image: img, // 赋值
   },
   title: {
   // text: ‘Awesome Chart’
   },
   xAxis: {
   data: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
   },
   yAxis: {},
   series: [{
   type: 'line',
   data: [220, 182, 191, 234, 290, 330, 310]
   }],
   
   };
   
   echartsInstance. getDataURL Function
   (opts: {
       // 导出的格式,可选 png, jpeg
       type?: string,
       // 导出的图片分辨率比例,默认为 1。
       pixelRatio?: number,
       // 导出的图片背景色,默认使用 option 里的 backgroundColor
       backgroundColor?: string,
       // 忽略组件的列表,例如要忽略 toolbox 就是 ['toolbox']
       excludeComponents?: Array.<string>
   }) => string
   
   What is expected?
   希望options中的backgroundColor为图片或者是渐变色时 可以正常导出图片
   
   What is actually happening?
   options中的backgroundColor为图片或者是渐变色时 不可以正常导出图片
   


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

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] [incubator-echarts] plainheart edited a comment on issue #13143: 导出图片 backgroundColor只有为颜色时才能正常导出

Posted by GitBox <gi...@apache.org>.
plainheart edited a comment on issue #13143:
URL: https://github.com/apache/incubator-echarts/issues/13143#issuecomment-675296458


   没有复现。https://codepen.io/plainheart/pen/YzqWvZw
   提示:如果是图片,应当在其加载完成后再去导出。


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

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] [incubator-echarts] qiaoxiayu commented on issue #13143: 导出图片 backgroundColor只有为颜色时才能正常导出

Posted by GitBox <gi...@apache.org>.
qiaoxiayu commented on issue #13143:
URL: https://github.com/apache/incubator-echarts/issues/13143#issuecomment-675278923


   > 是有什么报错吗?我试了下可以导出。
   
   导出是可以导  如果backgroundColor是图片或者是渐变色的时候  没有背景图


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

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] [incubator-echarts] qiaoxiayu commented on issue #13143: 导出图片 backgroundColor只有为颜色时才能正常导出

Posted by GitBox <gi...@apache.org>.
qiaoxiayu commented on issue #13143:
URL: https://github.com/apache/incubator-echarts/issues/13143#issuecomment-675229736


   echartsInstance. getDataURL Function
   (opts: {
   // 导出的格式,可选 png, jpeg
   type?: string,
   // 导出的图片分辨率比例,默认为 1。
   pixelRatio?: number,
   // 导出的图片背景色,默认使用 option 里的 backgroundColor
   backgroundColor?: string,
   // 忽略组件的列表,例如要忽略 toolbox 就是 ['toolbox']
   excludeComponents?: Array.
   }) => string
   
   在这个方法中  backgroundColor 重新赋值也不行


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

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] [incubator-echarts] echarts-bot[bot] commented on issue #13143: 导出图片 backgroundColor只有为颜色时才能正常导出

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


   This issue is not created using [issue template](https://ecomfe.github.io/echarts-issue-helper/) so I'm going to close it. 🙊
   Sorry for this, but it helps save our maintainers' time so that more developers get helped.
   Feel free to create another issue using the issue template.
   
   If you think you have already made your point clear without the template, or your problem cannot be covered by it, you may re-open this issue again.
   
   这个 issue 未使用 [issue 模板](https://ecomfe.github.io/echarts-issue-helper/?lang=zh-cn) 创建,所以我将关闭此 issue。
   为此带来的麻烦我深表歉意,但是请理解这是为了节约社区维护者的时间,以更高效地服务社区的开发者群体。
   如果您愿意,可以请使用 issue 模板重新创建 issue。
   
   如果你认为虽然没有使用模板,但你已经提供了复现问题的充分描述,或者你的问题无法使用模板表达,也可以重新 open 这个 issue。


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

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] [incubator-echarts] plainheart commented on issue #13143: 导出图片 backgroundColor只有为颜色时才能正常导出

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #13143:
URL: https://github.com/apache/incubator-echarts/issues/13143#issuecomment-675296458


   没有复现。https://codepen.io/plainheart/pen/YzqWvZw


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

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] [incubator-echarts] plainheart commented on issue #13143: 导出图片 backgroundColor只有为颜色时才能正常导出

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #13143:
URL: https://github.com/apache/incubator-echarts/issues/13143#issuecomment-675273725


   是有什么报错吗?我试了下可以导出。


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

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