J'utilise l'exemple de demande de post php donné sur http://code.google.com/apis/chart/docs/post_requests.html pour générer un graphique.Google Exemple d'outil graphique ne fonctionne pas
Le code: chartserver-image.php
<?php
// Create some random text-encoded data for a line chart.
header('content-type: image/png');
$url = 'http://chart.apis.google.com/chart';
$chd = 't:';
for ($i = 0; $i < 150; ++$i) {
$data = rand(0, 100000);
$chd .= $data . ',';
}
$chd = substr($chd, 0, -1);
// Add data, chart type, chart size, and scale to params.
$chart = array(
'cht' => 'lc',
'chs' => '600x200',
'chds' => '0,100000',
'chd' => $chd);
// Send the request, and print out the returned bytes.
$context = stream_context_create(
array('http' => array(
'method' => 'POST',
'content' => http_build_query($chart))));
fpassthru(fopen($url, 'r', false, $context));
?>
another_page.html
<img width='600' height='200' src='chartserver-image.php'>
En ce moment, quand j'accéder another_page.html, l'image ne se charge pas lorsque je clique sur la vue l'image montre
L'image "http://localhost/demo/chartserver-image.php" ne peut pas être affichée, car elle contient des erreurs.
Quel est le problème que je n'arrive pas à comprendre?
S'il vous plaît aidez-moi sur ce
Merci
+1 qui semble avoir résolu mon problème à http://stackoverflow.com/questions/3682622/anyone-having-problems-with-google-charts-in-xampp – Mawg
oups, désolé, non, il n'a pas -quelque chose D'autre a fait, désolé. Mais c'est un bon point à faire de toute façon – Mawg