PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Diogo Resende   Bar Graph generator   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Another example not using any definition file
Class: Bar Graph generator
Generates bar graphs from file definitions
Author: By
Last change:
Date: 19 years ago
Size: 379 bytes
 

Contents

Class file image Download
<?php
 
include "class.bargraph.php";
 
 
$g = new BarGraph();
 
$data = array();
  for (
$i = 0; $i < 7; $i++) {
   
$data[chr(ord('a') + $i)] = 1 + $i;
  }
 
  for (
$i = 0; $i < 6; $i++) {
   
$data[chr(ord('h') + $i)] = 6 - $i;
  }
 
$g->SetGraphPadding(20, 30, 20, 15);
 
$g->SetBarData($data);
 
$g->SetGraphTitle("BarGraph Test");

 
$g->DrawGraph();
?>