douhuzhi0907 2012-05-07 12:00
浏览 74
已采纳

JpGraph小型演示无法正常工作

I'm going to use JpGraph in my web-project. To do this, I downloaded the library into my project folder and created the following test code:

        <?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 error message is:

The image “http://localhost:10088/test/check.php” cannot be displayed, 
because it contains errors.

What's wrong with my code? In fact, it was just copied from here. The only thing I changed was the path to the JpGraph library. So, do I need to import this library in some special way into my project (so far, I've just copied the JpGraph's folder into the project's folder)? I'm using Zend Studio.

  • 写回答

1条回答 默认 最新

  • douling8087 2012-05-07 12:23
    关注

    This can be caused by extra whitespace on the page. Make sure you don't have any spaces or line breaks before your opening <?php tag.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题