ariestamirra

Untitled

Sep 12th, 2015
92
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_line.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.     $graph = new Graph(1300,600,"auto");
  11.     $graph->SetScale('textint');
  12.     $graph->img->SetMargin(100,100,100,100);
  13.     $graph->SetShadow();
  14.     $graph->title->Set("Rekapitulasi Jumlah Mahasiswa");
  15.     $graph->xaxis->SetTickLabels($leg);
  16.     $bplot = new LinePlot($data);
  17.    
  18.     $bplot->value->SetFont(FF_ARIAL,FS_BOLD);
  19.     $bplot->value->SetAngle(45);
  20.     $bplot->value->Show();
  21.     $bplot->SetLegend("Banyak data");
  22.     $graph->Add($bplot);
  23.     $graph->Stroke();
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment