[trick] Menampilkan Grafik Pie di PDF dengan php

Bismillah….

ok kali ini coba kita bahas tentang grafik di pdf y, kira-kira gimana nampilinnya..

ternyata  sangatlah mudah.

ok langsung saja.


<?php
require('sector.php');

$pdf=new PDF_Sector();
$pdf->AddPage();
$xc=105;
$yc=60;
$r=40;
$pdf->SetFillColor(120,120,255);
$pdf->Sector($xc,$yc,$r,20,120);
$pdf->SetFillColor(120,255,120);
$pdf->Sector($xc,$yc,$r,120,250);
$pdf->SetFillColor(255,120,120);
$pdf->Sector($xc,$yc,$r,250,20);

$pdf->SetFont('Arial','B','12');

$pdf->SetXY(80,35);
$pdf->Cell(20,10,'Produk A');

$pdf->SetXY(120,60);
$pdf->Cell(20,10,'Produk B');

$pdf->SetXY(80,80);
$pdf->Cell(20,10,'Produk C');

$pdf->Output();
?>

dan hasilnya sebagai berikut >>

grafik

mudah bukan.

link download disini

Leave a comment

1 Comment

  1. asd

     /  04/03/2015

    kalo grafik batnag gimana gan ?

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: