rendered paste body<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");
include ("../jpgraph_date.php");
$db = pg_connect("host=localhost dbname=test0 user=lfriedman");
if (!$db) {printf ("ERROR - Can not connect to database"); exit;}
$query=("select * from stats");
$result=pg_exec($db, $query);
if (!$result) {printf ("ERROR - Bad Select Statement"); exit;}
pg_close($db);
while($row=pg_fetch_row($result)){
$data[]=$row['score'];
#$leg[]=$row['score'];
}
$graph = new Graph(700,600,"auto");
$graph->img->SetMargin(40,40,40,40);
$graph->img->SetAntiAliasing();
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->title->Set("foo title");
$graph->title->SetFont(FF_VERDANA,FS_BOLD);
$graph->yscale->SetGrace(10,10);
$p1 = new LinePlot($data);
$p1->mark->SetType(MARK_FILLEDCIRCLE);
$p1->mark->SetFillColor("red");
$p1->mark->SetWidth(4);
$p1->SetColor("blue");
$p1->SetCenter();
$graph->Add($p1);
$graph->Stroke();
?>