我把jpgraph-3.0.7解压的文件放到项目中的路径中Lib/ORG/Util/jpgraph-3.0.7,然后在一个名为WkA0600Action.class.php的文件中调用它,导入include("../ORG/Util/jpgraph-3.0.7/src/jpgraph.php");
include("../ORG/Util/jpgraph-3.0.7/src/jpgraph_pie.php");
$graph = new Graph(400 , 300);//这里Graph没办法实例化。
$graph->SetShadow();
$graph->title->Set("饼形图");
$pieplot = new PiePlot($data);
$graph->Add($pieplot);
$graph->Stroke();
报错: Class 'Graph' not found in E:\WorkSpacing\AppServ\www_cpiscn\Gshm\Wk\Lib\Action\WkA0600Action.class.php on line 205
求解?
include("../ORG/Util/jpgraph-3.0.7/src/jpgraph_pie.php");
$graph = new Graph(400 , 300);//这里Graph没办法实例化。
$graph->SetShadow();
$graph->title->Set("饼形图");
$pieplot = new PiePlot($data);
$graph->Add($pieplot);
$graph->Stroke();
报错: Class 'Graph' not found in E:\WorkSpacing\AppServ\www_cpiscn\Gshm\Wk\Lib\Action\WkA0600Action.class.php on line 205
求解?
2.查下WkA0600Action.class.php所在位置?
如果你的include_path是xxx/xxx/Lib的话
include("../ORG/Util/jpgraph-3.0.7/src/jpgraph_pie.php");
=>include("ORG/Util/jpgraph-3.0.7/src/jpgraph_pie.php");
也就是你还得调用jpgraph这个文件,而且你不用把路径设置那么长哦。。