Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Er. Rochak Chauhan  >  Data to Graph  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example file
Class: Data to Graph
Generate bar charts from arrays of data
Author: By
Last change:
Date: 2005-12-19 04:23
Size: 649 bytes
 

Contents

Class file image Download
<?php
    
/**
     * Example script
     * 
     */
    // initialize data
    
$x 'Sale';
    
$y "Years";
    
    
$x_dataArray = array(
                        
"4091",
                        
"1311",
                        
"2491",
                        
"9091",
                        
"2091"
                        
);
    
$y_dataArray = array(
                        
"1960",
                        
"1970",
                        
"1980",
                        
"1990",
                        
"2000"
                        
);
                        
    
// actual code using CodeToGraph Class (PHP 5 ONLY)                            
    
try {    
        require_once(
"DataToGraph.inc.php");
        
$dataToGraph = new DataToGraph($x$y$x_dataArray$y_dataArray);
        
$imageCode $dataToGraph->displayImage(800600);        
        
        echo 
$imageCode;
    }
    catch (
Exception $e) {
        echo 
$e->getMessage();
    }
    
?>