02-04-2009, 02:34 PM
[eluser]Jona[/eluser]
Hi All,
I'm trying to use PHPgraphlib as found here: http://www.ebrueggeman.com/index.php to render some graphs and it works really well with the following code:
However as soon as I uncomment the model line instead of an image I get the following error image:
The image xxx could not be displayed, because it contains errors.
The model code works fine elsewhere so it shouldn't be throwing a php error.
The code for graph.php is as follows:
There is no errors shown in the logs.
Any help on this would be massively appreciated, it seems like it should work!!
Cheers
Jona
Hi All,
I'm trying to use PHPgraphlib as found here: http://www.ebrueggeman.com/index.php to render some graphs and it works really well with the following code:
Code:
function test(){
#$this->load->model('user_mod','users');
require('/var/www/html/resources/php/graph.php');
$data['Jan'] = 65;
$data['Feb'] = 56;
draw_single_graph($data);
}
The image xxx could not be displayed, because it contains errors.
The model code works fine elsewhere so it shouldn't be throwing a php error.
The code for graph.php is as follows:
Code:
function draw_single_graph($dataArray,$title="Graph",$width=500,$height=450){
include("phpgraphlib.php");
$graph=new PHPGraphLib($width,$height);
if(is_array($dataArray)){
$graph->addData($dataArray);
}
$graph->createGraph('rah.png');
}
Any help on this would be massively appreciated, it seems like it should work!!
Cheers
Jona