$PAGESIZE_UPPER_LIMIT) $pagesize = $PAGESIZE_UPPER_LIMIT; // kita perlu mengetahui jumlah record dulu jika menginginkan halaman // terakhir $result = mysql_query("SELECT COUNT(*) FROM t_investasi where status=1 && (status_tampil=0 || status_tampil=2) order by tgl"); list($total_rows) = mysql_fetch_row($result); // konversi dari $page & $pagesize menjadi $count & $offset untuk klausa // LIMIT MySQL if ($page == -1) { $count = $pagesize; $offset = $total_rows - $pagesize; } else { $count = $pagesize; $offset = ($page-1) * $pagesize; } $result1 = mysql_query("SELECT swasta_asing,tahun FROM t_investasi where status=1 && (status_tampil=2 || status_tampil=0) order by tgl LIMIT $offset,$count"); $result2 = mysql_query("SELECT swasta_asing,DATE_FORMAT(tgl, '%d/%m/%y') FROM t_investasi where status=1 && (status_tampil=1 || status_tampil=2) order by tgl"); while($row = mysql_fetch_array($result1)) { $datay[] = $row[1]; $datax[] = $row[0]; } /*while($row = mysql_fetch_array($result2)) { $datay[10] = $row[1]; $datax[10] = $row[0]; }*/ $graph = new Graph(550,400,"auto"); $graph->SetScale("textint"); $graph->img->SetMargin(55,25,50,45); //$graph->SetMarginColor("#EAF4FF"); $graph->SetColor("#EDF7FE"); $graph->SetFrame(false); //$graph->SetBackgroundImage("tiger_bkg.png",1); //$graph->img->SetAntiAliasing("lightyellow"); //$graph->AdjBackgroundImage(0.4,0.7,-1); //setting BG type //$graph->SetShadow(); $graph->xaxis->SetTickLabels($datay); $bplot = new BarPlot($datax); //$bplot->SetFillColor("lightblue"); // Fill color //$bplot->SetShadow(); $bplot->value->Show(); $bplot->value->SetFormat('%d'); //$bplot->value->SetFont(FF_ARIAL,FS_BOLD); //$bplot->value->SetAngle(45); //$bplot->SetColor("yellow"); $fcol='#440000'; $tcol='#FF9090'; $bplot->SetFillGradient($fcol,$tcol,GRAD_LEFT_REFLECTION); //$bplot->SetFillGradient("navy","#EEEEEE",GRAD_LEFT_REFLECTION); // ...and add it to the graPH $graph->Add($bplot); $graph->title->Set("Pertumbuhan Investasi Swasta Asing"); $graph->xaxis->title->Set("Tahun"); //$graph->yaxis->title->Set("person/orang"); $graph->ygrid->SetColor('lightblue@0.5'); //$graph->title->SetFont(FF_COMIC,FS_BOLD,15); $graph->title->SetColor(darkblue,navy); //$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); //$graph->xaxis->title->SetFont(FF_VERDANA,FS_NORMAL); $graph->xaxis->SetColor("blue"); //$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,9); $graph->yaxis->SetColor("darkblue"); $graph->Add($bplot); $t1 = new Text("dalam Jutaan US$"); $t1->SetOrientation("h"); //$t1->SetFont(FF_VERDANA,FS_NORMAL); $t1->SetBox("#EAF4FF","#EAF4FF",true); $t1->ParagraphAlign("right"); $t1->SetColor("black"); $graph->AddText($t1); //$graph->Stroke(); // Display the graph $graph->Stroke(); ?>