Quick Search:
 PHP Code: GD barchart demo Jump to:  
Category: >> PHP Code >> GD barchart demo  

<< lastnext >>

Snippet Name: GD barchart demo

Description: This GD barchart demo will display a bar chart based on random values (which you could change to your own more useful values).

Also see:
» Simple image scaling
» Create thumbnails with PHP
» Write text onto an image
» Make grayscaled image
» CAPTCHA with GD Image Library

Comment: (none)

Language: PHP
Highlight Mode: PHP
Last Modified: March 16th, 2009

    //  bars.php3  -  Bar  chart  on  gif  image 
    //  Note:  uses  the  gd  library 
    //  This  code  will  display  a  bar  chart  based  on  random  values 
    //  Different  colors  are  used  to  display  bars  and  a  gif  images 
    //  is  used  for  the  background.  Use  the  following  link  to  include 
    //  the  example  into  your  web-site 
    //  <img  src="./bars.php3"  border="0"> 
    //  The  background  image  can  be  found  at 
    HEADER(  "Content-type:    image/gif");   
    HEADER(  "Expires:    Mon,  17  Aug  1998  12:51:50  GMT");   
    $im  =  imagecreatefromgif( "gradient.gif");   
    //  Allocate  colors 
    //  Determine  size  of  image 
    //  Initialize  random  number  generator 
    //  Create  some  bars 
    $v=RAND();  $v=$v/32768*200; 
    $v=RAND();  $v=$v/32768*200; 
    $v=RAND();  $v=$v/32768*200; 
    $v=RAND();  $v=$v/32768*200; 
    $v=RAND();  $v=$v/32768*200; 
    //  Display  modified  image 
    //  Release  allocated  ressources 

   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org