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


PHP pChart::setImageMap方法代码示例

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


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

示例1: render

 /**
  * Render graph
  *
  *@return nothing
  **/
 function render($p_stack = FALSE)
 {
     // declare the graph
     $Test = new pChart(800, 250);
     $Test->tmpFolder = $this->tmpPath;
     $fileId = time() . '_' . rand(1, 1000);
     $fontFile = "tahoma.ttf";
     // prepare the map
     echo '<SCRIPT TYPE="text/javascript" SRC="' . $this->pChartPath . 'overlib.js"></SCRIPT>
   <SCRIPT TYPE="text/javascript" SRC="' . $this->pChartPath . 'pMap.js"></SCRIPT>';
     $MapID = "map_" . $fileId . ".map";
     $Test->setImageMap(TRUE, $MapID);
     $Map = new pChart(800, 250);
     $Map->tmpFolder = $this->tmpPath;
     $imgName = "img_" . $fileId . ".png";
     $img = $this->tmpPath . $imgName;
     $imgLink = GLPI_ROOT . "/plugins/fusioninventory/front/send.php?file=" . urlencode("tmp/" . $imgName);
     $mapLink = GLPI_ROOT . "/plugins/fusioninventory/front/send.php?file=" . urlencode("tmp/" . $MapID);
     echo '<DIV ID="overDiv" STYLE="position:absolute; visibility:hidden; z-index:1000;"></DIV>';
     echo "<IMG ID='fusioninventory_graph_{$fileId}' SRC='{$imgLink}' WIDTH=800 HEIGHT=250 BORDER=0 OnMouseMove='fusioninventory_graph(event);' OnMouseOut='nd();'>";
     echo '<SCRIPT>
           function fusioninventory_graph(event) {
              LoadImageMap("fusioninventory_graph_' . $fileId . '","' . $mapLink . '");
              getMousePosition(event);
           }
         </SCRIPT>';
     // configure the graph
     $Test->setFontProperties($this->fontsPath . $fontFile, 8);
     $Test->setGraphArea(80, 30, 580, 185);
     // graph size : keep place for titles on X and Y axes
     $Test->drawFilledRoundedRectangle(7, 7, 793, 243, 5, 240, 240, 240);
     // background rectangle
     $Test->drawRoundedRectangle(5, 5, 795, 245, 5, 230, 230, 230);
     // 3D effect
     $Test->drawGraphArea(255, 255, 255, TRUE);
     $Test->setFixedScale(0, $this->getMaxY($this->maxValue), $this->divisionsY);
     // to see values from 0
     $Test->drawScale($this->pData->GetData(), $this->pData->GetDataDescription(), SCALE_ADDALL, 150, 150, 150, TRUE, 0, 2, TRUE);
     $Test->drawGrid(4, TRUE, 230, 230, 230, 50);
     // Draw the 0 line
     $Test->setFontProperties($this->fontsPath . $fontFile, 6);
     // Draw the bar graph
     if ($p_stack) {
         $Test->drawStackedBarGraph($this->pData->GetData(), $this->pData->GetDataDescription(), 100);
     } else {
         $Test->drawBarGraph($this->pData->GetData(), $this->pData->GetDataDescription(), FALSE, 100);
     }
     // Finish the graph
     $Test->setFontProperties($this->fontsPath . $fontFile, 8);
     $Test->drawLegend(590, 30, $this->pData->GetDataDescription(), 255, 255, 255);
     // take care of legend text size
     $Test->setFontProperties($this->fontsPath . $fontFile, 10);
     $Test->drawTitle(50, 22, $this->title . ' (/ ' . $this->timeUnitName . ')', 50, 50, 50, 585);
     $Test->Render($img);
 }
开发者ID:Hawke,项目名称:fusioninventory-for-glpi,代码行数:60,代码来源:graph.class.php


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