Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include ("config.php");
- include ("JPGraph/src/JPGraph.php");
- include ("JPGraph/src/JPGraph_bar.php");
- $sql = mysql_query("SELECT * FROM tek_rekap_mhs") or die(mysql_error());
- while($row = mysql_fetch_array($sql)) {
- $data[] = $row[2];
- $leg[] = $row[1];
- }
- $graph = new Graph(1300,600,"center");
- $graph->SetScale('textint');
- $graph->img->SetMargin(50,30,50,50);
- $graph->SetShadow();
- $graph->title->Set("Rekapitulasi Jumlah Mahasiswa");
- $graph->xaxis->SetTickLabels($leg);
- $bplot = new BarPlot($data);
- $bplot->value->Show();
- $bplot->value->SetFont(FF_ARIAL,FS_BOLD);
- $bplot->value->SetAngle(45);
- $bplot->SetLegend("Banyak data");
- $graph->Add($bplot);
- $graph->Stroke();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment