Login   Register  
PHP Classes
elePHPant
Icontem

File: test08.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Herman Veluwenkamp  >  Graph Drawing Class 2  >  test08.php  >  Download  
File: test08.php
Role: Example script
Content type: text/plain
Description: Numeric X Axis with Zero-Axis
Class: Graph Drawing Class 2
Class to draw line, point, area, and bar graphs.
Author: By
Last change:
Date: 13 years ago
Size: 1,992 bytes
 

Contents

Class file image Download
<?php
include 'graph.php';

$graph = new graph(400,240);
$graph->parameter['path_to_fonts'] = 'fonts/'// path to where fonts are stored
$graph->parameter['title']        = 'Numeric X Axis with Zero-Axis';
$graph->parameter['x_label']      = 'Some Value';
$graph->parameter['y_label_left'] = 'Offset';

$graph->x_data                 = array(-4,  -1,  4,  6,  9,  14);
$graph->y_data['alpha']        = array(2, -1,  3,  5,  8,  9);
$graph->y_data['beta']         = array(32,  -4, -3,  1,  5);

//$graph->y_data['beta'] = array(3, 2,   0,  0,  0,  5);

// format for each data set
$graph->y_format['alpha']             =  array('colour' => 'blue''line' => 'brush');
$graph->y_format['beta']              =  array('colour' => 'red',  'line' => 'brush');

$graph->parameter['shadow']           = 'grayCC'// set default shadow for all data sets.
$graph->parameter['bar_size']         = 0.9;
$graph->parameter['bar_spacing']      = 30;

$graph->parameter['y_min_left']       = -4;
$graph->parameter['y_max_left']       = 10;
$graph->parameter['y_decimal_left']   = 0;
$graph->parameter['y_axis_gridlines'] = 15;

$graph->parameter['x_axis_gridlines'] = 19;
$graph->parameter['x_offset']         = 0;

$graph->parameter['x_axis_angle']     =  0;

$graph->parameter['x_axis_text']      =  2// print every other tick on x axis
$graph->parameter['y_axis_text_left'] =  2// print every other tick on left y axis
$graph->parameter['tick_length']      = -2// tick is drawn pointing outside the plotting area
$graph->parameter['x_ticks_colour']   = 'none'// no x ticks (colour = 'none')

$graph->parameter['zero_axis']        = 'black';
$graph->parameter['inner_border_type']= 'y-left'// only draw left y axis as zero axis already selected above.

$graph->parameter['y_label_angle']     = 90// rotate y_label text.

$graph->y_order = array('alpha''beta');
//$graph->y_order = array('beta');
$graph->draw();
//$graph->draw_stack();


?>