How to email any chart using Highcharts?

萝らか妹 提交于 2019-12-23 11:49:07

问题


If I include exporting.js file in my script, I get options like 'Print Chart' and 'Download Image'.

Is there any way to get an option like 'Email Chart', that will open up the preferred email client and attach the chart as an image?


回答1:


Save the rendered chart in a JS variable. Ajax it to phpmailer and send it via an email.

Works in gmail safari, but not chrome/mozilla. Also works when opened in Workspace email.

$(document).on("trigger", function() {

    var chart = $('#print').html();
    var email = $('#email').val();
    $.post("../client/makereport.php", {print: chart, email: email});
})


来源:https://stackoverflow.com/questions/30303327/how-to-email-any-chart-using-highcharts

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!