cloud_hardcore Publish time 14-10-2010 01:53 AM

Bina Pie Chart using PHP

Salam,
Ada sesape yang boleh ajar saya buat pie chart menggunakan php? Sy guna XAMPP utk run apache.

BorderManager Publish time 14-10-2010 08:26 AM

kena enable GD2 library dulu lepas tu test script n<?php
$myImage = ImageCreate(300,300);

$white = ImageColorAllocate ($myImage, 255, 255, 255);
$red= ImageColorAllocate ($myImage, 255, 0, 0);
$green = ImageColorAllocate ($myImage, 0, 255, 0);
$blue = ImageColorAllocate ($myImage, 0, 0, 255);
$lt_red = ImageColorAllocate($myImage, 255, 150, 150);
$lt_green = ImageColorAllocate($myImage, 150, 255, 150);
$lt_blue = ImageColorAllocate($myImage, 150, 150, 255);

for ($i = 120;$i > 100;$i--) {
    ImageFilledArc ($myImage, 100, $i, 200, 150, 0, 90, $lt_red, IMG_ARC_PIE);
    ImageFilledArc ($myImage, 100, $i, 200, 150, 90, 180, $lt_green, IMG_ARC_PIE);
    ImageFilledArc ($myImage, 100, $i, 200, 150, 180, 360, $lt_blue, IMG_ARC_PIE);
}

ImageFilledArc($myImage, 100, 100, 200, 150, 0, 90, $red, IMG_ARC_PIE);
ImageFilledArc($myImage, 100, 100, 200, 150, 90, 180 , $green, IMG_ARC_PIE);
ImageFilledArc($myImage, 100, 100, 200, 150, 180, 360 , $blue, IMG_ARC_PIE);

header ("Content-type: image/png");
ImagePNG($myImage);

ImageDestroy($myImage);
?>

kmkd Publish time 14-10-2010 12:06 PM

aku yang malas ni guna google chart api je :lol:

BorderManager Publish time 14-10-2010 03:07 PM

aku yang malas ni guna google chart api je
kmkd Post at 14-10-2010 12:06 http://mforum3.cari.com.my/images/common/back.gif


    tu pun senang, but utk yg online je... kalau offline tak jln

tokma Publish time 14-10-2010 04:46 PM

salam ..
sape2 tau camner nk select table from diff server...

BorderManager Publish time 14-10-2010 05:07 PM

create new connection

cloud_hardcore Publish time 14-10-2010 07:46 PM

Reply 2# BorderManager


   nk enable GD2 librarytu cmne erk..dah try google tp tak paham...

ana_una Publish time 14-10-2010 09:17 PM

akak guna fusion chart..
tp buat bar chart la..
utk pie chart ada rsnya kot..

ana_una Publish time 14-10-2010 09:23 PM

fusionchart ni nmpak interactive skit..
compared to gd2 tu..
skema sgt...;P( jgn mare ar tuan manager nanti kena jual..:lol:)
ni linknya..

klik disini

BorderManager Publish time 15-10-2010 08:12 AM


nk enable GD2 librarytu cmne erk..dah try google tp tak paham...


ko run script n jalan tak? kalau jln dah enable la tu. kalau ko ko buka file php.ini

tukar;extension=php_gd2.dllkeextension=php_gd2.dlllepas tu restart server

fusionchart ni nmpak interactive skit..
compared to gd2 tu..
skema sgt...( jgn mare ar tuan mana ...


tuan tanah nak guna PHP bukan javascript... hehe

cloud_hardcore Publish time 17-10-2010 03:29 AM

sory soklan noob..

file php.ini tu kat mane yee??

BorderManager Publish time 17-10-2010 01:21 PM

sory soklan noob..

file php.ini tu kat mane yee??
cloud_hardcore Post at 17-10-2010 03:29 http://mforum3.cari.com.my/images/common/back.gif

kalau dlm Windows, cari "c:\program file\php5\php.ini"
linux "/etc/php5/php.ini"
osx " /etc/php.ini"

cloud_hardcore Publish time 17-10-2010 08:43 PM

Reply 12# BorderManager


   bro..tak jumpa pun folder php dlm programs files..

cloud_hardcore Publish time 17-10-2010 08:51 PM

Reply 13# cloud_hardcore

dh jumpa dalam folder xampp...tp cm xjd je..huhuhu

BorderManager Publish time 17-10-2010 09:57 PM

lepas tukar kena restart service

cloud_hardcore Publish time 20-10-2010 02:16 PM

Reply 15# BorderManager


   dh restart service pn xley...help!!

cloud_hardcore Publish time 20-10-2010 04:50 PM

source code saya ambek kt sini

http://www.softwareforeducation.com/lamp/phpweb/06pie.php

BorderManager Publish time 20-10-2010 11:06 PM

download direct la

php => http://www.php.net/downloads.php
apache => http://httpd.apache.org/download.cgi
mysql => http://www.mysql.com/downloads/mysql/

mosti Publish time 1-11-2010 10:45 AM

ko guna wamp la senang...sekali je semua
Pages: [1]
View full version: Bina Pie Chart using PHP


ADVERTISEMENT