Sending Kendo charts in emails

6 posts, 0 answers
  1. Evan
    Evan avatar
    2 posts
    Member since:
    Nov 2014

    Posted 26 Nov 2014 Link to this post

    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
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 01 Dec 2014 Link to this post

    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!
     
  3. Evan
    Evan avatar
    2 posts
    Member since:
    Nov 2014

    Posted 03 Dec 2014 in reply to T. Tsonev Link to this post

    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
  4. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 05 Dec 2014 Link to this post

    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!
     
  5. kesavan
    kesavan avatar
    2 posts
    Member since:
    Dec 2013

    Posted 06 Jan 2015 in reply to T. Tsonev Link to this post

    I added this turn off.But still it is not working.Can you please post the latest working code?
  6. Ryan
    Ryan avatar
    1 posts
    Member since:
    Nov 2015

    Posted 24 Nov 2015 in reply to T. Tsonev Link to this post

    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!

Back to Top