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


PHP PiePlot::SetLabelPos方法代码示例

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


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

示例1: executePieGraph

 public function executePieGraph()
 {
     //Set the response header to a image JPEG datastream
     $this->getResponse()->setContent('image/jpeg');
     $util = new util();
     //echo $duales;
     $data1 = $util->getDualMedia('movies');
     $data2 = $util->getTotalMedia('movies') - $data1;
     $data = array($data2, $data1);
     $graph = new PieGraph(199, 120);
     $graph->SetMarginColor('#393939');
     $graph->SetFrame(true, '#393939');
     $graph->legend->SetPos(0.8, 0.9, 'center', 'bottom');
     $p1 = new PiePlot($data);
     $p1->SetSize(0.4);
     $p1->SetCenter(0.45);
     $p1->SetSliceColors(array('white', 'red'));
     $p1->value->SetColor('black');
     $p1->SetLegends(array("Spa", "Dual"));
     $p1->SetLabelPos(0.6);
     $graph->Add($p1);
     $graph->Stroke();
     return sfView::NONE;
 }
开发者ID:nass600,项目名称:homeCENTER,代码行数:24,代码来源:actions.class.php

示例2: renderPiePlot

 /**
  * chartService::renderPiePlot() - draw the Pie type plot
  *
  * @param array $data plot data array reference
  * @param array $xmlArr xml array reference
  * @return object refernce Pie plot object reference
  */
 public function renderPiePlot(&$data, &$xmlArr)
 {
     $id = $xmlArr['ATTRIBUTES']['ID'];
     $field = $xmlArr['ATTRIBUTES']['FIELD'];
     $chartType = $xmlArr['ATTRIBUTES']['CHARTTYPE'];
     $size = $xmlArr['ATTRIBUTES']['SIZE'];
     $center = $xmlArr['ATTRIBUTES']['CENTER'];
     $height = $xmlArr['ATTRIBUTES']['HEIGHT'];
     $angle = $xmlArr['ATTRIBUTES']['ANGLE'];
     $labelPos = $xmlArr['ATTRIBUTES']['LABELPOS'];
     $legendField = $xmlArr['ATTRIBUTES']['LAGENDFIELD'];
     if ($chartType == "Pie") {
         $plot = new PiePlot($data);
         $plot->SetLabelPos($labelPos);
     } else {
         if ($chartType == "Pie3D") {
             $plot = new PiePlot3D($data);
             $plot->SetHeight($height);
             $plot->SetAngle($angle);
         }
     }
     list($c1, $c2) = explode(',', $center);
     $plot->SetCenter($c1, $c2);
     $plot->SetSize($size);
     $this->_drawString($plot->value, $xmlArr['VALUE']['ATTRIBUTES']['FONT'], $xmlArr['VALUE']['ATTRIBUTES']['COLOR']);
     return $plot;
 }
开发者ID:que273,项目名称:siremis,代码行数:34,代码来源:chartService.php

示例3: PiePlot

    // Title setup
    $graph->title->Set($logtype);
    $graph->title->SetFont(FF_ARIAL, FS_NORMAL);
    //$graph ->legend->Pos( 0.25,0.8,"right" ,"bottom");
    // Setup the pie plot
    $p1 = new PiePlot($y);
    $p1->SetTheme("earth");
    $p1->value->SetFormat("%d");
    $p1->SetLabelType(PIE_VALUE_ABS);
    $p1->SetSliceColors(array('chartreuse3', 'chocolate2', 'wheat1'));
    // Adjust size and position of plot
    $p1->SetSize(0.35);
    $p1->SetCenter(0.25, 0.52);
    $f = tr("found");
    $dnf = tr("not_found");
    $com = tr("comment");
    // Setup slice labels and move them into the plot
    $xx = array($f, $dnf, $com);
    $p1->value->SetFont(FF_COURIER, FS_NORMAL);
    $p1->value->SetColor("black");
    $p1->SetLabelPos(0.65);
    $p1->SetLegends($xx);
    $graph->legend->SetFont(FF_ARIAL, FS_NORMAL);
    // Explode all slices
    //$p1->ExplodeAll(10);
    // Finally add the plot
    $graph->Add($p1);
    $graph->SetShadow();
    // ... and stroke it
    $graph->Stroke();
}
开发者ID:pawelzielak,项目名称:opencaching-pl,代码行数:31,代码来源:PieGraphcstat.php

示例4: PieGraph

