1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| $im=$graph->Stroke(_IMG_HANDLER);
$filename="chart";
$file_type = "image/png";
$file_ending = "png";
$filename=$filename.".".$file_ending;
header("Content-Type: application/$file_type");
header("Content-Disposition: attachment; filename=".$filename);
header("Pragma: no-cache"); header("Expires: 0");
ImagePNG($im);
Cette première partie est insérée dans la fonction qui crée le graphe.
Puis la fonction suivante:
function LoadPng($im)
{
$bitmap = @imagecreatefrompng($im);
header("Content-Type: image/png");
imagebmp($bitmap) ;
$worksheet =& $workbook->addWorksheet();
$worksheet->insertBitmap(26, 1, $bitmap, 0, 0, 1, 1);
} |
Partager