<?php
$graph = new PieGraph(500,300,"auto");
$graph->SetShadow();
//$graph->title->Set($_SESSION[rekmed][statistik_kunjungan_semua_keadaan_keluar][title]);
//$graph->title->SetFont(FF_FONT1,FS_BOLD);

$p1 = new PiePlot3D($_SESSION[rekmed][statistik_kunjungan_semua_keadaan_keluar][jml]);
$p1->ExplodeAll();
$p1->SetCenter(0.5);
$p1->SetLabels($_SESSION[rekmed][statistik_kunjungan_semua_keadaan_keluar][nama]);
//$p1->SetLegends($_SESSION[rekmed][statistik_kunjungan_semua_keadaan_keluar][kode]);
$graph->Add($p1);
$graph->Stroke();
?>
        // si todos los valores están a 0, el piegraph da el siguiente error 'Illegal pie plot. Sum of all data is zero for pie plot'
        $temp_activado = true;
    }
}
//
require_once 'ossim_conf.inc';
$conf = $GLOBALS["CONF"];
$jpgraph = $conf->get_conf("jpgraph_path");
require_once "{$jpgraph}/jpgraph.php";
require_once "{$jpgraph}/jpgraph_pie.php";
require_once "{$jpgraph}/jpgraph_pie3d.php";
// Setup the graph.
$graph = new PieGraph(350, 150, "auto");
$graph->SetAntiAliasing();
$graph->SetColor("#fafafa");
$graph->SetFrame(true, '#fafafa', 0);
if (isset($temp_activado)) {
    // Create the bar plots
    $piePlot3d = new PiePlot3D($dataValue1);
    $piePlot3d->SetSliceColors(array(COLORPIE1, COLORPIE2, COLORPIE3, COLORPIE4, COLORPIE5, COLORPIE6, COLORPIE7, COLORPIE8));
    //$piePlot3d->SetAngle(30);
    $piePlot3d->SetHeight(12);
    $piePlot3d->SetSize(0.3);
    $piePlot3d->SetCenter(0.5, 0.3);
    // Labels
    $piePlot3d->SetLabels(array($groupTit1, $groupTit2), 1);
    $graph->Add($piePlot3d);
}
// Finally send the graph to the browser
$graph->Stroke();
unset($graph);
Exemplo n.º 3
0
function crearPie($pdf, $verde, $rojo, $ciclos, $alineacion)
{
    $data = array($verde, $rojo);
    $labels = array("Valores\ndentro de\nnorma\n(%.1f%%)", "Valores\nfuera de\nnorma\n(%.1f%%)");
    $graph = new PieGraph(310, 200);
    $graph->SetShadow();
    $graph->title->Set(utf8_decode("Análisis de resultados " . $ciclos));
    $graph->title->SetFont(FF_FONT1, FS_BOLD);
    $p1 = new PiePlot3D($data);
    $p1->SetSize(0.5);
    $p1->SetCenter(0.5);
    $p1->ExplodeAll(15);
    $p1->SetStartAngle(60);
    $p1->SetLabels($labels);
    $p1->SetLabelPos(0);
    $p1->value->SetColor('black');
    $graph->Add($p1);
    $p1->SetSliceColors(array('green', 'red'));
    //$graph->Stroke();
    $nombreImagen = '' . uniqid() . '.png';
    // Display the graph
    $graph->Stroke($nombreImagen);
    if ($alineacion === 'C') {
        $pdf->Image($nombreImagen, 145, 145, 55, 45);
    } elseif ($alineacion === 'L') {
        $pdf->Image($nombreImagen, 90, 145, 55, 45);
    } elseif ($alineacion === 'R') {
        $pdf->Image($nombreImagen, 195, 145, 55, 45);
    } elseif ($alineacion === 'C1') {
        $pdf->Image($nombreImagen, 75, 205, 55, 45);
    } elseif ($alineacion === 'L1') {
        $pdf->Image($nombreImagen, 20, 205, 55, 45);
    } elseif ($alineacion === 'R1') {
        $pdf->Image($nombreImagen, 125, 205, 55, 45);
    } elseif ($alineacion === 'C2') {
        $pdf->Image($nombreImagen, 75, 160, 55, 45);
    }
    unlink($nombreImagen);
}
<?php
$graph = new PieGraph(500,300,"auto");
$graph->SetShadow();
//$graph->title->Set($_SESSION[rekmed][statistik_penyakit_ranap][title]);
//$graph->title->SetFont(FF_FONT1,FS_BOLD);

$p1 = new PiePlot3D($_SESSION[rekmed][statistik_penyakit_ranap][jml]);
$p1->ExplodeAll();
$p1->SetCenter(0.5);
$p1->SetLabels($_SESSION[rekmed][statistik_penyakit_ranap][kode]);
//$p1->SetLegends($_SESSION[rekmed][statistik_penyakit_ranap][kode]);
$graph->Add($p1);
$graph->Stroke();
?>
<?php
$graph = new PieGraph(500,300,"auto");
$graph->SetShadow();
//$graph->title->Set($_SESSION[rajal][statistik_kunjungan_semua_cara_masuk][title]);
//$graph->title->SetFont(FF_FONT1,FS_BOLD);

$p1 = new PiePlot3D($_SESSION[rajal][statistik_kunjungan_semua_cara_masuk][jml]);
$p1->ExplodeAll();
$p1->SetCenter(0.5);
$p1->SetLabels($_SESSION[rajal][statistik_kunjungan_semua_cara_masuk][nama]);
//$p1->SetLegends($_SESSION[rajal][statistik_kunjungan_semua_cara_masuk][kode]);
$graph->Add($p1);
$graph->Stroke();
?>
Exemplo n.º 6
0
<?php 
$rutaJpGraph = "../jpgraph/src";
error_reporting(1);
include "{$rutaJpGraph}/jpgraph_pie.php";
include "{$rutaJpGraph}/jpgraph_pie3d.php";
$data = array(1);
$graph = new PieGraph(490, 300, "auto");
$graph->img->SetAntiAliasing();
$graph->SetMarginColor('white');
$graph->legend->Pos(0.75, 0.2);
// Setup margin and titles
$graph->title->SetFont(FF_FONT2, FS_NORMAL1, 5);
$graph->title->Set("INFORME PQR ");
$p1 = new PiePlot3D($data1y);
//$_GET['datoss'][0]);
$p1->SetSize(0.35);
$p1->SetLabelMargin(5);
$p1->SetAngle(65);
$p1->SetCenter(0.52, 0.6);
$p1->ExplodeSlice(3);
// Setup slice labels and move them into the plot
//$p1->SetLabelType(PIE_VALUE_ABS);
$p1->value->SetFont(FF_FONT1, FS_BOLD, 5);
$p1->value->SetColor("black");
$p1->SetLabelPos(0.6);
$p1->SetLabels($nombPqrLbl, 0.2);
$p1->SetLegends($nombPqr);
//$_GET['nombres'][0]);
$graph->Add($p1);
$graph->Stroke($rutaImagen);
<?php
$graph = new PieGraph(500,300,"auto");
$graph->SetShadow();
//$graph->title->Set($_SESSION[rekmed][statistik_pasien_semua_pendidikan][title]);
//$graph->title->SetFont(FF_FONT1,FS_BOLD);

$p1 = new PiePlot3D($_SESSION[rekmed][statistik_pasien_semua_pendidikan][jml]);
$p1->ExplodeAll();
$p1->SetCenter(0.5);
$p1->SetLabels($_SESSION[rekmed][statistik_pasien_semua_pendidikan][nama]);
//$p1->SetLegends($_SESSION[rekmed][statistik_pasien_semua_pendidikan][kode]);
$graph->Add($p1);
$graph->Stroke();
?>
<?php
$graph = new PieGraph(500,300,"auto");
$graph->SetShadow();
//$graph->title->Set($_SESSION[rekmed][statistik_pasien_semua_umur][title]);
//$graph->title->SetFont(FF_FONT1,FS_BOLD);

$p1 = new PiePlot3D($_SESSION[rekmed][statistik_pasien_semua_umur][jml]);
$p1->ExplodeAll();
$p1->SetCenter(0.5);
$p1->SetLabels($_SESSION[rekmed][statistik_pasien_semua_umur][nama]);
//$p1->SetLegends($_SESSION[rekmed][statistik_pasien_semua_umur][kode]);
$graph->Add($p1);
$graph->Stroke();
?>
<?php
$graph = new PieGraph(500,300,"auto");
$graph->SetShadow();
//$graph->title->Set($_SESSION[rekmed][statistik_pasien_per_daerah][title]);
//$graph->title->SetFont(FF_FONT1,FS_BOLD);

$p1 = new PiePlot3D($_SESSION[rekmed][statistik_pasien_per_daerah][jml]);
$p1->ExplodeAll();
$p1->SetCenter(0.5);
$p1->SetLabels($_SESSION[rekmed][statistik_pasien_per_daerah][nama]);
//$p1->SetLegends($_SESSION[rekmed][statistik_pasien_per_daerah][kode]);
$graph->Add($p1);
$graph->Stroke();
?>
<?php
$graph = new PieGraph(500,300,"auto");
$graph->SetShadow();
//$graph->title->Set($_SESSION[rekmed][statistik_kunjungan_semua_perujuk][title]);
//$graph->title->SetFont(FF_FONT1,FS_BOLD);

