如何使用Highcharts向任何图表发送电子邮件? [英] How to email any chart using Highcharts?

查看:109
本文介绍了如何使用Highcharts向任何图表发送电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在脚本中包含exporting.js文件,我会得到诸如打印图表和下载图像等选项。

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?

推荐答案

将呈现的图表保存在JS变量中。将它加入phpmailer并通过电子邮件发送。

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

适用于gmail safari,但不适用于chrome / mozilla。在Workspace电子邮件中打开时也可以使用。

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});
})

这篇关于如何使用Highcharts向任何图表发送电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