This is a migrated thread and some comments may be shown as answers.

Grabbing SVG of Telerik Components

1 Answer 71 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Harvey
Top achievements
Rank 1
Harvey asked on 24 Jul 2014, 02:37 PM
Currently, I have an aspx page in vb that launches a RadHTMLChart and I want to grab the SVG code of that chart. However, since the chart is rendered client-side, I have to launch this aspx page and then grab the SVG code from a second aspx page during postback. Currently, I am using Server.Execute (firstpage.aspx) to grab the SVG code but this does not work. I want to use the SVG to generate a PDF document but the Server.Execute command seems to run in the background and the code that comes after it do not wait for it to finish first, hence I am not grabbing the SVG content. Does anyone know of another way to grab this SVG content? 

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 28 Jul 2014, 11:23 AM

Hello Harvey,

RadHtmlChart renders its SVG during the Sys.Application.Init client-side event of the page that hosts it. Thus, the Sys.Application.Load event is the earliest point at which you can obtain its SVG rendering, as shown here: http://www.telerik.com/support/code-library/exporting-radhtmlchart-to-png-and-pdf. This solution relies on the chart being opened in the user's browser so the SVG string can be POST-ed to the server. If you only need to do this on the server you can look into other tools that let you run browsers on the server and obtain their content, like PhantomJS, for example.


Regards,

Marin Bratanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Harvey
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or