第二章第二节课图片完全显示不了,N种报错

来源:-

carter825450721

2016-01-13 23:31

我的代码:

http://img.mukewang.com/56966dc600017f7406950623.jpg

浏览器显示一大堆的报错

Notice: Undefined offset: 0 in G:\wamp\www\jpgraph\jpgraph-3.5.0b1\src\jpgraph.php on line 5515

Notice: Undefined offset: 0 in G:\wamp\www\jpgraph\jpgraph-3.5.0b1\src\jpgraph.php on line 5480

Notice: Undefined offset: 0 in G:\wamp\www\jpgraph\jpgraph-3.5.0b1\src\jpgraph.php on line 5515

Notice: Undefined offset: 0 in G:\wamp\www\jpgraph\jpgraph-3.5.0b1\src\jpgraph.php on line 5480

Notice: Undefined offset: 0 in G:\wamp\www\jpgraph\jpgraph-3.5.0b1\src\jpgraph_line.php on line 209

浏览器最下方提示:

JpGraph Error: HTTP headers have already been sent.
Caused by output from file jpgraph.php at line 5480.

Explanation:
HTTP headers have already been sent back to the browser indicating the data as text before the library got a chance to send it's image HTTP header to this browser. This makes it impossible for the library to send back image data to the browser (since that would be interpretated as text by the browser and show up as junk text).

Most likely you have some text in your script before the call to Graph::Stroke(). If this texts gets sent back to the browser the browser will assume that all data is plain text. Look for any text, even spaces and newlines, that might have been sent back to the browser.

For example it is a common mistake to leave a blank line before the opening "<?php".


写回答 关注

2回答

  • 夏一同学
    2016-01-18 18:59:40
    <?php
    require_once '../src/jpgraph.php';
    require_once '../src/jpgraph_line.php';

    修改为:

    <?php
    require_once '../jpgraph/jpgraph.php';
    require_once '../jpgraph/jpgraph_line.php';
    还有就是数组键要从0开始比如:0=>10,1=>12……


  • carter825450721
    2016-01-14 00:40:25

    上面图片我没显示到第一行,具体是这样的

    <?php

    require_once '../src/jpgraph.php';

    require_once '../src/jpgraph_line.php';


神奇的JpGraph类库

JpGraph类库可以画出炫彩的统计图,掌握JpGraph类库的使用

15179 学习 · 31 问题

查看课程

相似问题