我把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
求解?

解决方案 »

  1.   

    1.找下你php的library的默认路径,把jpgraph解压到该目录 php -i | grep include_path
    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");
      

  2.   

    lz你光调用了pie找个类,但是graph这个类是在jpgraph.php这个文件中.
    也就是你还得调用jpgraph这个文件,而且你不用把路径设置那么长哦。。
      

  3.   

    jpgraph上面都有例子的,可以参考相应的事例,在进行运用就方便多了
      

  4.   

    jpgraph.php这个文件在上面的代码中我调用了哈..
      

  5.   

    先找到你php安装的include_path,然后把jpgraph解压缩到该目录,然后include 这个目录(不带include_path)我上面给的是linu下读phpinfo的方法,你在window下,写个script 打印出phpinfo();然后查找include_path