<?php 
include ("../jpgraph/jpgraph.php"); 
include ("../jpgraph/jpgraph_pie.php"); 
include ("../jpgraph/jpgraph_pie3d.php"); 

$voip = $_GET['numoip'];
$v1 = $_GET['ent'];
$v2 = $_GET['dev'];
$v3 = $_GET['dis'];
$v4 = $_GET['nov'];

if($v1>0 and $v1<1){
   $v1=1; 
}

if($v2>0 and $v2<1){
   $v2=1; 
}

if($v3>0 and $v3<1){
   $v3=1; 
}

if($v4>0 and $v4<1){
   $v4=1; 
}

$negro="#2E2E2E"; 
$rojo="#C10001";  
$gris="gray"; 
$verde="#31B404"; 

$data = array($v1,$v2,$v3,$v4); 
$graph = new PieGraph(500,300,"auto"); 
$graph->ClearTheme();
$graph->img->SetAntiAliasing(); 
$graph->SetMarginColor('white');
//$graph->SetShadow(); 
////Titulo
$graph->title->Set("Gestion de OIP No.".$voip); 
$graph->legend->SetPos(0.5,0.98,'center','bottom');
$graph->legend->SetColumns(3);
//$graph->legend->SetVColMargin(4);
////Se crea la torta.
$p1 = new PiePlot3D($data); 

$p1->SetSize(0.45); 
$p1->SetCenter(0.5); 
$p1->SetSliceColors(array($negro,$rojo,$gris,$verde));
// Setup slice labels and move them into the plot 
$p1->value->SetFont(FF_FONT1,FS_BOLD); 
$p1->value->SetColor("black"); 
$p1->SetLabelPos(1); 
$p1->value->HideZero();
//$p1->value->Show();

//
//$p1->title->Set("");
$nombres=array("Envios Entregados","Envios Devueltos","Envios En Distribucion","Devoluciones Fuera de Tiempo"); 
$p1->SetLegends($nombres); 

// Explode all slices 
$p1->ExplodeAll(); 
$graph->Add($p1); 
$graph->Stroke(); 
?> 