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


PHP PieGraph::SetBackgroundImage方法代码示例

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


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

示例1: array

// content="text/plain; charset=utf-8"
require_once '../../vendor/autoload.php';
\JpGraph\JpGraph::load();
\JpGraph\JpGraph::module('pie');
\JpGraph\JpGraph::module('pie3d');
// Some data
$data = array(40, 60, 21, 33);
$piepos = array(0.2, 0.35, 0.5, 0.25, 0.3, 0.7, 0.85, 0.7);
$titles = array('USA', 'Sweden', 'South America', 'Australia');
$n = count($piepos) / 2;
// A new Graph\Graph
$graph = new \PieGraph(450, 300, 'auto');
$theme_class = "PastelTheme";
$graph->SetTheme(new $theme_class());
// Setup background
$graph->SetBackgroundImage('worldmap1.jpg', BGIMG_FILLFRAME);
// Setup title
$graph->title->Set("Pie plots with background image");
$graph->title->SetColor('white');
$graph->SetTitleBackground('#4169E1', TITLEBKG_STYLE2, TITLEBKG_FRAME_FULL, '#4169E1', 10, 10, true);
$p = array();
// Create the plots
for ($i = 0; $i < $n; ++$i) {
    $p[] = new \PiePlot3D($data);
}
for ($i = 0; $i < $n; ++$i) {
    $graph->Add($p[$i]);
}
// Position the four pies and change color
for ($i = 0; $i < $n; ++$i) {
    $p[$i]->SetCenter($piepos[2 * $i], $piepos[2 * $i + 1]);
开发者ID:amenadiel,项目名称:jpgraph,代码行数:31,代码来源:new_pie4.php

示例2: array

require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_pie.php';
require_once 'jpgraph/jpgraph_pie3d.php';
// Some data
$data = array(array(80, 18, 15, 17), array(35, 28, 6, 34), array(10, 28, 10, 5), array(22, 22, 10, 17));
$piepos = array(0.2, 0.4, 0.65, 0.28, 0.25, 0.75, 0.8, 0.75);
$titles = array('USA', 'Sweden', 'South America', 'Australia');
$n = count($piepos) / 2;
// A new graph
$graph = new PieGraph(550, 400, 'auto');
// Specify margins since we put the image in the plot area
$graph->SetMargin(1, 1, 40, 1);
$graph->SetMarginColor('navy');
$graph->SetShadow(false);
// Setup background
$graph->SetBackgroundImage('worldmap1.jpg', BGIMG_FILLPLOT);
// Setup title
$graph->title->Set("Pie plots with background image");
$graph->title->SetFont(FF_ARIAL, FS_BOLD, 20);
$graph->title->SetColor('white');
$p = array();
// Create the plots
for ($i = 0; $i < $n; ++$i) {
    $d = "data{$i}";
    $p[] = new PiePlot3D($data[$i]);
}
// Position the four pies
for ($i = 0; $i < $n; ++$i) {
    $p[$i]->SetCenter($piepos[2 * $i], $piepos[2 * $i + 1]);
}
// Set the titles
开发者ID:hcvcastro,项目名称:pxp,代码行数:31,代码来源:piebkgex1.php

示例3: 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();
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:29,代码来源:report.php


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