Advertisement
ariestamirra

Untitled

Sep 14th, 2015
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. <?php
  2.     include ("config.php");
  3.     include ("JPGraph/src/JPGraph.php");
  4.     include ("JPGraph/src/JPGraph_pie.php");
  5.     include ("JPGraph/src/JPGraph_pie3d.php");
  6.    
  7.     $sql = mysql_query("SELECT * FROM tek_rekap_mhs") or die(mysql_error());
  8.     while($row = mysql_fetch_array($sql)){
  9.         $data[] = $row[2];
  10.         $leg[] = $row[1];
  11.     }
  12.     $graph = new PieGraph(700,600,"auto");
  13.     $graph->SetScale('textint');
  14.     $graph->img->SetMargin(50,50,0,0);
  15.     $graph->SetShadow();
  16.     $graph->title->Set("Rekapitulasi Jumlah Mahasiswa");
  17.     $bplot = new PiePlot3D($data);
  18.     $bplot->SetCenter(0.5);
  19.     $bplot->SetLegends($leg);
  20.     $graph->Add($bplot);
  21.     $graph->Stroke();
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement