当前位置: 首页>>代码示例>>PHP>>正文


PHP PiePlot3d::SetSliceColors方法代码示例

本文整理汇总了PHP中PiePlot3d::SetSliceColors方法的典型用法代码示例。如果您正苦于以下问题:PHP PiePlot3d::SetSliceColors方法的具体用法?PHP PiePlot3d::SetSliceColors怎么用?PHP PiePlot3d::SetSliceColors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PiePlot3d的用法示例。


在下文中一共展示了PiePlot3d::SetSliceColors方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

    $title = 'Fundraising Objective';
}
// Some data
$data = array($balance, $total);
//$data = $findata;
// Create the Pie Graph.
$graph = new PieGraph(350, 200, "auto");
// Set A title for the plot
$graph->title->Set($title);
$graph->title->SetFont(FF_TIMES, FS_BOLD, 18);
$graph->title->SetColor("darkblue");
$graph->legend->Pos(0.03, 0.3);
// Create 3D pie plot
$p1 = new PiePlot3d($data);
$graph->SetShadow();
$p1->SetSliceColors(array('#5CD900', '#6666FF'));
$p1->SetCenter(0.4);
$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_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);
开发者ID:centaurustech,项目名称:BenFund,代码行数:31,代码来源:goal.php

示例2: displayGraph


//.........这里部分代码省略.........
                }
                if ($G_ARR_FILL_COLOR[$num] == true) {
                    $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);
                            }
开发者ID:hardikk,项目名称:HNH,代码行数:67,代码来源:paloSantoGraphImage.lib.php

示例3: print_graph


//.........这里部分代码省略.........
                            $xlangle = 50;
                        }
                        $xaxislblmargin = $pmb - 30;
                        $yaxislblmargin = $pml - 15;
                        if ($longestlabel && !$overlap) {
                            // if legend showing
                            $pmr = $longestlabel * 5 + 40;
                        }
                        $graph->legend->Pos(0.02, 0.1, 'right', 'top');
                    } else {
                        if ($type == 'horiz_bar') {
                            $pml = 50;
                            $pmr = 20;
                            $pmt = 50;
                            $pmb = 45;
                            $ll = $longestlegend * 6.5;
                            // 8pt fontsize
                            $pml = max($pml, $ll + 20);
                            $xaxislblmargin = $pml - 20;
                            $yaxislblmargin = $pmb - 15;
                            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);
开发者ID:BozzaCoon,项目名称:SPHERE-Framework,代码行数:67,代码来源:graph.php

示例4:

$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);
//$p1->ExplodeSlice(0);
$graph->Add($p1);
$graph->Stroke();
unset($graph);
exit;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" type="text/css" href="../style/style.css"/>
<script type="text/javascript" src="../../js/jquery-1.3.2.min.js"></script>
<script language="javascript" type="text/javascript" src="../../js/excanvas.pack.js"></script>
<script type="text/javascript" src="../../js/jquery.flot.pie.js"></script>
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:events_received_graph.php

示例5: 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();
}
开发者ID:shishenkov,项目名称:zpanel,代码行数:31,代码来源:zPieGraph.php

示例6: 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();
    }
}
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:81,代码来源:index.php

示例7: array

<?php

include "../jpgraph.php";
include "../jpgraph_pie.php";
include "../jpgraph_pie3d.php";
// Some data
$data = array(200, 27, 45, 75, 90);
// Create the Pie Graph.
$graph = new PieGraph(400, 300, "auto");
$graph->SetFrame(true, 'darkblue', 0);
//$theme_class= new VividTheme;
//$graph->SetTheme($theme_class);
// Set A title for the plot
//$graph->title->Set("Example 1 3D Pie plot");
//$graph->title->SetFont(FF_VERDANA,FS_BOLD,18);
//$graph->title->SetColor("darkblue");
//$graph->legend->Pos(0.1,0.2);
// Create pie plot
$p1 = new PiePlot3d($data);
$p1->SetTheme("pastel");
$p1->SetCenter(0.5);
$p1->SetAngle(60);
$p1->SetSliceColors(array('red', 'blue', 'green', 'navy', 'orange'));
//$p1->value->SetFont(FF_ARIAL,FS_NORMAL,12);
//$p1->SetLegends(array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct"));
$graph->Add($p1);
$graph->Stroke();
?>


开发者ID:kipkaev55,项目名称:asterisk,代码行数:28,代码来源:pie3dex1.php


注:本文中的PiePlot3d::SetSliceColors方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。