public function gpastel_getImagen($titulo = " ", $width = "500", $height = "350")
 {
     $config = XTConfig::singleton();
     $data = $this->pastel_data;
     $nombreimagen = uniqid() . "pieimagen.png";
     $file = $config->get("XTSITE_PATH_ABSOLUTE") . "tmp/pie/" . $nombreimagen;
     $file_url = $config->get("XTSITE_PATH") . "tmp/pie/" . $nombreimagen;
     $graph = new PHPGraphLibPie($width, $height, $file);
     $graph->addData($data);
     $graph->setTitle($titulo);
     $graph->setLabelTextColor('50,50,50');
     $graph->setLegendTextColor('50,50,50');
     $graph->createGraph();
     print "<img src=\"{$file_url}\">";
 }
Example #2
0
<?php

include '../phpgraphlib.php';
include '../phpgraphlib_pie.php';
$graph = new PHPGraphLibPie(400, 200);
$data = array("CBS" => 6.3, "NBC" => 4.5, "FOX" => 2.8, "ABC" => 2.7, "CW" => 1.4);
$graph->addData($data);
$graph->setTitle('8/29/07 Top 5 TV Networks Market Share');
$graph->setLabelTextColor('50, 50, 50');
$graph->setLegendTextColor('50, 50, 50');
$graph->createGraph();
Example #3
0
<?php

error_reporting(0);
include "phpgraphlib.php";
include "phpgraphlib_pie.php";
$showsmall = $_GET['showsmall'];
$datavalues = $_GET['datavalues'];
$header = unserialize(urldecode(stripslashes($_GET['header'])));
$data = unserialize(urldecode(stripslashes($_GET['mydata'])));
if ($showsmall) {
    $graph = new PHPGraphLibPie(300, 200);
} else {
    $graph = new PHPGraphLibPie(500, 300);
}
if ($datavalues) {
    $graph->setDataValues(true);
} else {
    $graph->setDataValues(false);
}
$graph->addData($data);
$graph->setTitle($header);
$graph->setLabelTextColor("blue");
$graph->createGraph();
                 }
                 // now build an unassigned list
                 $sql['hosts'] = "SELECT * FROM `conf_hosts` WHERE `subnet-name` IS NULL OR `subnet-name` = ''";
                 if (($value = $db->dbQuery($val->ValidateSQL($sql['hosts'], $dbconn), $dbconn)) !== -1) {
                     $hostdata['unassigned'] = $db->dbArrayResults($value);
                 }
                 // generate our graphs but check for gd lib extensions first
                 if (function_exists('imagedestroy')) {
                     $graph = new PHPGraphLibPie(450, 200);
                     foreach ($hostdata as $key => $value) {
                         $array[$key] = count($value);
                         $total = $total + count($value);
                     }
                     $graph->addData($array);
                     $graph->setTitle("Hosts to Subnet Assignments: Total static hosts #" . $total);
                     $graph->setLabelTextColor("50, 50, 50");
                     $graph->setLegendTextColor("50, 50, 50");
                     $graph->setLegendOutlineColor("black");
                     $graph->createGraph();
                 }
             }
         } else {
             // page view restricted by access level
             $ERROR = $err->GenerateErrorLink("help/help.html", "#undef", $defined['error'], $errors['level']);
         }
     } else {
         // general authentication error
         $ERROR = $err->GenerateErrorLink("help/help.html", "#undef", $defined['error'], $errors['auth_n']);
     }
 } else {
     // Possible XSS attack