ariestamirra

Untitled

Sep 12th, 2015
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. <?php
  2.     include ("config.php");
  3.     include ("JPGraph/src/JPGraph.php");
  4.     include ("JPGraph/src/JPGraph_bar.php");
  5.     $sql = mysql_query("SELECT * FROM tek_rekap_mhs") or die(mysql_error());
  6.     while($row = mysql_fetch_array($sql)) {
  7.         $data[] = $row[2];
  8.         $leg[] = $row[1];
  9.     }
  10.    
  11.     $graph = new Graph(1300,600,"center");
  12.     $graph->SetScale('textint');
  13.     $graph->img->SetMargin(50,30,50,50);
  14.     $graph->SetShadow();
  15.     $graph->title->Set("Rekapitulasi Jumlah Mahasiswa");
  16.     $graph->xaxis->SetTickLabels($leg);
  17.     $bplot = new BarPlot($data);
  18.     $bplot->value->Show();
  19.     $bplot->value->SetFont(FF_ARIAL,FS_BOLD);
  20.     $bplot->value->SetAngle(45);
  21.     $bplot->SetLegend("Banyak data");
  22.     $graph->Add($bplot);
  23.     $graph->Stroke();
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment