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


PHP PieGraph::setShadow方法代码示例

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


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

示例1: user_per_group

 /**
  * Collects and renders user per group report data
  */
 public function user_per_group()
 {
     $myConfig = $this->getConfig();
     $oDb = oxDb::getDb();
     global $aTitles;
     $aDataX = array();
     $aDataY = array();
     $sSQL = "SELECT oxgroups.oxtitle,\n                        count(oxuser.oxid)\n                 FROM oxobject2group,\n                      oxuser,\n                      oxgroups\n                 WHERE oxobject2group.oxobjectid = oxuser.oxid  AND\n                       oxobject2group.oxgroupsid = oxgroups.oxid\n                 GROUP BY oxobject2group.oxgroupsid\n                 ORDER BY oxobject2group.oxgroupsid";
     $rs = $oDb->execute($sSQL);
     if ($rs != false && $rs->recordCount() > 0) {
         while (!$rs->EOF) {
             if ($rs->fields[1]) {
                 $aDataX[] = $rs->fields[1];
                 $aDataY[] = $rs->fields[0];
             }
             $rs->moveNext();
         }
     }
     header("Content-type: image/png");
     // New graph with a drop shadow
     if (count($aDataX) > 10) {
         $graph = new PieGraph(800, 830);
     } else {
         $graph = new PieGraph(600, 600);
     }
     $graph->setBackgroundImage($myConfig->getImageDir(true) . "/reportbgrnd.jpg", BGIMG_FILLFRAME);
     $graph->setShadow();
     // Set title and subtitle
     //$graph->title->set($this->aTitles[$myConfig->getConfigParam( 'iAdminLanguage' ) ]);
     $graph->title->set($this->aTitles[oxRegistry::getLang()->getObjectTplLanguage()]);
     // Use built in font
     $graph->title->setFont(FF_FONT1, FS_BOLD);
     // Create the bar plot
     $bplot = new PiePlot3D($aDataX);
     $bplot->setSize(0.4);
     $bplot->setCenter(0.5, 0.32);
     // explodes all chunks of Pie from center point
     $bplot->explodeAll(10);
     $iUserCount = 0;
     foreach ($aDataX as $iVal) {
         $iUserCount += $iVal;
     }
     for ($iCtr = 0; $iCtr < count($aDataX); $iCtr++) {
         $iSLeng = strlen($aDataY[$iCtr]);
         if ($iSLeng > 20) {
             if ($iSLeng > 23) {
                 $aDataY[$iCtr] = trim(substr($aDataY[$iCtr], 0, 20)) . "...";
             }
         }
         $aDataY[$iCtr] .= " - " . $aDataX[$iCtr] . " Kund.";
     }
     $bplot->setLegends($aDataY);
     if (count($aDataX) > 10) {
         $graph->legend->pos(0.49, 0.66, 'center');
         $graph->legend->setFont(FF_FONT0, FS_NORMAL);
         $graph->legend->setColumns(4);
     } else {
         $graph->legend->pos(0.49, 0.7, 'center');
         $graph->legend->setFont(FF_FONT1, FS_NORMAL);
         $graph->legend->setColumns(2);
     }
     $graph->add($bplot);
     // Finally output the  image
     $graph->stroke();
 }
开发者ID:mibexx,项目名称:oxid_yttutorials,代码行数:68,代码来源:report_user_per_group.php

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