Gazz1982 Posted July 20, 2007 Share Posted July 20, 2007 I have created a graph using the below code. <?include("phpgraphlib.php"); $graph=new PHPGraphLib(400,300); $data=array("1"=>20, "2"=>198, "3"=>70, "4"=>90); $graph->addData($data); $graph->setTitle("Definitions"); $graph->setGradient("red", "maroon"); $graph->setBarOutlineColor("black"); $graph->setTextColor("blue"); $graph->createGraph(); // Closing connection mysql_close($link); ?> This is called from a html page using <img src="bar_graph.php" /> I have a database using mysql, how would i link this into the graph? ie from $data=array("1"=>20, "2"=>198, "3"=>70, "4"=>90); to $data=array("1"=$a, "2"=$b, "3"=>$c, "4"=>$d); in this case the $a/b/c and d would be called from a query I tried the above $data=array... but it didn't work any ideas? Gary Link to comment Share on other sites More sharing options...
Barand Posted July 20, 2007 Share Posted July 20, 2007 DON'T double post. Closing this one. Link to comment Share on other sites More sharing options...
Recommended Posts