【发布时间】:2012-05-15 22:30:06
【问题描述】:
我将在我的网络项目中使用JpGraph。为此,我将库下载到我的项目文件夹中并创建了以下测试代码:
<?php
include ( "jpgraph-3.5.0b1/src/jpgraph.php");
include ("jpgraph-3.5.0b1/src/jpgraph_gantt.php");
// A new graph with automatic size
$graph = new GanttGraph (0,0, "auto");
// A new activity on row '0'
$activity = new GanttBar (0,"Project", "2001-12-21", "2002-02-20");
$graph->Add( $activity);
// Display the Gantt chart
$graph->Stroke();
?>
错误信息是:
The image “http://localhost:10088/test/check.php” cannot be displayed,
because it contains errors.
我的代码有什么问题?其实就是从here复制过来的。我唯一改变的是 JpGraph 库的路径。那么,我是否需要以某种特殊的方式将这个库导入我的项目中(到目前为止,我刚刚将 JpGraph 的文件夹复制到了项目的文件夹中)?我正在使用 Zend Studio。
【问题讨论】:
-
看看你的图表的html源代码
-
这段代码对我来说很好用。神秘。您是否仔细检查了所包含文件的路径?
-
@FrederickBehrends 没有 html 源代码。 jpgraph 生成一个实际的图像文件。
-
@octern: 是的,我检查了 100 次路径...
-
@octern 但 php 错误仍然在输出中(如果存在)