Location: PHPKode > projects > TVEz - Media Library > tvez-0.2.1/html/shared/Graph/pie_chart3d.php
<?php

# -----------------------------------------------------------------------------
#
# Wrapper for the PieChart class
#
# Parses the query string and outputs an image
#
# -----------------------------------------------------------------------------
#
# Copyright (C) 2004 Christian Eheim
#
# This file is part of TVEz (tvez.sourceforge.net).
#
# TVEz is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# TVEz is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with TVEz; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# -----------------------------------------------------------------------------
#
# Created on 02/01/2004 by Christian Eheim (hide@address.com)
#
# LAST MODIFIED:
# $Date: 2004/02/03 23:22:00 $
# $Revision: 1.1 $
# $Author: eheim $
#
# -----------------------------------------------------------------------------

$data  = urldecode($_GET['data']);

$title = null;
$width = 400;
$height = 250;

if (isset($_GET['title'])) $title = $_GET['title'];
if (isset($_GET['height'])) $height = $_GET['height'];
if (isset($_GET['width'])) $width = $_GET['width'];

$items = explode("^^", $data);

include("../../shared/Graph/PieChart3d.php");

$plot = new PieChart3d($width,$height,$title);

while (list($key,$item) = each($items)) {
	if ($item) {
	 $pos = strpos($item, "^");
	 $label = substr($item, 0, $pos);
	 $value = substr($item, $pos + 1, strlen($item));

	$plot->add_data_value($label,$value);
	}
}

$plot->set_theme("pastel");

    $plot->show_pieborder(false);
    $plot->show_sliceborder(false);
    $plot->legend_show(true);
	$plot->set_legend_font(1);
	$plot->set_label_font(1);

$plot->draw();
Return current item: TVEz - Media Library