pCharts 文档说您应该能够使用此代码将图像呈现给浏览器。
mypic.php
$myPicture->stroke;
我的页面.html
<IMG SRC=‘mypic.php‘>
该img
标签应该调用 php 脚本。在 PHP 脚本中,stroke 函数将content-type: image/png
.
所以这就是我所拥有的:
netsales.php
<?php
include('../class/pData.class.php');
include('../class/pDraw.class.php');
include('../class/pImage.class.php');
/* query sales and create new image */
$myPicture->stroke;
?>
索引.php
<?php
include ('netsales.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<div>
<img src="netsales.php" />
</div>
</body>
</html>
我没有收到任何错误,只是缺少图像的红色 X。