Sophie

Sophie

distrib > Fedora > 13 > x86_64 > by-pkgid > db91bd759e5a654d607a666031e82ded > files > 50

php-pear-Image-Graph-0.8.0-1.fc13.noarch.rpm

<?php
/**
 * Usage example for Image_Graph.
 * 
 * Main purpose: 
 * Demonstrate how to manually set axis labels
 * 
 * Other: 
 * None specific
 * 
 * $Id: manual_labels.php 192339 2005-08-03 21:22:11Z nosey $
 * 
 * @package Image_Graph
 * @author Jesper Veggerby <pear.nosey@veggerby.dk>
 */

require_once 'Image/Graph.php';

// create the graph
$Graph =& Image_Graph::factory('graph', array(500, 200));
// add a TrueType font
$Font =& $Graph->addNew('font', 'Verdana');
// set the font size to 11 pixels
$Font->setSize(8);

$Graph->setFont($Font);

$Plotarea =& $Graph->addNew('plotarea');
  
$Dataset =& Image_Graph::factory('random', array(8, 1, 10));
$Plot =& $Plotarea->addNew('line', array(&$Dataset));

$LineStyle =& Image_Graph::factory('Image_Graph_Line_Dashed', array('red', 'transparent'));
//$Plot->setLineColor('red');
$Plot->setLineStyle($LineStyle);

$AxisY =& $Plotarea->getAxis('y');
$AxisY->setLabelInterval(array(2, 4, 9));

// output the Graph
$Graph->done();
?>