$db= mysql_connect("localhost","root","1234") or die(mysql_error());
mysql_select_db("hrm",$db) or die("db ploblem");
//$sql1="SELECT * FROM recruitment_people ";
$sql1="SELECT COUNT(mate_edu) AS num_grade FROM recruitment_people WHERE mate_edu = 'ปริญญาตรี' ";
$querysql1 = mysql_query($sql1) or die(mysql_error());
$rowssql1 = mysql_fetch_array($querysql1);
$grade_bachelor = $rowssql1['num_grade'];
$sql2="SELECT COUNT(mate_edu) AS num_grade FROM recruitment_people WHERE mate_edu = 'ปวส.' " ;
$querysql2 = mysql_query($sql2) or die(mysql_error());
$rowssql2 = mysql_fetch_array($querysql2);
$grade_high = $rowssql2['num_grade'];
$sql3="SELECT COUNT(mate_edu) AS num_grade FROM recruitment_people WHERE mate_edu ='ปวช.' ";
$querysql3 = mysql_query($sql3) or die(mysql_error());
$rowssql3 = mysql_fetch_array($querysql3);
$grade_vocation = $rowssql3['num_grade'];
//$datay=array(1,1,9);
$datay=array($grade_bachelor,$grade_high,$grade_vocation);
// Create the graph. These two calls are always required
$graph = new Graph(800,600);
$graph->SetScale("textlin");
$graph->yaxis->scale->SetGrace(20);
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,30,20,40);
// Create a bar pot
$bplot = new BarPlot($datay);
// Adjust fill color
$bplot->SetFillColor('blue');
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL,FS_BOLD,10);
$bplot->value->SetAngle(45);
//$bplot->value->SetFormat('%0.1f');
$graph->Add($bplot);
// Setup the titles
$data=array("Vocation","High_Vocation.","Bachelor");