Login   Register  
PHP Classes
elePHPant
Icontem

File: documentation

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Yuriy Rusinov  >  graph2d  >  documentation  >  Download  
File: documentation
Role: Documentation
Content type: text/plain
Description: documentation
Class: graph2d
Generates two dimensional graphic images
Author: By
Last change:
Date: 2003-07-14 08:19
Size: 1,860 bytes
 

Contents

Class file image Download
If you want to see two-dimensional graph of function, this class is written for you!
This class gets some image parameters: type, sizes, left, right, top, bottom indentions,
scales for x and y axis, legends, title and two arrays and make graph of this function.

NOTE: you must have GD installed to use this class .(enable GD2 extension
in you php.ini file .)

Usage:
Initialization
$test_image=new graph2d ($image_type, $width, $height, $left, $top, $right, $bottom,
                          $background_red, $background_green, $background_blue, $background_transparent,
                          $foreground_red, $foreground_green, $foreground_blue, $foreground_transparent);

where 
 $image_type -- type of image such as jpeg, png, etc.
 $width, $height -- sizes of image,
 $left, $top, $right, $bottom -- identions of the image (default value is 0)
 $background_red, $background_green, $background_blue, $background_transparent -- components of background color
 $foreground_red, $foreground_green, $foreground_blue, $foreground_transparent -- components of foreground color

Scaling of axes
$test_image->SetAxisScales ($xmin, $xmax, $xstep, $xskip, $ymin, $ymax, $ystep, $yskip);
 $xmin, $xmax, $xstep, $ymin, $ymax, $ystep -- min, max, step values of the x and y-axis respectively
 $xskip, $yskip -- some labels may be without numbers skip=1 -- all labels are numbered, 2-- even label are numbered, etc.

Draw coordinate system
$test_image->GraphCoord();

Draw numeric arrays
$test_image->Draw ($xarray, $yarray, $red, $green, $blue);
 $xarray -- array of arguments values,
 $yarray -- array of function values,
 $red, $green, $blue -- components of color of this graph

Output
$test_image->ImageOut($filename);
 $filename -- name of output file, default="";

Close
$test_image->Close();

Yuriy Rusinov.