PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of Jonas Schneider   SVG Graph   test.php   Download  
File: test.php
Role: Example script
Content type: text/plain
Description: Simple example script, not yet works
Class: SVG Graph
Generate various types of charts in SVG format
Author: By
Last change:
Date: 19 years ago
Size: 675 bytes
 

Contents

Class file image Download
<?PHP
/**
* Test case for the {@link Chart} class.
* @package Chart_Tests
*/
require_once("Chart.php");

PEAR::setErrorHandling(PEAR_ERROR_DIE);


$data = array(new Chart_Data(50, "Kleiner"), new Chart_Data(150, "Mittel"), new Chart_Data(250, "Sehr groß"), new Chart_Data(20, "Furchtbar tiny"),);

$chart = new Chart($data);
$content = $chart->get("pie", array("x" => 100, "y" => 100, "legend" => ""));
$content .= $chart->get("bar_across", array("x" => 500, "y" => 200));
$content = $chart->encapsulate($content);

$fh = fopen("temp.svg", "w");
fwrite($fh, $content);
fclose($fh);
?>
<embed src="temp.svg" width="1300" height="450" type="image/svg-xml">