當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PiePlot::Explode方法代碼示例

本文整理匯總了PHP中PiePlot::Explode方法的典型用法代碼示例。如果您正苦於以下問題:PHP PiePlot::Explode方法的具體用法?PHP PiePlot::Explode怎麽用?PHP PiePlot::Explode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PiePlot的用法示例。


在下文中一共展示了PiePlot::Explode方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: JpGraph

function JpGraph()
{
    $graph = new PieGraph(230, 200, "auto");
    //$graph->SetShadow();
    // Set A title for the plot
    $graph->title->Set($tpl->_ENGINE_parse_body("{your mailbox usage}\n ({$kb} mb free)"));
    $graph->title->SetFont(FF_FONT1, FS_BOLD, 12);
    $graph->title->SetColor("black");
    $p1 = new PiePlot($data);
    $p1->SetSliceColors(array("red", "green", "yellow", "green"));
    $p1->SetTheme("water");
    $p1->value->SetFont(FF_FONT1, FS_NORMAL, 10);
    $p1->Explode(array(0, 15, 15, 25, 15));
    //$p1->SetLabelType(PIE_VALUE_PER);
    //$lbl = array("{used} $USER_STORAGE_USAGE","{free}");
    //$p1->SetLabels($lbl);
    $graph->Add($p1);
    //$graph->img->SetAntiAliasing();
    $graph->Stroke();
}
開發者ID:BillTheBest,項目名稱:1.6.x,代碼行數:20,代碼來源:listener.graphs.php

示例2: array

<?php

include "../jpgraph.php";
include "../jpgraph_pie.php";
// Some data
$data = array(113, 5, 160, 3, 15, 10, 1);
// Create the Pie Graph.
$graph = new PieGraph(300, 200, "auto");
$graph->SetShadow();
// Set A title for the plot
$graph->title->Set("Example 1 Pie plot");
$graph->title->SetFont(FF_VERDANA, FS_BOLD, 14);
$graph->title->SetColor("brown");
// Create pie plot
$p1 = new PiePlot($data);
//$p1->SetSliceColors(array("red","blue","yellow","green"));
$p1->SetTheme("earth");
$p1->SetFont(FF_ARIAL, FS_NORMAL, 10);
// Set how many pixels each slice should explode
$p1->Explode(array(0, 15, 15, 25, 15));
$graph->Add($p1);
$graph->Stroke();
?>


開發者ID:BackupTheBerlios,項目名稱:milaninegw-svn,代碼行數:23,代碼來源:pieex1.php

示例3: parse

 function parse($input, $parser)
 {
     global $jpgraphLabelType;
     foreach (split("\n", $input) as $line) {
         // skip empty line or comments
         if (preg_match("/^(\\s*)#.*\$|^(\\s*)\$/", $line)) {
             continue;
         }
         // Storing data
         $raw_data = split($this->fieldsep, $line);
         if (count($raw_data) == 2) {
             $this->labels[] = $raw_data[0];
             $this->datay[] = $raw_data[1];
         } else {
             $this->datay[] = $raw_data[0];
         }
     }
     if ($this->is3d) {
         $pie = new PiePlot3D($this->datay);
         $pie->SetAngle($this->angle);
     } else {
         $pie = new PiePlot($this->datay);
     }
     if ($this->center) {
         $tmp = split(",", $this->center);
         if (is_array($tmp) && count($tmp) == 2) {
             $pie->SetCenter($tmp[0], $tmp[1]);
         } else {
             if (is_array($tmp) && count($tmp) == 1) {
                 $pie->SetCenter($tmp[0]);
             }
         }
     }
     if ($this->labeltype) {
         $label_type = $jpgraphLabelType[$this->labeltype];
         if (!$label_type) {
             throw new JpgraphMWException("Unknown label type(" . $this->labeltype . "). Possible values are: " . implode(", ", array_keys($jpgraphLabelType)));
         }
         $pie->SetLabelType($label_type);
     }
     if ($this->labelformat) {
         $pie->value->SetFormat($this->labelformat);
     }
     if ($this->usettf) {
         $pie->value->SetFont($this->font);
     }
     $pie->value->Show($this->showlabel);
     $explode_pie_list = split(",", $this->explode);
     if (count($explode_pie_list) == 1) {
         $pie->ExplodeAll($explode_pie_list[0]);
     } else {
         $pie->Explode($explode_pie_list);
     }
     if (count($this->labels) == count($this->datay)) {
         $pie->SetLegends($this->labels);
     }
     $this->graph->Add($pie);
 }
開發者ID:mediawiki-extensions,項目名稱:jpgraphmw,代碼行數:58,代碼來源:jpgraphmw.php


注:本文中的PiePlot::Explode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。