pCharts文檔說,您應該能夠使用此代碼將圖像呈現給瀏覽器。pChart不呈現給網絡瀏覽器,只顯示丟失的圖像
mypic.php
$myPicture->stroke;
的mypage.html
<IMG SRC=‘mypic.php‘>
的img
標籤應該調用PHP腳本。在PHP腳本中,筆劃函數設置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;
?>
的index.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爲失蹤圖片。
是'stroke'不是一個功能?所以試試'$ myPicture-> stroke();'? – thirtydot 2011-02-23 15:40:23