开发者

Sharing a pie chart

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开发者_StackOverflow 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?


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);
?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