-
Notifications
You must be signed in to change notification settings - Fork 19.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Programmatically exporting SVG rendered chart to PDF #16098
Comments
Hi! We've received your issue and please be patient to get responded. 🎉 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 and chart option 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 [email protected]. 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. Have a nice day! 🍵 |
getDataURL({ type: 'svg' }); It's missed in the doc |
ok thanks for the update. I could confirm the getDataURL({type: 'svg'}) is giving base64 image as output, which can be embedded in pdf. |
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...................... 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. Is there an Api to get jpeg/png or svg html in case of svg rendering. |
@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 |
seems it is url encoded, I have updated the stackblitz link |
We have new Before that, decoding the base64 format is the only way if you wan't to get the HTML string |
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.
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
The text was updated successfully, but these errors were encountered: