问题
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