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

Sending Kendo charts in emails

5 Answers 286 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Evan
Top achievements
Rank 1
Evan asked on 26 Nov 2014, 03:18 PM
We are currently using Telerik Kendo UI Pro for our PhoneGap application and we will be adding graphing to the user experience soon. In addition to this, we would like to send Kendo UI graphs in our customer-facing emails. The problem is that the overwhelming majority of email clients explicitly forbid JavaScript and therefor using Kendo UI graphs within the email is effectively off limits.

I then noticed that under the Chart API (http://demos.telerik.com/kendo-ui/chart-api/export) there was an “Export as Image” button which might be able to provide us with an image that could be embedded. I was wondering if it would be possible to use this functionality or something like it set up a service that would accept input data and then output the graph as an image? I couldn't find anything in the sample code, but I was wondering what strategies others have used to overcome this limitation of email clients.

Ideally, we would want a .NET web service that we could pass data into and it would output an image file of a Telerik graph of a specified size.

Thanks a bunch in advance for any advice or shared experiences in this matter,

Evan

5 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 01 Dec 2014, 08:48 AM
Hi,

Any export service should be able to run the actual Kendo UI widgets in order to export them.
A MVC service can be used to process the output generated by the chart, but won't be able to generate it on its own.

An alternative is to host a headless browser like PhantomJS on the server and use this to generate the charts.
It can even be turned into a service on its own, as in this project by a customer of ours.

That's not a requirement though.
A simple export script can be sufficient is the page to be exported is hosted by the server.

I hope this helps.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Evan
Top achievements
Rank 1
answered on 03 Dec 2014, 10:48 PM
Thank you for the prompt reply.

I was trying to use PhantomJS to render the graph from the Inkscape example, but all I wind up with is an empty graph. However, when I view the same page in chrome, it is fine. When I use PhantomJS to take a screenshot of the samples on the Telerik website they turn out just fine

I even tried to change the example code to use the css and js files from your CDN in case it was a speed thing, but found no success. I will try it with an HTML5 example on one of my local servers, but I somewhat suspect the results will be the same.

Regards,

Evan
0
T. Tsonev
Telerik team
answered on 05 Dec 2014, 08:14 AM
Hello,

Just a quick idea - try turning off the chart animations.
It looks like the export script is executing immediately, which is fine, but will capture the initial state of the widgets.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
kesavan
Top achievements
Rank 1
answered on 06 Jan 2015, 02:53 PM
I added this turn off.But still it is not working.Can you please post the latest working code?
0
Ryan
Top achievements
Rank 1
answered on 25 Nov 2015, 03:02 AM

A little late to the game here, but my team at Ramen recently spun out some internal functionality into a standalone product that could help with this: https://ChartURL.com

You can generate charts on the fly using an "Encrypted URL" scheme, or you can send us huge amounts of data via a POST, and we'll return a Short URL that'll resolve to an image. These URLs can be used in emails, web apps & mobile apps.

Hope this helps!

Tags
General Discussions
Asked by
Evan
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Evan
Top achievements
Rank 1
kesavan
Top achievements
Rank 1
Ryan
Top achievements
Rank 1
Share this question
or