$p1 = new PiePlot3D($_SESSION[rekmed][statistik_kunjungan_semua_perujuk][jml]);
$p1->ExplodeAll();
$p1->SetCenter(0.5);
$p1->SetLabels($_SESSION[rekmed][statistik_kunjungan_semua_perujuk][nama]);
//$p1->SetLegends($_SESSION[rekmed][statistik_kunjungan_semua_perujuk][kode]);
$graph->Add($p1);
$graph->Stroke();
?>
<?php
$graph = new PieGraph(500,300,"auto");
$graph->SetShadow();
//$graph->title->Set($_SESSION[rekmed][statistik_penyakit_daerah][title]);
//$graph->title->SetFont(FF_FONT1,FS_BOLD);

$p1 = new PiePlot3D($_SESSION[rekmed][statistik_penyakit_daerah][jml]);
$p1->ExplodeAll();
$p1->SetCenter(0.5);
$p1->SetLabels($_SESSION[rekmed][statistik_penyakit_daerah][kode]);
//$p1->SetLegends($_SESSION[rekmed][statistik_penyakit_daerah][kode]);
$graph->Add($p1);
$graph->Stroke();
?>
Exemplo n.º 12
0
function pie_single_mailbox_user()
{
    $tpl = new Templates();
    $users = new usersMenus();
    $uid = $_SESSION["uid"];
    if ($users->cyrus_imapd_installed == 0) {
        return null;
    }
    $ldap = new clladp();
    $hash = $ldap->UserDatas($_SESSION["uid"]);
    if ($hash["MailboxActive"] != 'TRUE') {
        return null;
    }
    $cyrus = new cyrus();
    $res = $cyrus->get_quota_array($uid);
    $size = $cyrus->MailboxInfosSize($uid);
    $free = $cyrus->USER_STORAGE_LIMIT - $cyrus->USER_STORAGE_USAGE;
    if (!$cyrus->MailBoxExists($uid)) {
        return null;
    }
    $USER_STORAGE_USAGE = $cyrus->USER_STORAGE_USAGE;
    $USER_STORAGE_LIMIT = $cyrus->USER_STORAGE_LIMIT;
    $FREE = $free;
    writelogs("USER_STORAGE_USAGE={$USER_STORAGE_USAGE}", __FUNCTION__, __FILE__);
    writelogs("STORAGE_LIMIT={$USER_STORAGE_LIMIT}", __FUNCTION__, __FILE__);
    if ($USER_STORAGE_LIMIT == null) {
        $USER_STORAGE_LIMIT = 1000000;
        $USER_STORAGE_USAGE = 0;
        $FREE = $USER_STORAGE_LIMIT;
    }
    $USER_STORAGE_RESTANT = $USER_STORAGE_LIMIT - $USER_STORAGE_USAGE;
    if ($USER_STORAGE_RESTANT > 1) {
        $reste = round($USER_STORAGE_RESTANT / 1024);
        $data = array($USER_STORAGE_USAGE, $USER_STORAGE_RESTANT);
    } else {
        $data = array($USER_STORAGE_USAGE);
    }
    $title = $tpl->_ENGINE_parse_body("{your mailbox usage} ({$reste} mb free)");
    writelogs("USER_STORAGE_USAGE={$USER_STORAGE_USAGE} - USER_STORAGE_LIMIT={$USER_STORAGE_LIMIT} FREE={$FREE}", __FUNCTION__, __FILE__);
    $date = date('Y-m-d');
    $textes = array();
    $donnees = array();
    $zlabel = array();
    $date = date('Y-m-d');
    $donnees[] = $FREE;
    $textes[] = "{$FREE} Free";
    $donnees[] = $USER_STORAGE_USAGE;
    $textes[] = "{$USER_STORAGE_USAGE} used";
    $data = $donnees;
    $graph = new PieGraph(370, 350, 'auto');
    //$graph->SetShadow();
    $graph->title->Set($title);
    $graph->title->SetFont(FF_FONT1, FS_BOLD);
    $p1 = new PiePlot3D($data);
    $p1->SetLabels($textes, 1);
    $p1->SetEdge('black', 0);
    $p1->SetAngle(55);
    $p1->SetLabelMargin(2);
    $p1->SetCenter(0.4, 0.5);
    $p1->ExplodeAll(10);
    $graph->Add($p1);
    $graph->SetFrame(false);
    $graph->StrokeCSIM();
}