php - 如何将 Google Charts 保存到服务器

标签 php google-visualization

背景: 我们正在使用 Google Charts 为我们的网络应用程序生成的一些数据创建图表。用户创建报告,然后通过电子邮件发送该报告。问题是,一旦用户在 Microsoft Word 中打开报告,该程序就会表现出一些关于动态生成图像的奇怪行为。

因此,我们希望使用 PHP 将动态生成的图表保存在服务器上,因为 Word 可以毫无问题地处理简单的链接图像。

我对如何进行有点不知所措。想法?

最佳答案

<?
$imageData = file_get_contents('http://chart.apis.google.com/chart... etc');

// Attach image data as attachment to an email
//OR: 

file_put_contents('/path/to/save/image.png',$imageData);
?>

关于php - 如何将 Google Charts 保存到服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3738839/

相关文章:

javascript - Ajax 帖子未返回到帖子发送的页面

javascript - 使用负值 Google Chart 在条形图上移动注释

google-visualization - 向谷歌图表数据表添加额外数据

php - php 和 mysql 中 while 循环中的 if 语句中的日期格式显示为 1970 年 1 月 1 日

php - 无法在 php 中发送带有多个复选框的多个值

php - 类文件中的 fatal error 显示语法和 fatal error

PHP 在一个页面中只发送一个 mail()

javascript - 在 Google Chart 中自定义 onmouseover 事件

php - 有没有谷歌图表的 php/sql 包装器

google-apps-script - 使用 "Release Number"列对 TableChart 进行排序