CariDotMy

 Forgot password?
 Register

ADVERTISEMENT

View: 5009|Reply: 18

Bina Pie Chart using PHP

[Copy link]
Post time 14-10-2010 01:53 AM | Show all posts |Read mode
Salam,
Ada sesape yang boleh ajar saya buat pie chart menggunakan php? Sy guna XAMPP utk run apache.
Reply

Use magic Report


ADVERTISEMENT


Post time 14-10-2010 08:26 AM | Show all posts
kena enable GD2 library dulu lepas tu test script n
  1. <?php
  2. $myImage = ImageCreate(300,300);

  3. $white = ImageColorAllocate ($myImage, 255, 255, 255);
  4. $red  = ImageColorAllocate ($myImage, 255, 0, 0);
  5. $green = ImageColorAllocate ($myImage, 0, 255, 0);
  6. $blue = ImageColorAllocate ($myImage, 0, 0, 255);
  7. $lt_red = ImageColorAllocate($myImage, 255, 150, 150);
  8. $lt_green = ImageColorAllocate($myImage, 150, 255, 150);
  9. $lt_blue = ImageColorAllocate($myImage, 150, 150, 255);

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

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

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

  20. ImageDestroy($myImage);
  21. ?>
Copy the Code
Reply

Use magic Report

Post time 14-10-2010 12:06 PM | Show all posts
aku yang malas ni guna google chart api je
Reply

Use magic Report

Post time 14-10-2010 03:07 PM | Show all posts
aku yang malas ni guna google chart api je
kmkd Post at 14-10-2010 12:06



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

Use magic Report

Post time 14-10-2010 04:46 PM | Show all posts
salam ..
sape2 tau camner nk select table from diff server...
Reply

Use magic Report

Post time 14-10-2010 05:07 PM | Show all posts
create new connection
Reply

Use magic Report

Follow Us
 Author| Post time 14-10-2010 07:46 PM | Show all posts
Reply 2# BorderManager


   nk enable GD2 library  tu cmne erk..dah try google tp tak paham...
Reply

Use magic Report

Post time 14-10-2010 09:17 PM | Show all posts
akak guna fusion chart..
tp buat bar chart la..
utk pie chart ada rsnya kot..
Reply

Use magic Report


ADVERTISEMENT


Post time 14-10-2010 09:23 PM | Show all posts
fusionchart ni nmpak interactive skit..
compared to gd2 tu..
skema sgt...( jgn mare ar tuan manager nanti kena jual..)
ni linknya..

klik disini
Reply

Use magic Report

Post time 15-10-2010 08:12 AM | Show all posts
nk enable GD2 library  tu 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
  1. ;extension=php_gd2.dll
Copy the Code
ke
  1. extension=php_gd2.dll
Copy the Code
lepas 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
Reply

Use magic Report

 Author| Post time 17-10-2010 03:29 AM | Show all posts
sory soklan noob..

file php.ini tu kat mane yee??
Reply

Use magic Report

Post time 17-10-2010 01:21 PM | Show all posts
sory soklan noob..

file php.ini tu kat mane yee??
cloud_hardcore Post at 17-10-2010 03:29


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

Use magic Report

 Author| Post time 17-10-2010 08:43 PM | Show all posts
Reply 12# BorderManager


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

Use magic Report

 Author| Post time 17-10-2010 08:51 PM | Show all posts
Reply 13# cloud_hardcore

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

Use magic Report

Post time 17-10-2010 09:57 PM | Show all posts
lepas tukar kena restart service
Reply

Use magic Report

 Author| Post time 20-10-2010 02:16 PM | Show all posts
Reply 15# BorderManager


   dh restart service pn xley...help!!
Reply

Use magic Report


ADVERTISEMENT


 Author| Post time 20-10-2010 04:50 PM | Show all posts
Reply

Use magic Report

Post time 20-10-2010 11:06 PM | Show all posts
Reply

Use magic Report

Post time 1-11-2010 10:45 AM | Show all posts
ko guna wamp la senang...sekali je semua
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

 

ADVERTISEMENT


Forum Hot Topic

 

ADVERTISEMENT


 


ADVERTISEMENT
Follow Us

ADVERTISEMENT


Mobile|Archiver|Mobile*default|About Us|CariDotMy

23-1-2025 08:56 AM GMT+8 , Processed in 0.614597 second(s), 31 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

Quick Reply To Top Return to the list