本文整理汇总了PHP中PiePlot3D::SetCenter方法的典型用法代码示例。如果您正苦于以下问题:PHP PiePlot3D::SetCenter方法的具体用法?PHP PiePlot3D::SetCenter怎么用?PHP PiePlot3D::SetCenter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PiePlot3D
的用法示例。
在下文中一共展示了PiePlot3D::SetCenter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PieGraph
function create_pie_graph()
{
$graph = new PieGraph($this->width, $this->height, "auto");
//instantiate new PieGraph object
$graph->SetShadow();
//displayed with shadow
$graph->title->Set($this->title);
//setup graph title
$graph->title->SetFont(FF_VERDANA, FS_BOLD, 10);
//set up font porperties
$graph->title->SetColor("darkblue");
$p1 = new PiePlot3D($this->data);
//define new 3D image for PieGraph
$p1->ExplodeAll();
//explode each sector of the pie
$p1->SetTheme("sand");
//set up the theme (Colors)
$p1->SetCenter(0.45);
//display on center
$p1->SetLegends($this->label);
//set up legend of the graph
//$p1->SetLabel($this->label); //set up the labels of each sector of the pie graph
// Setup the slice values
$p1->value->SetFont(FF_ARIAL, FS_BOLD, 11);
$p1->value->SetColor("navy");
$graph->Add($p1);
//add 3D pie to PieGraph object
$graph->Stroke();
//display grapg
}
示例2: generate_image
function generate_image($lang, $idx)
{
global $LANGUAGES;
$up_to_date = get_stats($idx, $lang, 'uptodate');
$up_to_date = $up_to_date[0];
//
$outdated = @get_stats($idx, $lang, 'outdated');
$outdated = $outdated[0];
//
$missing = get_stats($idx, $lang, 'notrans');
$missing = $missing[0];
//
$no_tag = @get_stats($idx, $lang, 'norev');
$no_tag = $no_tag[0];
$data = array($up_to_date, $outdated, $missing, $no_tag);
$percent = array();
$total = array_sum($data);
// Total ammount in EN manual (to calculate percentage values)
$total_files_lang = $total - $missing;
// Total ammount of files in translation
foreach ($data as $value) {
$percent[] = round($value * 100 / $total);
}
$legend = array($percent[0] . '%% up to date (' . $up_to_date . ')', $percent[1] . '%% outdated (' . $outdated . ')', $percent[2] . '%% missing (' . $missing . ')', $percent[3] . '%% without EN-Revision (' . $no_tag . ')');
$title = 'Details for ' . $LANGUAGES[$lang] . ' PHP Manual';
$graph = new PieGraph(530, 300);
$graph->SetShadow();
$graph->title->Set($title);
$graph->title->Align('left');
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->legend->Pos(0.02, 0.18, "right", "center");
$graph->subtitle->Set('(Total: ' . $total_files_lang . ' files)');
$graph->subtitle->Align('left');
$graph->subtitle->SetColor('darkred');
$t1 = new Text(date('m/d/Y'));
$t1->SetPos(522, 294);
$t1->SetFont(FF_FONT1, FS_NORMAL);
$t1->Align("right", 'bottom');
$t1->SetColor("black");
$graph->AddText($t1);
$p1 = new PiePlot3D($data);
$p1->SetSliceColors(array("#68d888", "#ff6347", "#dcdcdc", "#f4a460"));
if ($total_files_lang != $up_to_date) {
$p1->ExplodeAll();
}
$p1->SetCenter(0.35, 0.55);
$p1->value->Show(false);
$p1->SetLegends($legend);
$graph->Add($p1);
$graph->Stroke("../www/images/revcheck/info_revcheck_php_{$lang}.png");
}
示例3: ShowPie
/**
* Show 3D Pie graph
*/
function ShowPie(&$legend, &$value)
{
$graph = new PieGraph(330, 200, "auto");
$graph->SetFrame(false);
//$graph->title->Set("A simple 3D Pie plot");
//$graph->title->SetFont(FF_FONT1,FS_BOLD);
$p1 = new PiePlot3D($value);
$p1->ExplodeSlice(1);
$p1->SetCenter(0.45);
$p1->SetLegends($legend);
$graph->legend->SetPos(0.01, 0.01, 'right', 'top');
$graph->Add($p1);
$graph->Stroke();
}
示例4: PieChart
function PieChart($w, $h, $title, $data, $dataL, $output)
{
$graph = new PieGraph($w, $h, "auto");
$graph->SetFrame(false);
$graph->SetShadow(false);
$graph->title->Set($title);
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$p1 = new PiePlot3D($data);
$p1->SetAngle(20);
$p1->SetSize(0.5);
$p1->SetCenter(0.45);
$p1->SetLegends($dataL);
$graph->Add($p1);
$graph->Stroke($output);
}
示例5: graficarTorta
function graficarTorta()
{
require 'jpgraph/src/jpgraph.php';
require 'jpgraph/src/jpgraph_pie.php';
require 'jpgraph/src/jpgraph_pie3d.php';
// Some data
$data = array($_GET['pos'], $_GET['neg']);
// Create the Pie Graph.
$graph = new PieGraph(350, 300);
$theme_class = new VividTheme();
$graph->SetTheme($theme_class);
// Set A title for the plot
// $graph->title->Set("Grafico Estadistico");
// Create
$p1 = new PiePlot3D($data);
$p1->ShowBorder();
$p1->SetColor('black');
$p1->ExplodeSlice(1);
$p1->SetLegends(array($_GET['lab1'], $_GET['lab2']));
$p1->SetCenter(0.5, 0.4);
$p1->SetAngle(40);
$graph->Add($p1);
$graph->Stroke();
}
示例6: pie_chart
public function pie_chart($piedata, $legentdata, $title)
{
require_once 'Examples/jpgraph/jpgraph.php';
require_once 'Examples/jpgraph/jpgraph_pie.php';
require_once 'Examples/jpgraph/jpgraph_pie3d.php';
$graph = new PieGraph(800, 450);
$graph->SetShadow();
$graph->title->SetFont(FF_SIMSUN, FS_BOLD, 12);
// 设置中文字体
$graph->title->Set($title . "饼状图");
$graph->SetFrame(false);
$p1 = new PiePlot3D($piedata);
$p1->SetSize(0.4);
$p1->SetCenter(0.3);
$p1->SetLegends($legentdata);
$p1->SetLabelMargin(10);
$graph->legend->SetFont(FF_SIMSUN, FS_NORMAL);
$graph->legend->Pos(0.03, 0.18, 'right', 'top');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->SetColumns(2);
$graph->legend->SetVColMargin(0);
$graph->Add($p1);
$graph->SetImgFormat('png', 90);
$graph->Stroke();
}
示例7: PieGraph
function generatePie3D($data, $legend_index = 0, $chartData_index = 1, $image = false, $length = 500, $width = 300, $hasShadow = true, $fontFamily = FF_FONT1, $fontStyle = FS_BOLD, $fontSize = '', $fontColor = 'black')
{
include_once XHELP_JPGRAPH_PATH . '/jpgraph_pie.php';
include_once XHELP_JPGRAPH_PATH . '/jpgraph_pie3d.php';
$graph = new PieGraph($length, $width);
if ($hasShadow) {
// Add a shadow to the image
$graph->setShadow();
}
$graph->title->Set($this->meta['name']);
$p1 = new PiePlot3D($data[$chartData_index]);
$p1->SetSize(0.3);
$p1->SetCenter(0.45);
$p1->SetStartAngle(20);
$p1->SetAngle(45);
$p1->SetLegends($data[$legend_index]);
$p1->value->SetFont($fontFamily, $fontStyle, $fontSize);
$p1->value->SetColor($fontColor);
$p1->SetLabelType(PIE_VALUE_PER);
$a = array_search(max($data[$chartData_index]), $data[$chartData_index]);
//Find the position of maximum value.
$p1->ExplodeSlice($a);
// Set graph background image
if ($image != false) {
$graph->SetBackgroundImage($image, BGIMG_FILLFRAME);
}
$graph->Add($p1);
$graph->Stroke();
}
示例8:
array_push($targ, $_SERVER["PHP_SELF"] . "?pageId=Search&slice=1&table={$table}&excludeHost=0&host2=&host%5B%5D={$host[$y]}&excludeFacility=1&excludePriority=1&date={$date}&time=&date2={$date2}&time2=&limit=100&orderby=datetime&order=DESC&msg1=&msg2=&msg3=&collapse=1");
} else {
$array_count++;
}
}
// die(print_r($targ));
$p1->SetCSIMTargets($targ, $alts);
// Horizontal: 'left','right','center'
// Vertical: 'bottom','top','center'
$graph->legend->SetAbsPos(10, 20, 'right', 'top');
// $graph->legend->Pos(0.5,0.5);
// $graph->legend->SetColumns(2);
$graph->legend->SetFont(FF_VERDANA, FS_NORMAL, 8);
// Adjust size and position of plot
$p1->SetSize(0.4);
$p1->SetCenter(0.39, 0.6);
// Setup slice labels and move them into the plot
$p1->value->SetFont(FF_FONT1, FS_BOLD);
$p1->value->SetColor("darkred");
$p1->SetLabelPos(0.7);
// Set perM > 1 below to enable per million labels
$perM = 0;
if ($perM < 1) {
$p1->SetLabelType(PIE_VALUE_ABS);
$p1->value->SetFormat("%d");
} else {
$p1->SetLabelType(PIE_VALUE_PER);
$p1->value->SetFormat(".%dM");
}
// Set percentage to enable per percent labels
$percentage = 1;
示例9: array
<?php
include "../jpgraph.php";
include "../jpgraph_pie.php";
include "../jpgraph_pie3d.php";
$data = array(40, 60, 21, 33);
$graph = new PieGraph(300, 200, "auto");
$graph->SetShadow();
$graph->title->Set("A simple Pie plot");
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$p1 = new PiePlot3D($data);
$p1->SetSize(0.5);
$p1->SetCenter(0.45);
$p1->SetLegends($gDateLocale->GetShortMonth());
$graph->Add($p1);
$graph->Stroke();
?>
示例10: PieGraph
}
}
//
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(400, 150, "auto");
$graph->SetAntiAliasing();
$graph->SetColor("#fafafa");
$graph->SetFrame(true, '#fafafa', 0);
if (isset($temp_activado)) {
// Create the bar plots
$piePlot3d = new PiePlot3D($data['value']);
$piePlot3d->SetSliceColors(array(COLORPIE1, COLORPIE2, COLORPIE3, COLORPIE4, COLORPIE5, COLORPIE6, COLORPIE7, COLORPIE8));
//$piePlot3d->SetAngle(30);
$piePlot3d->SetHeight(12);
$piePlot3d->SetSize(0.5);
$piePlot3d->SetCenter(0.26, 0.4);
// Labels
//$piePlot3d->SetLabels($data['title'],1);
$piePlot3d->SetLegends($data['title']);
$graph->Add($piePlot3d);
$graph->legend->SetPos(0.01, 0.6, 'right', 'bottom');
}
// Finally send the graph to the browser
$graph->Stroke();
unset($graph);
示例11: PieGraph
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
OCOMON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foobar; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
session_start();
include "../../includes/jpgraph/src/jpgraph.php";
include "../../includes/jpgraph/src/jpgraph_pie.php";
include "../../includes/jpgraph/src/jpgraph_pie3d.php";
$graph = new PieGraph(800, 500, "auto");
$graph->SetShadow();
$graph->SetAntiAliasing();
//$titulo=$titulo.$instituicao;
$graph->title->Set($_GET['titulo']);
$graph->subtitle->Set($_GET['instituicao']);
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$p1 = new PiePlot3D($_GET['data']);
$p1->ExplodeAll();
$p1->SetSize(0.45);
$p1->SetCenter(0.35);
$p1->SetLegends($_GET['legenda']);
$graph->Add($p1);
$graph->Stroke();
示例12: dansguardian_buildGraph_week
function dansguardian_buildGraph_week(){
include_once(dirname(__FILE__).'/listener.graphs.php');
$sql="SELECT COUNT( sitename ) AS tcount ,TYPE FROM `dansguardian_events` WHERE YEARWEEK( zDate ) = YEARWEEK( NOW( ) ) GROUP BY TYPE ORDER BY tcount DESC LIMIT 0 , 30";
if(isset($_GET["dansguardian-stats-query"])){return dansguardian_buildGraph_by_type();}
$md5=md5($sql);
$q=new mysql();
$results=$q->QUERY_SQL($sql,'artica_events');
$html="<table style='width:100%'>";
while ($ligne = mysql_fetch_array($results)) {
if($ligne["TYPE"]<>null){
$data[]=$ligne["tcount"];
$labels[]=$ligne["TYPE"];
$jsa="javascript:ShowGraphDansGuardianDetails('{$ligne["TYPE"]}','week');";
$html=$html . "<tr " . CellRollOver().">
<td width=1%><img src='img/fw_bold.gif'>
<td><strong style='font-size:11px'>{$ligne["tcount"]}</td>
<td><strong style='font-size:11px'><a href='#' OnClick=\"$jsa\">{$ligne["TYPE"]}</a></td>
</tr>
";
$js[]="$jsa";
}
}
$html=$html."</table>";
if (!is_array($data)){
die("<center>".ICON_DANSGUARDIAN_STATISTICS()."</center>");
}
$tpl=new templates();
$p1 = new PiePlot3D($data);
$p1->SetSize(.4);
$p1->SetAngle(75);
$p1->SetCSIMTargets($js,$labels);
$p1->SetCenter(0.3,0.5);
$p1->ExplodeAll(10);
$p1->SetLegends($labels);
//$p1->SetSliceColors(array('red','blue','green','navy','orange'));
$graph = new PieGraph(470,350,'auto');
$graph->Add($p1);
$graph->title->Set("Week");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->legend->Pos(0,0,'right','top');
$graph->legend->SetFillColor('white');
$graph->legend->SetLineWeight(0);
//$graph->legend->SetLayout(LEGEND_HOR); //hori
$graph->legend->SetColor('black');
$graph->legend->SetShadow("white",0);
$graph->SetFrame(false);
if(function_exists("imageantialias")){$graph->img->SetAntiAliasing();}
$mapName = 'MapName';
$imgMap = $graph->GetHTMLImageMap($mapName);
$graph->Stroke("ressources/logs/$md5.png");
$html= "
<table style='width:100%'>
<tr>
<td valign='top'>
$imgMap
".RoundedLightWhite("
<img src='ressources/logs/$md5.png' alt='graph' ismap usemap='#$mapName' border='0'>")."
</td>
<td valign='top'>".RoundedLightWhite($html)."</td>
</tr>
</table>
";
return $html;
}
示例13: array
// Some data
$data = array();
$i = 0;
$username = "holly123";
$selectPieGraph = "select SUM(total_Steps), SUM(total_Calories), SUM(total_Floors), SUM(total_Distance) from Data where (username = '{$username}')";
$result = mysqli_query($connection, "{$selectPieGraph}");
while ($row = mysqli_fetch_array($result)) {
$data[0] = $row["SUM(total_Steps)"];
$data[1] = $row["SUM(total_Calories)"];
$data[2] = $row["SUM(total_Floors)"];
$data[3] = $row["SUM(total_Distance)"];
}
// Create the Pie Graph.
$graph = new PieGraph(300, 300);
$theme_class = new VividTheme();
$graph->SetTheme($theme_class);
// Set A title for the plot
$graph->title->Set("Breakdown of holly123's exercise");
// Create
$p1 = new PiePlot3D($data);
$p1->SetLegends(array("Steps", "Floors", "Calories", "Distance"));
$p1->SetCenter(0.5, 0.55);
$p1->SetSize(0.3);
$p1->SetLabelType(PIE_VALUE_PER);
$p1->value->show();
$p1->value->SetFont(FF_FONT0, FS_NORMAL, 12);
$graph->Add($p1);
$p1->ShowBorder();
$p1->SetColor('black');
//$p1->ExplodeSlice(1);
$graph->Stroke();
示例14: PieGraph
$graph->Add($bplot);
break;
case "T":
$textWidth = 56 + $maxChars * 6;
$width = 600;
if ($textWidth > $width) {
$width = $textWidth;
}
$graph = new PieGraph($width, 200 + count($datax) * 32, "auto");
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->legend->SetFont(FF_ARIAL, FS_NORMAL, 9);
$graph->legend->SetLayout(LEGEND_VERT);
$graph->legend->Pos(0.03, 0.95, "left", "bottom");
$p1 = new PiePlot3D($datax);
$p1->SetAngle(30);
$p1->SetCenter(0.5, 0.3);
$p1->SetSize(0.4);
$p1->SetTheme("pastel");
$p1->SetLegends($datay);
$p1->value->Show();
$p1->value->SetFormat("%2.2f%%");
$graph->Add($p1);
break;
}
$graph->footer->right->Set("Provincia ART");
$graph->footer->right->SetColor("#0f539c");
$graph->footer->right->SetFont(FF_FONT1, FS_BOLD);
$graph->title->Set($titulo);
$graph->title->SetFont(FF_ARIAL, FS_BOLD, 10);
$graph->Stroke();
示例15: RenderGraph
public function RenderGraph(&$form, &$robj)
{
$data = new DataObjXYp($this->code);
$form->views[$this->view]->RenderSpecial('get-data', $form, $data);
$pieplot = new PiePlot3D($data->yrdata);
if (is_array($this->styles['pie-options'])) {
if (!empty($this->styles['pie-options']['explodeslice'])) {
$pieplot->ExplodeSlice($this->styles['pie-options']['explodeslice']);
}
if (!empty($this->styles['pie-options']['setcenter'])) {
$pieplot->SetCenter($this->styles['pie-options']['setcenter']);
}
}
$pieplot->SetLegends(array_reverse($data->xdata));
$robj->Add($pieplot);
}