// Create the Pie Graph.
$graph = new PieGraph(300, 300);
$graph->SetShadow();
// Set A title for the plot
$graph->title->Set('String labels with values');
$graph->title->SetFont(FF_VERDANA, FS_BOLD, 12);
$graph->title->SetColor('black');
// Create pie plot
$p1 = new PiePlot($data);
$p1->SetCenter(0.5, 0.5);
$p1->SetSize(0.3);
// Setup the labels to be displayed
$p1->SetLabels($labels);
// This method adjust the position of the labels. This is given as fractions
// of the radius of the Pie. A value < 1 will put the center of the label
// inside the Pie and a value >= 1 will pout the center of the label outside the
// Pie. By default the label is positioned at 0.5, in the middle of each slice.
$p1->SetLabelPos(1);
// Setup the label formats and what value we want to be shown (The absolute)
// or the percentage.
$p1->SetLabelType(PIE_VALUE_PER);
$p1->value->Show();
$p1->value->SetFont(FF_ARIAL, FS_NORMAL, 9);
$p1->value->SetColor('darkgray');
// Add and stroke
$graph->Add($p1);
$graph->Stroke();
?>


开发者ID:denson7,项目名称:phpstudy,代码行数:28,代码来源:pielabelsex5.php

示例5: executePieGraphSingers

 public function executePieGraphSingers(sfWebRequest $request)
 {
     $util = new util();
     $loko = $util->singersData();
     //Set the response header to a image JPEG datastream
     $this->getResponse()->setContent('image/jpeg');
     //echo $duales;
     $data1 = 300;
     $data2 = 200;
     //        $data_results = $util->singersData();
     $data = array($data2, $data1);
     $graph = new PieGraph(200, 174);
     $graph->SetMarginColor('#393939');
     $graph->SetFrame(true, '#393939');
     $graph->legend->SetPos(0.8, 0.9, 'center', 'bottom');
     $p1 = new PiePlot($data);
     $p1->SetSize(0.4);
     $p1->SetCenter(0.45);
     $p1->SetSliceColors(array('white', 'red'));
     $p1->value->SetColor('black');
     $p1->SetLegends(array("Spa", "Dual"));
     $p1->SetLabelPos(0.6);
     $graph->Add($p1);
     $graph->Stroke();
     return sfView::NONE;
 }
开发者ID:nass600,项目名称:homeCENTER,代码行数:26,代码来源:actions.class.php

示例6: array

<?php

// content="text/plain; charset=utf-8"
require_once "jpgraph/jpgraph.php";
require_once "jpgraph/jpgraph_pie.php";
$data = array(40, 60, 31, 35);
// A new pie graph
$graph = new PieGraph(250, 200);
$graph->SetShadow();
// Title setup
$graph->title->Set("Adjusting the label pos");
$graph->title->SetFont(FF_FONT1, FS_BOLD);
// Setup the pie plot
$p1 = new PiePlot($data);
// Adjust size and position of plot
$p1->SetSize(0.4);
$p1->SetCenter(0.5, 0.52);
// Setup slice labels and move them into the plot
$p1->value->SetFont(FF_FONT1, FS_BOLD);
$p1->value->SetColor("darkred");
$p1->SetLabelPos(0.6);
// Finally add the plot
$graph->Add($p1);
// ... and stroke it
$graph->Stroke();
开发者ID:hcvcastro,项目名称:pxp,代码行数:25,代码来源:pieex8.php

示例7: PieGraph

        }
        // Create the Pie Graph.
        $graph = new PieGraph(200, 200);
        //$graph->SetShadow();
        // Set A title for the plot
        $graph->title->Set('New Users by Gender');
        $graph->title->SetFont(FF_VERDANA, FS_BOLD, 12);
        $graph->title->SetColor('black');
        // Create pie plot
        $p1 = new PiePlot($data);
        $p1->SetCenter(0.5, 0.5);
        $p1->SetSize(0.3);
        $p1->SetSliceColors(array('#1E90FF', '#2E8B57'));
        // Setup the labels to be displayed
        $p1->SetLabels($labels);
        // This method adjust the position of the labels. This is given as fractions
        // of the radius of the Pie. A value < 1 will put the center of the label
        // inside the Pie and a value >= 1 will pout the center of the label outside the
        // Pie. By default the label is positioned at 0.5, in the middle of each slice.
        $p1->SetLabelPos(0.5);
        // Setup the label formats and what value we want to be shown (The absolute)
        // or the percentage.
        $p1->SetLabelType(PIE_VALUE_PER);
        $p1->value->Show();
        $p1->value->SetFont(FF_ARIAL, FS_NORMAL, 9);
        $p1->value->SetColor('white');
        // Add and stroke
        $graph->Add($p1);
        $graph->Stroke();
    }
}
开发者ID:Esdras1995,项目名称:Guardtour,代码行数:31,代码来源:useridenty_pie_reports.php


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