本文整理汇总了PHP中PiePlot3d::SetSize方法的典型用法代码示例。如果您正苦于以下问题:PHP PiePlot3d::SetSize方法的具体用法?PHP PiePlot3d::SetSize怎么用?PHP PiePlot3d::SetSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PiePlot3d
的用法示例。
在下文中一共展示了PiePlot3d::SetSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* @@生成三维饼图
* @param string $title
* @param array $data
* @param int $size
* @param int $height
* @param int $width
* @param array $legend
*/
static function create3dpie($title, $data = array(), $size = 40, $height = 100, $width = 80, $legend = array(), $slice = 0)
{
//包含相关的文件
vendor("Jpgraph.jpgraph");
vendor("Jpgraph.jpgraph_pie");
vendor("Jpgraph.jpgraph_pie3d");
// 创建图表
$graph = new PieGraph($width, $height, "auto");
$graph->SetShadow();
// 设置标题
$graph->title->Set(iconv("utf-8", "gb2312", $title));
//$graph->title->SetFont(FF_VERDANA,FS_BOLD,18);
$graph->title->SetFont(FF_SIMSUN, FS_BOLD, 18);
$graph->title->SetColor("darkblue");
$graph->legend->Pos(0.1, 0.2);
$graph->SetFrame(false, '#ffffff', 0);
//去掉周围的边框
// Create 3D pie plot
$p1 = new PiePlot3d($data);
$p1->SetTheme("sand");
$p1->SetCenter(0.4);
$p1->SetSize($size);
// Adjust projection angle
$p1->SetAngle(70);
// As a shortcut you can easily explode one numbered slice with
if ($slice == 0) {
$p1->ExplodeSlice(3);
}
// Setup the slice values
$p1->value->SetFont(FF_ARIAL, FS_BOLD, 10);
//$p1->value->SetFont(FF_SIMSUN,FS_BOLD,11);
$p1->value->SetColor("navy");
$graph->legend->SetFont(FF_SIMSUN, FS_BOLD, 8);
//编码转化
foreach ($legend as $k => $v) {
$legend[$k] = iconv('utf-8', 'gb2312', $v);
}
$p1->SetLegends($legend);
$graph->Add($p1);
$graph->Stroke();
}
示例2: array
require_once 'jpgraph/jpgraph_pie3d.php';
// Some data
$data = array(20, 27, 45, 75, 90);
// Create the Pie Graph.
$graph = new PieGraph(350, 200);
$graph->SetShadow();
// Set A title for the plot
$graph->title->Set("Example 2 3D Pie plot");
$graph->title->SetFont(FF_VERDANA, FS_BOLD, 18);
$graph->title->SetColor("darkblue");
$graph->legend->Pos(0.1, 0.2);
// Create 3D pie plot
$p1 = new PiePlot3d($data);
$p1->SetTheme("sand");
$p1->SetCenter(0.4);
$p1->SetSize(0.4);
$p1->SetHeight(5);
// Adjust projection angle
$p1->SetAngle(45);
// You can explode several slices by specifying the explode
// distance for some slices in an array
$p1->Explode(array(0, 40, 0, 30));
// As a shortcut you can easily explode one numbered slice with
// $p1->ExplodeSlice(3);
$p1->value->SetFont(FF_ARIAL, FS_NORMAL, 10);
$p1->SetLegends(array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct"));
$graph->Add($p1);
$graph->Stroke();
?>
示例3: array
include "../jpgraph_pie.php";
include "../jpgraph_pie3d.php";
// Some data
$data = array(20, 27, 45, 75, 90);
// Create the Pie Graph.
$graph = new PieGraph(350, 200, "auto");
$graph->SetShadow();
// Set A title for the plot
$graph->title->Set("Example 3 3D Pie plot");
$graph->title->SetFont(FF_VERDANA, FS_BOLD, 18);
$graph->title->SetColor("darkblue");
$graph->legend->Pos(0.1, 0.2);
// Create 3D pie plot
$p1 = new PiePlot3d($data);
$p1->SetTheme("sand");
$p1->SetCenter(0.4);
$p1->SetSize(80);
// Adjust projection angle
$p1->SetAngle(45);
// As a shortcut you can easily explode one numbered slice with
$p1->ExplodeSlice(3);
// Setup the slice values
$p1->value->SetFont(FF_ARIAL, FS_BOLD, 11);
$p1->value->SetColor("navy");
$p1->SetLegends(array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct"));
$graph->Add($p1);
$graph->Stroke();
?>
示例4: displayGraph
//.........这里部分代码省略.........
$lineplot->SetFillColor($G_ARR_COLOR[$num]);
}
$lineplot->SetColor($G_ARR_COLOR[$num]);
$lineplot->SetWeight($G_WEIGHT);
$lineplot->SetLegend($G_ARR_LEYEND[$num]);
$arr_lineplot[] = $lineplot;
}
foreach ($arr_lineplot as $num => $yDatas) {
$graph->Add($yDatas);
}
if (sizeof($xData) > 100) {
$graph->xaxis->SetTextTickInterval((int) (sizeof($xData) / 10));
}
$graph->Stroke();
} else {
if ($G_TYPE == 'plot3d') {
$graph = new PieGraph($G_SIZE[0], $G_SIZE[1], "auto");
if ($G_SHADOW) {
$graph->SetShadow();
}
$dataMarginColor = isset($result["ATTRIBUTES"]["MARGIN_COLOR"]) ? $result["ATTRIBUTES"]["MARGIN_COLOR"] : "#999999";
$dataSizePie = isset($result["ATTRIBUTES"]["SIZE_PIE"]) ? $result["ATTRIBUTES"]["SIZE_PIE"] : "80";
$graph->SetMarginColor($G_COLOR);
$graph->SetFrame(true, $dataMarginColor);
$graph->legend->Pos($G_LEYEND_POS[0], $G_LEYEND_POS[1], "right", "center");
$graph->legend->SetFillColor("#fafafa");
$graph->legend->SetColor("#444444", "#999999");
$graph->legend->SetShadow('gray@0.6', 4);
$graph->legend->SetColumns($G_LEYEND_NUM_COLUMN);
$graph->title->Set($G_TITLE);
$pieplot3d = new PiePlot3d($G_YDATAS[0]);
$pieplot3d->SetSliceColors($G_ARR_COLOR);
$pieplot3d->SetCenter(0.4);
$pieplot3d->SetSize($dataSizePie);
$pieplot3d->SetAngle(45);
$pieplot3d->SetStartAngle(45);
$pieplot3d->value->SetColor('black');
//color a los porcentages
$pieplot3d->SetEdge('black');
//da color al contorno y separacion del pastel
$pieplot3d->SetLegends($xData);
$graph->Add($pieplot3d);
$graph->Stroke();
} else {
if ($G_TYPE == 'plot3d2') {
if (!function_exists('displayGraph_draw_pie3d')) {
function displayGraph_draw_pie3d($canvasx, $ydata, $arrcolor)
{
$canvasy = $canvasx;
$escala = $canvasx / 320.0;
$iAnchoPastel = 256 * $escala;
$iAltoPastel = 155 * $escala;
$iPosCentroX = 141 * $escala;
$iPosCentroY = 91 * $escala;
$thumb = imagecreatetruecolor($canvasx * 284 / 320, $canvasy * 250 / 320);
$transparent = imagecolorallocatealpha($thumb, 200, 200, 200, 127);
imagefill($thumb, 0, 0, $transparent);
// Asignar colores de imagen
$imgcolor = array();
foreach ($arrcolor as $i => $sHtmlColor) {
$r = $g = $b = 0;
sscanf($sHtmlColor, "#%02x%02x%02x", $r, $g, $b);
$imgcolor[$i] = imagecolorallocate($thumb, $r, $g, $b);
}
$colorTexto = imagecolorallocate($thumb, 0, 0, 0);
// Mostrar el gráfico de pastel
示例5: PieGraph
// Setup graph
$graph = new PieGraph(400, 400, "auto");
$graph->SetAntiAliasing();
$graph->SetMarginColor('#fafafa');
//$graph->SetShadow();
// Setup graph title
if ($type == "event") {
//$graph->title->Set(gettext("EVENTS RECEIVED"));
} elseif ($type == "alarm") {
//$graph->title->Set(gettext("ALARMS RECEIVED"));
}
$graph->title->SetFont(FF_FONT1, FS_BOLD);
// Create pie plot
$p1 = new PiePlot3d($data);
$p1->SetHeight(12);
$p1->SetSize(0.3);
if (count($labels) > 1) {
$p1->SetCenter(0.5, 0.25);
} else {
$p1->SetCenter(0.57, 0.25);
}
$p1->SetLegends($legend);
$p1->SetLabels($labels);
$p1->SetLabelPos(1);
$graph->legend->SetPos(0.5, 0.95, 'center', 'bottom');
$graph->legend->SetShadow('#fafafa', 0);
$graph->legend->SetFrameWeight(0);
$graph->legend->SetFillColor('#fafafa');
$graph->SetFrame(false);
$p1->SetSliceColors($colors);
//$p1->SetStartAngle(M_PI/8);
示例6: print_graph
//.........这里部分代码省略.........
if ($longestlabel && !$overlap) {
// if legend showing
$pmr = $longestlabel * 5 + 40;
}
$graph->legend->Pos(0.02, 0.1, 'right', 'top');
}
}
}
}
}
// DRAW THE GRAPHS
if ($type == 'pie') {
$p1 = new PiePlot($data[0]);
$p1->SetSliceColors($colours);
if ($show_values) {
$p1->value->SetFont(FF_USERFONT, FS_NORMAL, 8 * $k);
if ($percent) {
$p1->SetLabelType(PIE_VALUE_PERADJ);
} else {
$p1->SetLabelType(PIE_VALUE_ABS);
}
if ($percent || $show_percent) {
$p1->value->SetFormat("%d%%");
} else {
$p1->value->SetFormat("%s");
}
// Enable and set policy for guide-lines. Make labels line up vertically
$p1->SetGuideLines(true);
$p1->SetGuideLinesAdjust(1.5);
} else {
$p1->value->Show(false);
}
$p1->SetLegends($legends);
$p1->SetSize($psize);
$p1->SetCenter($pposx, $pposy);
if ($labels[0]) {
$graph->subtitle->Set($labels[0]);
$graph->subtitle->SetMargin(10 * $k);
$graph->subtitle->SetFont(FF_USERFONT, FS_BOLD, 11 * $k);
$graph->subtitle->SetColor("black");
}
$graph->Add($p1);
} else {
if ($type == 'pie3d') {
$p1 = new PiePlot3d($data[0]);
$p1->SetSliceColors($colours);
if ($show_values) {
$p1->value->SetFont(FF_USERFONT, FS_NORMAL, 8 * $k);
if ($percent) {
$p1->SetLabelType(PIE_VALUE_PERADJ);
} else {
$p1->SetLabelType(PIE_VALUE_ABS);
}
if ($percent || $show_percent) {
$p1->value->SetFormat("%d%%");
} else {
$p1->value->SetFormat("%s");
}
} else {
$p1->value->Show(false);
}
$p1->SetLegends($legends);
$p1->SetEdge();
$p1->SetSize($psize);
$p1->SetCenter($pposx, $pposy);
if ($labels[0]) {
示例7: PieGraph
$i++;
}
// Start Graphing ---------------------------->
// Create the graph.
$graph = new PieGraph(550, 200);
$graph->SetShadow();
// Set A title for the plot
$graph->title->Set(gettext("Total by Fund for") . " {$sDate}");
$graph->title->SetFont(FF_FONT1, FS_BOLD, 16);
$graph->title->SetColor("darkblue");
$graph->legend->Pos(0.02, 0.15);
// Create the bar plot
$p1 = new PiePlot3d($totals);
$p1->SetTheme("sand");
$p1->SetCenter(0.285);
$p1->SetSize(85);
// Adjust projection angle
$p1->SetAngle(45);
// Adjsut angle for first slice
$p1->SetStartAngle(315);
// As a shortcut you can easily explode one numbered slice with
//$p1->ExplodeSlice(1);
// Use absolute values (type==1)
$p1->SetLabelType(PIE_VALUE_ABS);
// Display the slice values
$p1->value->SetFormat($aLocaleInfo["currency_symbol"] . ' %d');
$p1->value->Show();
// Set font for legend
$p1->value->SetFont(FF_FONT1, FS_NORMAL, 12);
$p1->SetLegends($funds);
// Add the plots to the graph
示例8: array
// Some data
$data = array($balance, $total);
//$data = $findata;
// Create the Pie Graph.
$graph = new PieGraph(200, 170, "auto");
// Set A title for the plot
$graph->title->Set($title);
$graph->title->SetFont(FF_TIMES, FS_BOLD, 16);
$graph->title->SetColor("darkgray");
$graph->legend->Pos(0.075, 0.2);
$graph->SetFrame(false);
// Create 3D pie plot
$p1 = new PiePlot3d($data);
$p1->SetSliceColors(array('#5CD900', '#6666FF'));
$p1->SetCenter(0.45, 0.65);
$p1->SetSize(70);
// Adjust projection angle
$p1->SetAngle(45);
// Adjsut angle for first slice
$p1->SetStartAngle(80);
// Display the slice values
$p1->value->SetFont(FF_TIMES, FS_BOLD, 11);
$p1->value->SetColor("navy");
// Add colored edges to the 3D pie
// NOTE: You can't have exploded slices with edges!
$p1->SetEdge("navy");
$p1->SetLabelType(PIE_VALUE_ABS);
$p1->value->SetFormat('$%d');
$p1->SetLabels(array($balance, $total), 1);
$p1->SetLabelPos(0.3);
$p1->SetLegends(array($label1, $label2));
示例9: ejecutarGrafico
function ejecutarGrafico($value_criteria, $date_start, $date_end)
{
global $arrLang;
$data_graph = leerDatosGrafico($value_criteria, $date_start, $date_end);
if (count($data_graph["values"]) > 0) {
// Create the Pie Graph.
$graph = new PieGraph(630, 220, "auto");
$graph->SetMarginColor('#fafafa');
$graph->SetFrame(true, '#999999');
$graph->legend->SetFillColor("#fafafa");
$graph->legend->SetColor("#444444", "#999999");
$graph->legend->SetShadow('gray@0.6', 4);
// Set A title for the plot
$graph->title->Set(utf8_decode($data_graph["title"]));
$graph->title->SetColor("#444444");
$graph->legend->Pos(0.1, 0.2);
// Create 3D pie plot
$p1 = new PiePlot3d($data_graph["values"]);
$p1->SetCenter(0.4);
$p1->SetSize(100);
// Adjust projection angle
$p1->SetAngle(60);
// Adjsut angle for first slice
$p1->SetStartAngle(45);
// Display the slice values
$p1->value->SetColor("black");
// Add colored edges to the 3D pie
// NOTE: You can't have exploded slices with edges!
$p1->SetEdge("black");
$p1->SetLegends($data_graph["legend"]);
$graph->Add($p1);
$graph->Stroke();
} else {
$graph = new CanvasGraph(630, 220, "auto");
$title = new Text(utf8_decode($data_graph["title"]));
$title->ParagraphAlign('center');
$title->SetFont(FF_FONT2, FS_BOLD);
$title->SetMargin(3);
$title->SetAlign('center');
$title->Center(0, 630, 110);
$graph->AddText($title);
$t1 = new Text(utf8_decode($arrLang["No records found"]));
$t1->SetBox("white", "black", true);
$t1->ParagraphAlign("center");
$t1->SetColor("black");
$graph->AddText($t1);
$graph->img->SetColor('navy');
$graph->img->SetTextAlign('center', 'bottom');
$graph->img->Rectangle(0, 0, 629, 219);
$graph->Stroke();
/*
//no hay datos - por ahora muestro una imagen en blanco con mensaje no records found
header('Content-type: image/png');
$titulo=utf8_decode($data_graph["title"]);
$im = imagecreate(630, 220);
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 10, 5, 5, $titulo. " - No records found", $text_color);
imagepng($im);
imagedestroy($im);*/
}
}
示例10: PieGraph
// Include JPGraph library and the bar graph drawing module
LoadLib_JPGraph(pie, pie3d);
// Start Graphing ---------------------------->
// Create the graph.
$graph = new PieGraph(325, 260);
//$graph->SetShadow();
// Set A title for the plot
$graph->title->Set(gettext("Grafik Persentase Sektor"));
$graph->title->SetFont(FF_FONT1, FS_BOLD, 10);
$graph->title->SetColor("darkblue");
$graph->legend->Pos(0.02, 0.15);
// Create the bar plot
$p1 = new PiePlot3d($totals);
$p1->SetTheme("sand");
$p1->SetCenter(0.24);
$p1->SetSize(50);
// Adjust projection angle
$p1->SetAngle(90);
// Adjsut angle for first slice
$p1->SetStartAngle(315);
// As a shortcut you can easily explode one numbered slice with
//$p1->ExplodeSlice(1);
// Use absolute values (type==1)
$p1->SetLabelType(PIE_VALUE_ABS);
// Display the slice values
//$p1->value->SetFormat('%d');
$p1->value->Show();
// Set font for legend
$p1->value->SetFont(FF_FONT1, FS_NORMAL, 12);
$p1->SetLegends($BPK);
// Add the plots to the graph
示例11: PieGraph
$graph = new PieGraph(400, 250, "auto");
#$graph->SetAntiAlias(true);
$graph->title->Set("");
$graph->legend->Pos(0.1, 0.1);
$p1 = new PiePlot3d($data);
$p1->SetSliceColors(array('#333333', '#333333'));
$p1->SetCenter(0.4);
$p1->SetSize(90);
$p1->SetAngle(45);
$p1->value->SetColor("#666666");
$p1->SetLegends(explode(",", "" . $key . ""));
$graph->Add($p1);
$graph->Stroke();
} else {
$value = "" . ($quota - $_GET['used']) . "," . $_GET['used'] . "";
$key = "Free space: (" . FormatFileSize($diplayquota - $_GET['used']) . "),Used space: (" . FormatFileSize($_GET['used']) . ")";
$data = explode(",", "" . $value . "");
$graph = new PieGraph(400, 250, "auto");
#$graph->SetAntiAlias(true);
$graph->title->Set("");
$graph->legend->Pos(0.1, 0.1);
$p1 = new PiePlot3d($data);
$p1->SetSliceColors(array('#039ACA', '#333333'));
$p1->SetCenter(0.4);
$p1->SetSize(90);
$p1->SetAngle(45);
$p1->value->SetColor("#666666");
$p1->SetLegends(explode(",", "" . $key . ""));
$graph->Add($p1);
$graph->Stroke();
}
示例12: piePlot
private function piePlot($question, $datax, $datay, $width, $height)
{
include_once BASE . "jpgraph.php";
include_once BASE . "jpgraph_pie.php";
include_once BASE . "jpgraph_pie3d.php";
// Create the Pie Graph.
$graph = new PieGraph($width, $height, "auto");
$graph->SetShadow();
// Set A title for the plot
$tFontSize = 11;
$graph->title->Set($question);
$graph->title->SetFont(FF_VERDANA, FS_BOLD, $tFontSize);
$graph->title->SetColor("darkblue");
$graph->SetAntiAliasing(true);
$graph->legend->SetPos(0.02, 0.95, 'right', 'bottom');
$graph->legend->SetMarkAbsSize(5);
$graph->legend->SetFont(FF_ARIAL, FS_NORMAL, 9);
$tWidth = $graph->title->GetWidth($graph->img);
//if ($graph->title->GetWidth($graph->img)>$width) $graph->title->SetFont(FF_VERDANA, FS_BOLD, $tFontSize-2);
if ($tWidth > $width) {
$index = strrpos(substr($question, 0, ($len = strlen($question)) / 2 + 5), ' ');
//echo $index;
if ($index === false) {
$index = $len / 2 - 3;
}
$question[$index] = "\n";
$graph->title->SetFont(FF_VERDANA, FS_BOLD, $tFontSize -= 2);
$graph->title->Set($question);
}
// Create pie plot
$pie = new PiePlot3d($datay);
$pie->SetTheme("sand");
$pie->SetCenter(0.5, 0.4);
$pie->SetSize(($t = $height * 0.005 / $this->amountOfVariants) > 0.5 ? 0.5 : $t);
$pie->SetAngle(30);
$pie->ExplodeAll(5);
$pie->value->SetFont(FF_ARIAL, FS_NORMAL, 10);
$pie->SetLegends($datax);
$graph->Add($pie);
return $graph->Stroke("images/raporty/{$this->id_pytanie}P.png");
}
示例13: array
//
$conf = $GLOBALS["CONF"];
$colors = array("#E9967A", "#F08080", "#FF6347", "#FF4500", "#FF0000", "#DC143C", "#B22222");
$jpgraph = $conf->get_conf("jpgraph_path");
require_once "{$jpgraph}/jpgraph.php";
require_once "{$jpgraph}/jpgraph_pie.php";
require_once "{$jpgraph}/jpgraph_pie3d.php";
// Setup graph
$graph = new PieGraph(350, 420, "auto");
$graph->SetAntiAliasing();
$graph->SetMarginColor('#fafafa');
$graph->title->SetFont(FF_FONT1, FS_BOLD);
// Create pie plot
$p1 = new PiePlot3d($data);
$p1->SetHeight(12);
$p1->SetSize(0.5);
if (count($labels) > 1) {
$p1->SetCenter(0.5, 0.25);
} else {
$p1->SetCenter(0.57, 0.25);
}
$p1->SetLegends($legend);
$p1->SetLabels($labels);
$p1->SetLabelPos(1);
$graph->legend->SetPos(0.5, 0.95, 'center', 'bottom');
$graph->legend->SetShadow('#fafafa', 0);
$graph->legend->SetFrameWeight(1);
$graph->legend->SetFillColor('#fafafa');
$graph->legend->SetColumns(2);
$graph->SetFrame(false);
//$p1->SetSliceColors($colors);
示例14: generarReportePastel
public function generarReportePastel()
{
$this->load->model('nivel_model');
$alumPorNivel = $this->nivel_model->alumnosPorNivel();
require_once APPPATH . "libraries/jpgraph/jpgraph.php";
require_once APPPATH . "libraries/jpgraph/jpgraph_pie.php";
require_once APPPATH . "libraries/jpgraph/jpgraph_pie3d.php";
// Pasando el nombre de los niveles a un arreglo llamado dato
$i = 0;
foreach ($alumPorNivel->result() as $a) {
$dato[$i] = $a->nombre;
$cuenta[] = $a->total;
$exp[$i] = 5;
$i++;
}
// Creando el Grafico de Pastel
$graph = new PieGraph(550, 400);
$graph->SetShadow();
// Estableciendo el titulo
$graph->title->Set("Porcentaje de Alumnos por Nivel");
$graph->title->SetFont(FF_VERDANA, FS_BOLD, 18);
$graph->title->SetColor("darkblue");
$graph->legend->Pos(0.3, 0.06);
// Crear 3D pie plot
$p1 = new PiePlot3d($cuenta);
$p1->SetTheme("sand");
$p1->SetCenter(0.5);
$p1->SetSize(0.5);
$p1->SetHeight(20);
#Ancho del pastel
// Angulo de inclinación
$p1->SetAngle(45);
// Distancia entre las partes del pastel
$p1->Explode($exp);
$p1->value->SetFont(FF_ARIAL, FS_NORMAL, 10);
$p1->SetLegends($dato);
$graph->Add($p1);
$gdImgHandler = $graph->Stroke(_IMG_HANDLER);
// Guardando imagen como archivo por default es .png
$fileName = "assets/img/reportes/reporte.jpg";
$graph->img->Stream($fileName);
redirect(base_url('Alumnos/verReportePastel'));
}
示例15: grafic_trunk2
function grafic_trunk2(&$pDB_ast_cdr, &$pDB_ast, $module_name, $trunk, $dti, $dtf)
{
//
require_once "modules/{$module_name}/libs/paloSantoExtention.class.php";
$objPalo_AST_CDR = new paloSantoExtention($pDB_ast_cdr);
/* Si la troncal pedida es un grupo, se expande el grupo para averiguar las
troncales individuales. */
$regs = NULL;
if (preg_match('!^DAHDI/(g|r)(\\d+)$!i', $trunk, $regs)) {
$iGrupoTrunk = (int) $regs[2];
$gruposTrunk = getTrunkGroupsDAHDI();
if (is_array($gruposTrunk) && isset($gruposTrunk[$iGrupoTrunk])) {
$trunk = $gruposTrunk[$iGrupoTrunk];
}
}
//total minutos de llamadas in y out
$arrayTemp = $objPalo_AST_CDR->loadTrunks($trunk, "numcall", $dti, $dtf);
$arrResult = $arrayTemp[0];
//$arrResult[0] => "IN"
//$arrResult[1] => "OUT"
$tot = $arrResult[0] + $arrResult[1];
$usoDisco = $tot != 0 ? 100 * ($arrResult[0] / $tot) : 0;
if ($tot != 0) {
$freeDisco = 100 - $usoDisco;
// Some data
$data = array($usoDisco, $freeDisco);
// Create the Pie Graph.
$graph = new PieGraph(400, 170, "auto");
//$graph->SetShadow();
$graph->SetMarginColor('#fafafa');
$graph->SetFrame(true, '#999999');
$graph->legend->SetFillColor("#fafafa");
//$graph->legend->Pos(0.012, 0.5, "right","center");
$graph->legend->SetColor("#444444", "#999999");
$graph->legend->SetShadow('gray@0.6', 4);
//$graph->title->SetColor("#444444");
// Set A title for the plot
$graph->title->Set(utf8_decode(_tr("Number of Calls")));
//$graph->title->SetFont(FF_VERDANA,FS_BOLD,18);
$graph->title->SetColor("#444444");
$graph->legend->Pos(0.04, 0.2);
// Create 3D pie plot
$p1 = new PiePlot3d($data);
//$p1->SetTheme("water");
$p1->SetSliceColors(array("#3333cc", "#9999cc", "#CC3333", "#72394a", "#aa3424"));
$p1->SetCenter(0.3);
$p1->SetSize(80);
// Adjust projection angle
$p1->SetAngle(45);
// Adjsut angle for first slice
$p1->SetStartAngle(45);
// Display the slice values
//$p1->value->SetFont(FF_ARIAL,FS_BOLD,11);
//$p1->value->SetColor("navy");
$p1->value->SetColor("black");
// Add colored edges to the 3D pies
// NOTE: You can't have exploded slices with edges!
$p1->SetEdge("black");
$p1->SetLegends(array(utf8_decode(_tr("Incoming Calls") . ": ") . $arrResult[0], utf8_decode(_tr("Outcoming Calls") . ": ") . $arrResult[1]));
$graph->Add($p1);
$graph->Stroke();
} else {
$graph = new CanvasGraph(400, 140, "auto");
$title = new Text(utf8_decode(_tr("Number of Calls")));
$title->ParagraphAlign('center');
$title->SetFont(FF_FONT2, FS_BOLD);
$title->SetMargin(3);
$title->SetAlign('center');
$title->Center(0, 400, 70);
$graph->AddText($title);
$t1 = new Text(utf8_decode(_tr("There are no data to present")));
$t1->SetBox("white", "black", true);
$t1->ParagraphAlign("center");
$t1->SetColor("black");
$graph->AddText($t1);
$graph->img->SetColor('navy');
$graph->img->SetTextAlign('center', 'bottom');
$graph->img->Rectangle(0, 0, 399, 139);
$graph->Stroke();
}
}