Have an account? Sign in
Login  Register  Facebook
google chart caching
I\'m calling my php script that generates the google chart (POST method) and has this code to output the image (the page is set to png output):
$context = stream_context_create(
array(\'http\' => array(
\'method\' => \'POST\',
\'content\' => http_build_query($chart))));
fpassthru(fopen($url, \'r\', false, $context));
I call the script as an image (...img src=\"gchart.php?.....)

All works fine, but i\'d like to cache the results of the above, how can i capture the output of post request and store as png file?
Started: September 17, 2011 Latest Activity: September 17, 2011 charts
1 Answer
you can use this cache system
how i can use?
<img src=\"chart_cache.php?config=simple\" width=\"250\" height=\"100\">
The single parameter, \"simple\" refers to the filename of the configuration file you want to use (excluding path and file extension). Configuration files are simply sets of key/value pairs corresponding to the GET parameters passed to Google Charts plus a couple of special properties which define caching characteristics. Here\'s an example:
  # simple chart
 expiry = 300
 cht = p3
 chd = s:hW
 chs = 250x100
 chl = Hello|World

Posted: MacOS
In: September 17, 2011

Does this use the GET or POST request method for google charts?
September 17, 2011

the job of that code depend on curl lib
September 17, 2011

Your Answer

xDo you want to answer this question? Please login or create an account to post your answer