1.tampilan pada delphi
2. download file jquery di http://www.4shared.com/rar/xJ-eH6-X/gerafik.html? yang sudah di sedia kan.
3.extrak file jquery
4.pindah kan file tersebut di htdocs
5.untuk scrif membuat grafik pada php spt di bahwah ini:
<?php
/* koneksi ke db */
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("project_ii") or die(mysql_error());
include("class/FusionCharts_Gen.php");
?>
<html>
<head>
<title>First Chart Using FusionCharts PHP Class</title>
<script language='javascript' src='js/FusionCharts.js'></script>
</head>
<body>
<?php
# Include FusionCharts PHP Class
# Create object for Column 3D chart
$FC = new FusionCharts("Column3D","1000","350");
# Setting Relative Path of chart swf file.
$FC->setSwfPath("Charts/");
# Store chart attributes in a variable
$strParam="caption=Grafik Keadaan Barang Di Laboratorium Komputer STMIK-AMIK Riau $bulan $tahun; xAxisName=keadaan barang ;yAxisName=Jumlah Barang;decimalPrecision=0; formatNumberScale=0";
# Set chart attributes
$FC->setChartParams($strParam);
$kategori = mysql_query("SELECT id_barang, kondisi FROM tb_keadaan");
//$tracking = mysql_query("SELECT Nama_Karyawan FROM master_karyawan WHERE Kode_Nama_Cabang='SRJ' AND Category_Tracking='sales'");
while ($r_kat = mysql_fetch_array($kategori)){
$id_kat = $r_kat['id_barang'];
$kat = $r_kat['kondisi'];
$counter1 = 0;
//$total = mysql_num_rows(mysql_query("SELECT IdKat,TglTerjual FROM penjualan_buku WHERE IdKat='$kat' AND LEFT(TglTerjual,4)='2012' AND MID(TglTerjual,6,2)='02'"));
$total = mysql_query("SELECT id_barang,tanggal FROM tb_barang WHERE id_barang='$id_kat' AND LEFT(tanggal,4)='2013' AND MID(tanggal,6,2)='02'");
$counter1++;
//$persentase = ($total!=0 || $review !=0)?($review / $total) *100:0;
$total = mysql_num_rows($total);
# add chart values and category names
$FC->addChartData("$total","name=$kat");
}
# Render Chart
$FC->renderChart();
?>
</body>
</html>
6.simpan file tersebut dengan format *.php pada C:\xampp\htdocs\grafik
7.untuk tabel
tabel barang
id_barang varchar(10)
nm_barang char(20)
merek varchar(10)
type varchar(20)
jenis varchar(10)
tanggal date
tabel keadaan
id_barang varchar(10)
kondisi varchar(10)
id_ruang varchar(10)
id_asisten varchar(10)
jumlah int(11)
tanggal date
ket char(30)
0 Comments