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 2021/11/23 08:11:41 UTC

[GitHub] [echarts] msbasanth opened a new issue #16098: Programmatically exporting SVG rendered chart to PDF

msbasanth opened a new issue #16098:
URL: https://github.com/apache/echarts/issues/16098


   ### What problem does this feature solve?
   Now the SVG export feature is limited to toolbox and we have to follow below steps to get SVG from chart instance.
   
   1. Use 'svg' as renderer when init ECharts;
   2. Add saveAsImage in toolbox;
   3. Click download in toolbox and will download the SVG chart.
   
   Many times we need to embed the charts inside our PDF's which is not possible now as we don't have a SVG export API in place.
   
   ### What does the proposed API look like?
   echartsInstance. getDataURL currently supports only PNG or JPEG we should extend it to support SVG when the chart is rendered using SVG.
   
   https://echarts.apache.org/en/api.html#echartsInstance.getDataURL
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


-- 
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] pissang edited a comment on issue #16098: Programmatically exporting SVG rendered chart to PDF

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on issue #16098:
URL: https://github.com/apache/echarts/issues/16098#issuecomment-977891907


   We have new `renderToSVGString` method for server-sider rendering in our next release. I think it will be the best choice in this scene. See the related PR https://github.com/apache/echarts/pull/15880#issue-1026012150
   
   Before that, decoding the base64 format is the only way if you wan't to get the HTML string


-- 
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] msbasanth commented on issue #16098: Programmatically exporting SVG rendered chart to PDF

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


   @pissang 
   
   ok thanks for the update. 
   
   I could confirm the getDataURL({type: 'svg'}) is giving base64 image as output, which can be embedded in pdf.


-- 
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 #16098: Programmatically exporting SVG rendered chart to PDF

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


   Hi! We've received your issue and please be patient to get responded. 🎉
   The average response time is expected to be within one day for weekdays.
   
   In the meanwhile, please make sure that it contains **a minimum reproducible demo** and necessary **images** to illustrate. Otherwise, our committers will ask you to do so.
   
   *A minimum reproducible demo* should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.
   
   You may also check out the [API](https://echarts.apache.org/api.html) and [chart option](https://echarts.apache.org/option.html) to get the answer.
   
   If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.
   
   If you are interested in the project, you may also subscribe to our [mailing list](https://echarts.apache.org/maillist.html).
   
   Have a nice day! 🍵


-- 
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] msbasanth closed issue #16098: Programmatically exporting SVG rendered chart to PDF

Posted by GitBox <gi...@apache.org>.
msbasanth closed issue #16098:
URL: https://github.com/apache/echarts/issues/16098


   


-- 
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] pissang commented on issue #16098: Programmatically exporting SVG rendered chart to PDF

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


   We have new `renderToSVGString` method for server-sider rendering in our next release. I think it will be the best choice in this scene. Before that, decoding the base64 format is the only way if you wan't to get the HTML string


-- 
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] msbasanth commented on issue #16098: Programmatically exporting SVG rendered chart to PDF

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


   @VikasAgarwal1984 thanks for adding the comment. So we are getting base64 in **svg+xml** format.
   
   @pissang  Please point us to any approach with which we can embed an svg+xml base64 content in a pdf


-- 
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] VikasAgarwal1984 commented on issue #16098: Programmatically exporting SVG rendered chart to PDF

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


   AFAIK, Input for pdfmake is svg html or image(png/jpeg)  base64 data.
   
   Currently getDataURL({type: 'svg'}) returns data:image/svg+xml;charset=UTF-8......................
   that is not working as an input.
   
   Currently we read the outerHTML for rendered svg html element and feed to pdfmake api.
   
   Created a stackblitz to demonstrate same. Please see console for error.
   https://stackblitz.com/edit/angular-ivy-sfasil?file=src%2Fapp%2Fechart-basic%2Fechart-basic.component.ts
   
   Is there an Api to get jpeg/png or svg html in case of svg rendering.


-- 
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] VikasAgarwal1984 commented on issue #16098: Programmatically exporting SVG rendered chart to PDF

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


   seems it is url encoded, I have updated the stackblitz link
   seems we need to trim svg+xml to feed in pdfmake


-- 
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] msbasanth closed issue #16098: Programmatically exporting SVG rendered chart to PDF

Posted by GitBox <gi...@apache.org>.
msbasanth closed issue #16098:
URL: https://github.com/apache/echarts/issues/16098


   


-- 
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] pissang edited a comment on issue #16098: Programmatically exporting SVG rendered chart to PDF

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on issue #16098:
URL: https://github.com/apache/echarts/issues/16098#issuecomment-977397915






-- 
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] pissang commented on issue #16098: Programmatically exporting SVG rendered chart to PDF

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


   `getDataURL` can have `'svg'` type.
   
   ```ts
   ```


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