cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert a viz chart to an image?

Former Member
0 Kudos

Hi Everyone,

I am running an html page by using SAP UI5  where I have rendered a dew viz charts.

Can you please help me on how to convert the viz chart to an image file or a pdf .

Any Help would be greatly appreciated.

Thanks,

Arnab.

Accepted Solutions (0)

Answers (3)

Answers (3)

Private_Member_14935
Active Participant
0 Kudos

Hi Arnab,

If being able to convert a viz chart to svg file format is good enough then you have 2 options:

1. Right click on the chart rendered in browser say IE9 and choose the option "Save Picture As", this will allow you to save the chart as an svg file which you can open in a browser or embed in html page as per your requirement.

2. If you have to do it programmatically say for a feature like "Preview" of a chart, then you can extract the svg node of the html document in which you have rendered the chart. You can then create a clone of the svg node and write it to a new browser window.

Hope this helps!

Regards,

Ria

former_member185280
Active Contributor
0 Kudos

I think the vis charts are based on the d3.js charting library so you may want to look around in that space and see if you can get the underlying svg and possibly use the server side svg image rendering that MII provides.

D3.js - Data-Driven Documents

Otherwise maybe try posting in the sdn UI5 forums:


Regards,
Christian

Former Member
0 Kudos

Hi Arnab,

The solution is bit tricky for it. I guess if you use servlet then you can easily get the image of the chart because in servlet it mainly take the static image of the chart. So if you pass the url using servlet to a BLS containing a XML loader and PDF image action block and pass that URL into the XML loader then I hope you will get the PDF image of that chart. but for this only dependency is you have to use the webpage extension as .irpt not as .html.

Hope it will help you.

Regards,

Suman