pChart 不会呈现到 Web 浏览器,仅显示缺失的图像
pCharts 文档说您应该能够使用此代码将图像呈现到浏览器。
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。
pCharts documentation says that you should be able to render the image to the browser using this code.
mypic.php
$myPicture->stroke;
mypage.html
<IMG SRC=‘mypic.php‘>
The img
tag is supposed to invoke the php script. Within the PHP script, the stroke function sets the content-type: image/png
.
So here is what I have:
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>
I'm not getting any errors, just the red X for a missing image.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试删除
From index.php,并添加
Before the Stroke 调用。
try removing the
From index.php, and add
Before the Stroke call.
我尝试这样的事情并且有效:
I try something like this and works:
我刚刚让它为我工作,我在 HTML 文件中添加了注释包含功能:
I just got it working for me I had comment include function in HTML file: