WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Display a bar chart based on random values.
Categories : Graphics, PHP, GD image library, Charts and Graphs Update Picture
Benjamin Stocker
Date : Jan 17th 1999
Grade : 2 of 5 (graded 8 times)
Viewed : 15950
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Benjamin Stocker
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

Note: this code 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 image is used for the background. Use the following link to include
the example in your web-page: <img src="./bars.php3" border="0"> The
background image can be found at www.oron.ch/php/gradient.gif


<?

// bars.php3 - Bar chart on gif image
// Author: Benjamin Stocker <BenjaminS@n-s.ch>
// Version: 1.0
// 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
// www.oron.ch/php/gradient.gif


Header( "Content-type: image/gif");
Header( "Expires: Mon, 17 Aug 1998 12:51:50 GMT");

$im = imagecreatefromgif( "gradient.gif");

// Allocate colors
$red=ImageColorAllocate($im,255,0,0);
$green=ImageColorAllocate($im,0,255,0);
$blue=ImageColorAllocate($im,0,0,255);
$yellow=ImageColorAllocate($im,255,255,0);
$cyan=ImageColorAllocate($im,0,255,255);

// Determine size of image
$x=imagesx($im);
$y=imagesy($im);

// Initialize random number generator
srand(mktime());

// Create some bars
$v=rand(); $v=$v/32768*200;
ImageFilledRectangle($im,10,200-$v,60,200,$red);
$v=rand(); $v=$v/32768*200;
ImageFilledRectangle($im,70,200-$v,120,200,$green);
$v=rand(); $v=$v/32768*200;
ImageFilledRectangle($im,130,200-$v,180,200,$blue);
$v=rand(); $v=$v/32768*200;
ImageFilledRectangle($im,190,200-$v,240,200,$yellow);
$v=rand(); $v=$v/32768*200;
ImageFilledRectangle($im,250,200-$v,300,200,$cyan);

// Display modified image
ImageGif($im);
// Release allocated ressources
ImageDestroy($im);
?>



Simple class that uses GD to draw pie charts. After the class definition there's some sample code to demonstrate how you use the class.
Categories : Graphics, PHP, PHP Classes, GD image library, Charts and Graphs
a simple pie-chart in php3 (with gd)
Categories : PHP, Graphics, GD image library, Charts and Graphs
3dLib - a class for drawing in 3D space. Supported functions: Line, SetPixel, Polygon, FilledPolygon, etc. 3dChart() function has been added for one-call drawing of 3d charts. Support of mostly used 3d-transformations.
Categories : Graphics, Math., PHP Classes, PHP, Charts and Graphs
crop and resize image class using gd library function
Categories : PHP, PHP Classes, GD image library, Graphics
HTML_Graphs provides a simple PHP interface for creating pure HTML charts.
Categories : Graphics, PHP, PHP Classes, Charts and Graphs
Generate image with random number (CAPTCHA)
Categories : PHP, GD image library, Graphics, Security
Create a Thumbnail Using PHP, GD and Exif
Categories : PHP, Graphics, Exif, GD image library
Create Thumbnails - resize an image - jpeg, jpg, gif, png to the specifed width and height in proportion without loosing out on pixcel quality.
Categories : PHP, GD image library, Graphics
PHP Email image generator - hide your email from bots - using the GD Library
Categories : PHP, Graphics, GD image library, Beginner Guides
How to create charts for php using Rchart
Categories : PHP, Java, JSP, Graphics, Charts and Graphs
Advanced Image WaterMarker
Categories : PHP, PHP Classes, GD image library, Graphics, Object Oriented
PHP interface class to the eBusiness Charts generatation remote service.
Categories : PHP, PHP Classes, Graphics, Charts and Graphs
Simple PHP Bar Graph using GD library
Categories : PHP, GD image library, Graphics, Arrays
Annual Bar Chart
Categories : Graphics, PHP, Charts and Graphs
Image Generation Class ( PNG Format )
Categories : PHP, GD image library, PHP Classes, Graphics