本文整理汇总了PHP中PiePlot类的典型用法代码示例。如果您正苦于以下问题:PHP PiePlot类的具体用法?PHP PiePlot怎么用?PHP PiePlot使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PiePlot类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addSinglePlot
public function addSinglePlot($data, $x = 0.5, $y = 0.5, $title = null)
{
$plot = new PiePlot(array_values($data));
$plot->SetSize($this->plot_size);
$plot->SetCenter($x, $y);
$plot->setLabelPos(0.6);
//$plot->setLegends(array_keys($data));
if ($title != null) {
$plot->title->set($title);
}
$this->grapher->Add($plot);
}
示例2: graficarPDF
function graficarPDF()
{
$solo_registrados = contar("SELECT COUNT(*) FROM pasantia INNER JOIN periodo ON periodo.id = pasantia.periodo_id WHERE pasantia.m01_registrada IS NOT NULL AND pasantia.m02_aceptada IS NULL AND periodo.activo = TRUE");
$solo_aceptadas = contar("SELECT COUNT(*) FROM pasantia INNER JOIN periodo ON periodo.id = pasantia.periodo_id WHERE pasantia.m02_aceptada IS NOT NULL AND pasantia.m03_numero_asignado IS NULL AND periodo.activo = TRUE");
$solo_numero_asignado = contar("SELECT COUNT(*) FROM pasantia INNER JOIN periodo ON periodo.id = pasantia.periodo_id WHERE pasantia.m03_numero_asignado IS NOT NULL AND pasantia.m04_sellada IS NULL AND periodo.activo = TRUE");
$solo_sellada = contar("SELECT COUNT(*) FROM pasantia INNER JOIN periodo ON periodo.id = pasantia.periodo_id WHERE pasantia.m04_sellada IS NOT NULL AND pasantia.m05_entrego_copia IS NULL AND periodo.activo = TRUE");
$solo_entrego_copia = contar("SELECT COUNT(*) FROM pasantia INNER JOIN periodo ON periodo.id = pasantia.periodo_id WHERE pasantia.m05_entrego_copia IS NOT NULL AND pasantia.m06_entrego_borrador IS NULL AND periodo.activo = TRUE");
$solo_entrego_borrador = contar("SELECT COUNT(*) FROM pasantia INNER JOIN periodo ON periodo.id = pasantia.periodo_id WHERE pasantia.m06_entrego_borrador IS NOT NULL AND pasantia.m07_retiro_borrador IS NULL AND periodo.activo = TRUE");
$solo_retiro_borrador = contar("SELECT COUNT(*) FROM pasantia INNER JOIN periodo ON periodo.id = pasantia.periodo_id WHERE pasantia.m07_retiro_borrador IS NOT NULL AND pasantia.m08_entrega_final IS NULL AND periodo.activo = TRUE");
$finalizaron = contar("SELECT COUNT(*) FROM pasantia INNER JOIN periodo ON periodo.id = pasantia.periodo_id WHERE pasantia.m08_entrega_final IS NOT NULL AND periodo.activo = TRUE");
$this->MultiCell(200, 5, utf8_decode("\nRepública Bolivariana de Venezuela\nUniversidad del Zulia\nFacultad Experimental de Ciencias\nDivisión de Programas Especiales\nSistema de Pasantías\n\n\n\nEstadísticas de Hitos"), 0, "C", 0);
//GENERAR LA TABLA
$this->SetXY(5, 65);
$this->SetFont('Arial', 'B', 12);
$this->SetWidths(array(27, 25, 25, 25, 25, 25, 25, 25));
$this->SetAligns(array('C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C'));
$this->Row(array("Registradas", "Aceptadas", "Numero Asignado", "Selladas", "Entrega Copia", "Entrega Borrador", "Retiro Borrador", "Finalizaron"));
$this->SetX(5);
$this->SetFont('Arial', '', 12);
$this->SetWidths(array(27, 25, 25, 25, 25, 25, 25, 25));
$this->SetAligns(array('C', 'C', 'C', 'C', 'C', 'C', 'C', 'C'));
$this->Row(array("{$solo_registrados}", "{$solo_aceptadas}", "{$solo_numero_asignado}", "{$solo_sellada}", "{$solo_entrego_copia}", "{$solo_entrego_borrador}", "{$solo_retiro_borrador}", "{$finalizaron}"));
$data = array($solo_registrados, $solo_aceptadas, $solo_numero_asignado, $solo_sellada, $solo_entrego_copia, $solo_entrego_borrador, $solo_retiro_borrador, $finalizaron);
//aqui va la cantidad que llevará cada parte del grafico
$graph = new PieGraph(640, 480);
//tamaño de la letra del titulo y la leyenda
$graph->SetShadow();
$db = new PgDB();
//QUERY PARA EL PERIDO ACTIVO
$queryPer = "SELECT tipo, anio FROM periodo WHERE activo = TRUE";
$recoPer = pg_query($queryPer);
$rowPer = pg_fetch_array($recoPer);
$graph->title->Set(utf8_decode("REPORTE TOTAL\n{$rowPer['tipo']} - {$rowPer['anio']}"));
$graph->title->SetFont(FF_FONT2, FS_BOLD);
$p1 = new PiePlot($data);
$p1->value->Show(true);
$p1->SetLegends(array("Registradas", "Aceptadas", "Numeros Asignados", "Selladas", "Entrega de Copias", "Entrega de Borrador", "Retiro de Borrador", "Finalizaron"));
//la leyenda del gráfico
$p1->SetSize(0.3);
//el radio del gráfico
//$p1->SetAngle(45); //setear el angulo
$graph->Add($p1);
$graph->Stroke("asd.png");
$this->Image("asd.png", -15, 85, 240, 180);
// x, y, ancho, altura.
$this->Image("logotipo.jpg", 20, 12, -280);
unlink("asd.png");
}
示例3: plot
function plot()
{
$this->_setValues();
// Create the Pie Graph.
$graph = new PieGraph(500, 300);
$graph->SetShadow();
// Create
$p1 = new PiePlot($this->_data);
// Set A title for the plot
$p1->SetLegends($this->_legends);
$p1->SetSize(0.3);
$p1->SetCenter(0.28, 0.5);
$txt = new Text("Most Visited Titles", 0.15, 0.05);
$txt->SetFont(FONT1_BOLD);
$graph->Add($p1);
$graph->AddText($txt);
$graph->Stroke();
}
示例4: graph_pie_chart
function graph_pie_chart($graph_title, $graph_theme, $legend_array, $data_array, $xcoord, $ycoord)
{
//unlink("Images/piecharts2/pie_chart_image.png");
print "{$graph_title}";
print "{$graph_theme}";
print "{$legend_array}";
print "{$data_array}";
print "{$xcoord}";
print "{$ycoord}";
print "{$legend_array['2']}";
$graph = new PieGraph($xcoord, $ycoord);
$graph->title->Set($graph_title);
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$pie = new PiePlot($data_array);
$pie->SetLegends($legend_array);
$pie->SetTheme($graph_theme);
//Sets the colour scheme defined in jpgraph_pie.php
$graph->Add($pie);
$graph->Stroke("images/piecharts2/pie_chart_image.png");
}
示例5: buildGraph
/**
* Builds pie graph
*/
function buildGraph()
{
$this->graph = new Chart_Pie($this->width, $this->height);
// title setup
$this->graph->title->Set($this->title);
if (is_null($this->description)) {
$this->description = "";
}
$this->graph->subtitle->Set($this->description);
if (is_array($this->data) && array_sum($this->data) > 0) {
$p = new PiePlot($this->data);
$p->setSliceColors($this->graph->getThemedColors());
$p->SetCenter(0.4, 0.6);
$p->SetLegends($this->legend);
$p->value->HideZero();
$p->value->SetFont($this->graph->getFont(), FS_NORMAL, 8);
$p->value->SetColor($this->graph->getMainColor());
$p->value->SetMargin(0);
$this->graph->Add($p);
}
return $this->graph;
}
示例6: createPlot
public function createPlot()
{
$size = '0.25';
$plot = new \PiePlot($this->data);
$plot->SetLegends($this->legends);
$plot->SetSize($size);
$plot->SetCenter(0.25, 0.32);
$plot->ShowBorder();
$plot->SetColor('black');
$this->grafico->add($plot);
}
示例7: 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;
}
示例8: array
<?php
// content="text/plain; charset=utf-8"
require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_pie.php';
$data = array(40, 60, 21, 33, 12, 33);
$graph = new PieGraph(150, 150);
$graph->SetShadow();
$graph->title->Set("'earth' Theme");
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$p1 = new PiePlot($data);
$p1->SetTheme("earth");
$p1->SetCenter(0.5, 0.55);
$p1->value->Show(false);
$graph->Add($p1);
$graph->Stroke();
?>
示例9: array
<?php
// content="text/plain; charset=utf6_JavaScript("../jpgraph.php6_JavaScript("../jpgraph_pie.php");
// Some data and the labels
$data = array(19, 12, 4, 7, 3, 12, 3);
$labels = array("First\n(%.1f%%)", "Second\n(%.1f%%)", "Third\n(%.1f%%)", "Fourth\n(%.1f%%)", "Fifth\n(%.1f%%)", "Sixth\n(%.1f%%)", "Seventh\n(%.1f%%)");
// 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
示例10: array
<?php
// content="text/plain; charset=utf-8"
require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_pie.php';
$data = array(40, 60, 21, 33);
// Setup graph
$graph = new PieGraph(300, 200);
$graph->SetShadow();
// Setup graph title
$graph->title->Set("Example 5 of pie plot");
$graph->title->SetFont(FF_FONT1, FS_BOLD);
// Create pie plot
$p1 = new PiePlot($data);
$p1->value->SetFont(FF_VERDANA, FS_BOLD);
$p1->value->SetColor("darkred");
$p1->SetSize(0.3);
$p1->SetCenter(0.4);
$p1->SetLegends(array("Jan", "Feb", "Mar", "Apr", "May"));
//$p1->SetStartAngle(M_PI/8);
$p1->ExplodeSlice(3);
$graph->Add($p1);
$graph->Stroke();
?>
示例11: 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;
}
示例12: tr
} else {
$x[] = tr("comment");
}
mysql_free_result($rsCSF);
mysql_free_result($rsCSNF);
mysql_free_result($rsCSC);
/// A new pie graph
$graph = new PieGraph(400, 200, "auto");
$graph->SetScale('textint');
$logtype = tr("by_logtype");
// 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);
示例13: PieGraph
$legenda[] = $array[0];
$tot_top10 = $tot_top10 + $array[1];
$data[] = $array[1];
}
}
$legenda[] = "Other Titles";
$data[] = $total - $tot_top10;
// operação retirada em 02/2006
// Objetivo: aproveitar o arquivo já processada anteriormente, desde que no mesmo dia
// $OP="rm -f $db_tmp_issn.* ";
// $result=exec($OP);
// **************************************************************
// ******** Apresentação grafico ********
// **************************************************************
$graph = new PieGraph(690, 350);
// $graph->SetShadow ();
// Create
$p1 = new PiePlot($data);
// Set A title for the plot
$p1->SetLegends($legenda);
$p1->SetSize(0.4);
$p1->SetCenter(0.28, 0.5);
$txt = new Text("Most Visited Titles", 0.15, 0.0);
$txt->SetFont(FONT1_BOLD);
$graph->Add($p1);
$graph->AddText($txt);
$graph->Stroke();
?>
示例14: array
<?php
require_once "../src/jpgraph.php";
require_once "../src/jpgraph_pie.php";
//模拟数据
$data = array(0 => 3.5, 1 => 4.6, 2 => 9.1, 3 => 21.9, 4 => 42.3, 5 => 90.7, 6 => 183.5, 7 => 127.5, 8 => 61.4, 9 => 33.5, 10 => 11.5, 11 => 4.4);
//创建画布
$graph = new PieGraph(800, 500);
//设置图像边界范围
$graph->img->SetMargin(30, 30, 80, 30);
//设置标题
$graph->title->SetFont(FF_CHINESE);
$graph->title->Set("饼图--PiePlot Test");
//得到饼图对象
$piePlot = new PiePlot($data);
//设置图例
$piePlot->SetLegends(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12));
//设置图例位置
$graph->legend->Pos(0.01, 0.45, "left", "top");
//添加到画布中
$graph->Add($piePlot);
//输出
$graph->Stroke();
示例15: displayProjectProportionUsage
/**
*
* @param Integer $used
* @param Integer $total
*/
function displayProjectProportionUsage($used, $total)
{
$graph = new Chart_Pie(350, 250, "auto");
$data = array($used, $total - $used);
$usage = new PiePlot($data);
$usage->SetSliceColors(array('#44697D', '#ACBBA4'));
$usage->SetLegends(array("Used proportion", "Allowed quota"));
$graph->legend->SetPos(0.01, 0, 'right', 'top');
$graph->add($usage);
//graph display
$graph->stroke();
}