Beispiel #1
0
<?php

/*
 * This work is hereby released into the Public Domain.
 * To view a copy of the public domain dedication,
 * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
 * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
 *
 */
require_once "../Pie.class.php";
$graph = new Graph(400, 250);
$graph->setAntiAliasing(TRUE);
$graph->title->set("Pie (example 17)");
$graph->title->setFont(new Tuffy(14));
$values = array(12, 16, 13, 18, 10, 20, 11);
$plot = new Pie($values, PIE_AQUA);
$plot->setCenter(0.4, 0.55);
$plot->setAbsSize(180, 180);
$plot->setLegend(array('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'));
$explode = array();
for ($i = 0; $i < count($values); $i++) {
    $explode[] = 15;
}
$plot->explode($explode);
$plot->legend->setPosition(1.5);
$plot->legend->shadow->setSize(0);
$graph->add($plot);
$graph->draw();
Beispiel #2
0
<?php

/*
 * This work is hereby released into the Public Domain.
 * To view a copy of the public domain dedication,
 * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
 * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
 *
 */
require_once "../Pie.class.php";
$graph = new Graph(400, 250);
$graph->setAntiAliasing(TRUE);
$graph->title->set("Pie (example 2)");
$values = array(8, 4, 6, 2, 5, 3, 4);
$plot = new Pie($values, PIE_EARTH);
$plot->setCenter(0.4, 0.55);
$plot->setSize(0.7, 0.6);
$plot->set3D(10);
$plot->explode(array(1 => 20, 4 => 26, 0 => 25));
$plot->setLegend(array('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'));
$plot->legend->setPosition(1.3);
$graph->add($plot);
$graph->draw();
 * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
 *
 */
require_once "../../Pie.class.php";
$graph = new Graph(400, 300);
$graph->setTiming(TRUE);
$graph->setAntiAliasing(TRUE);
for ($i = 0; $i < 4; $i++) {
    $x = array();
    for ($j = 0; $j < 6; $j++) {
        $x[] = mt_rand(35, 100);
    }
    $plot = new Pie($x, PIE_DARK);
    $plot->setStartAngle(mt_rand(0, 360));
    $plot->title->set('Pie #' . $i);
    $plot->setSize(0.45, 0.45);
    $plot->setCenter($i % 2 / 2 + 0.2, $i > 1 ? 0.2 : 0.7);
    if (mt_rand(0, 1) === 1) {
        $plot->set3D(15);
    }
    $plot->setBorderColor(new Color(230, 230, 230));
    $plot->explode(array(mt_rand(5, 35), 3 => 8));
    if ($i === 3) {
        $plot->legend->setPosition(1.1, 1.0);
    } else {
        $plot->legend->setTextMargin(8, 0);
        $plot->legend->hide(TRUE);
    }
    $graph->add($plot);
}
$graph->draw();
Beispiel #4
0
<?php

/*
 * This work is hereby released into the Public Domain.
 * To view a copy of the public domain dedication,
 * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
 * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
 *
 */
require_once "../Pie.class.php";
$graph = new Graph(400, 250);
$graph->setAntiAliasing(TRUE);
$graph->title->set("Pie (example 3)");
$values = array(8, 4, 6, 2, 5, 3, 4);
$plot = new Pie($values, PIE_AQUA);
$plot->setCenter(0.4, 0.55);
$plot->setSize(0.7, 0.6);
$plot->set3D(15);
$plot->explode(array(4 => 20, 0 => 30));
$plot->setLegend(array('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'));
$plot->legend->setPosition(1.3);
$plot->legend->setBackgroundColor(new VeryLightGray(30));
$graph->add($plot);
$graph->draw();
<?php

/*
 * This work is hereby released into the Public Domain.
 * To view a copy of the public domain dedication,
 * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
 * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
 *
 */
require_once "../../Pie.class.php";
$graph = new Graph(400, 300);
$graph->setTiming(TRUE);
$graph->setAntiAliasing(TRUE);
$graph->shadow->setSize(10);
$graph->shadow->smooth(TRUE);
$x = array();
for ($j = 0; $j < mt_rand(3, 6); $j++) {
    $x[] = mt_rand(35, 100);
}
$plot = new Pie($x, PIE_DARK);
$plot->setSize(0.8, 0.8);
$plot->setCenter(mt_rand(45, 55) / 100, mt_rand(45, 55) / 100);
$plot->set3D(10);
$plot->setBorderColor(new Color(230, 230, 230));
$plot->explode(array(1 => mt_rand(5, 50), 2 => mt_rand(5, 50), 3 => 12));
$plot->legend->setPadding(10, 10, 10, 10);
$plot->legend->setTextMargin(8, 0);
$plot->legend->hide(TRUE);
$graph->add($plot);
$graph->draw();
Beispiel #6
0
<?php

/*
 * This work is hereby released into the Public Domain.
 * To view a copy of the public domain dedication,
 * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
 * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
 *
 */
require_once "../../Pie.class.php";
$graph = new Graph(300, 175);
$graph->setAntiAliasing(TRUE);
$graph->title->set("Stats");
$graph->title->setFont(new TuffyItalic(16));
$values = array(8, 4, 6, 2, 5, 3, 4);
$plot = new Pie($values, PIE_EARTH);
$plot->setCenter(0.4, 0.55);
$plot->setSize(0.7, 0.6);
$plot->set3D(10);
$plot->explode(array(1 => 14, 4 => 20, 0 => 10));
$plot->setLegend(array('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'));
$plot->legend->setPosition(1.3);
$graph->add($plot);
$graph->draw();