<?
include_once ('phpMyGraph5.0.php'); // Link to library file phpMyGraph 5.0

     $cfg ['title'] = 'My Graph'; 	//Configure, title, width and height
     $cfg ['width'] = 1250;		//number of pixels horizontally
     $cfg ['height'] = 300;		//number of pixels vertically

include "conninfo.php";  
$query="SELECT mydata FROM thedata";
$result=mysqli_query($link,$query);		//get data from database

$data=array();
$x=0;

while ($r=mysqli_fetch_array($result))
{
$data[$x]=$r["mydata"];			//put data into array
$x++;
}

header ("Content-type: image/png"); 
$graph = new phpMyGraph();
$graph-> parseVerticalColumnGraph ($data, $cfg); //create graph
?>
