Login   Register  
PHP Classes
elePHPant
Icontem

File: samples/sample1.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of David Frendin  >  TinyPie  >  samples/sample1.php  >  Download  
File: samples/sample1.php
Role: Example script
Content type: text/plain
Description: Creating various sized pies
Class: TinyPie
Generate pie charts as images embedded in HTML
Author: By
Last change: changed description
Date: 2011-12-21 04:58
Size: 754 bytes
 

Contents

Class file image Download
<?php
include('../lib/TinyPie.php');
?>
<html>
<body>

<a href="index.php">&lt;&lt;&nbsp;Back to list</a>

<fieldset>
<legend>1. Demo "full" graph, 50/50 various sizes</legend>
<?php
$g 
= new TinyPie(256);
$g->AddValue(50'CC0000');
$g->AddValue(50'555555');
echo 
$g->GetAsImg();

$g = new TinyPie(128);
$g->AddValue(50'CC0000');
$g->AddValue(50'555555');
echo 
$g->GetAsImg();

$g = new TinyPie(64);
$g->AddValue(50'CC0000');
$g->AddValue(50'555555');
echo 
$g->GetAsImg();

$g = new TinyPie(32);
$g->AddValue(50'CC0000');
$g->AddValue(50'555555');
echo 
$g->GetAsImg();

$g = new TinyPie(16);
$g->AddValue(50'CC0000');
$g->AddValue(50'555555');
echo 
$g->GetAsImg();
?>
</fieldset>

</body>
</html>