分享饼图

发布于 2024-11-27 21:14:54 字数 213 浏览 2 评论 0原文

我的 PHP 网站生成(除其他外)一个使用 Google Chart API 构建的饼图。我想为用户提供一个选项,可以使用饼图发布图片。这些是我认为应该采取的步骤:
1. 拍摄我在其中显示饼图的 div 的快照
2. 将其上传至图片共享服务。
3. 通过 twitter API 发送该链接

如何实现步骤 (1)?
您是否会推荐一种不同的方法来实现我所追求的任务?

My PHP web-site generates (among other things) a pie-chart which is built with Google Chart API. I would like to give the user an option to tweet a picture with the pie chart. These are the steps I thought I should take:
1. Taking a snapshot of the div I'm displaying the pie chart in
2. U/L it to a picture sharing service.
3. twitting that link through twitter API

How can I achieve step (1)?
Would you maybe recommend a different method to implement the task I'm after?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟燃烟灭 2024-12-04 21:14:54

与 FGC:

<?php
$image = file_get_contents('http://chart.googleapis.com/chart?chs=320x200&cht=bvs&chd=t:30,-60,50,140,80,-90&chds=-80,140&chxt=y');
file_put_contents('temp.png',$image);
?>

With FGC:

<?php
$image = file_get_contents('http://chart.googleapis.com/chart?chs=320x200&cht=bvs&chd=t:30,-60,50,140,80,-90&chds=-80,140&chxt=y');
file_put_contents('temp.png',$image);
?>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文