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


PHP GanttGraph::SetBackgroundGradient方法代码示例

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


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

示例1: GanttGraph

<?php

// content="text/plain; charset=utf-8"
// Gantt hour example
require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_gantt.php';
$graph = new GanttGraph();
$graph->SetMarginColor('blue:1.7');
$graph->SetColor('white');
$graph->SetBackgroundGradient('navy', 'white', GRAD_HOR, BGRAD_MARGIN);
$graph->scale->hour->SetBackgroundColor('lightyellow:1.5');
$graph->scale->hour->SetFont(FF_FONT1);
$graph->scale->day->SetBackgroundColor('lightyellow:1.5');
$graph->scale->day->SetFont(FF_FONT1, FS_BOLD);
$graph->title->Set("Example of hours in scale");
$graph->title->SetColor('white');
$graph->title->SetFont(FF_VERDANA, FS_BOLD, 14);
$graph->ShowHeaders(GANTT_HDAY | GANTT_HHOUR);
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
$graph->scale->week->SetFont(FF_FONT1);
$graph->scale->hour->SetIntervall(4);
$graph->scale->hour->SetStyle(HOURSTYLE_HM24);
$graph->scale->day->SetStyle(DAYSTYLE_SHORTDAYDATE3);
$data = array(array(0, "  Label 1", "2001-01-26 04:00", "2001-01-26 14:00"), array(1, "  Label 2", "2001-01-26 10:00", "2001-01-26 18:00"), array(2, "  Label 3", "2001-01-26", "2001-01-27 10:00"));
for ($i = 0; $i < count($data); ++$i) {
    $bar = new GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], "[5%]", 10);
    if (count($data[$i]) > 4) {
        $bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]);
    }
    $bar->SetPattern(BAND_RDIAG, "yellow");
    $bar->SetFillColor("red");
开发者ID:hcvcastro,项目名称:pxp,代码行数:31,代码来源:gantthourex1.php

示例2: MakeGanttChart

  /**
   *Make Gantt
   *@return image png & die
   */        
  function MakeGanttChart(){
      // is logged ?     
      if (!logged_user()->isProjectUser(active_project())) {
        die; 
      } // if
      // is user can view this project ??
      if (!ProjectFile::canView(logged_user(), active_project())) {
        die;
      } //if

      /*
      * Init gantt graph
      */
      $width = 850;      
      $graph = new GanttGraph($width);
      /*
      * here header must be set at end and during process catch all date to determine the difference max between start and end 
      * to present HDAY or not depend on information volume
      */
      //graph header
      $graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HWEEK | GANTT_HDAY);
      // Instead of week number show the date for the first day in the week
      // on the week scale
      $graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
      $graph->SetMarginColor('blue:1.7');
      $graph->SetColor('white');
      $graph->SetBackgroundGradient('#60A2BA','white',GRAD_HOR,BGRAD_MARGIN);
      //$graph->SetBackgroundGradient('#A01010','white',GRAD_HOR,BGRAD_MARGIN);
      $graph->title->SetColor('white');
      $graph->title->SetFont(FF_FONT2,FS_BOLD,18);
      //$graph->scale->actinfo->SetColTitles(array('Act','Duration','Start','Finish','Resp'));
      $graph->scale->actinfo->SetStyle(ACTINFO_3D);
      $graph->scale->actinfo->SetFont(FF_ARIAL,FS_NORMAL,10);
      $graph->scale->actinfo->vgrid->SetColor('gray');
      $graph->scale->actinfo->SetColor('darkgray');
      $locale_char_set = 'utf-8';
      //For french support
      //Localization::instance()->getLocale();
      //if (preg_match('/' . Localization::instance()->getLocale() . '/i', 'fr_fr')) $graph->scale->SetDateLocale("fr_FR.utf8");

      /*
      * data jpgraph construction gantt type for project
      */    
      $project = active_project();
      //Project title
      $project_name = $project->getName();
      $graph->title->Set(lang('project') . ': ' . substr(utf8_decode($project_name),0,40) );

      $rows = $this->displayProjectGantt($project, $graph, 0);
      $subprojects = $project->getSubprojects();
      if (is_array($subprojects)) {
        foreach($subprojects as $subproject) {
          $rows = $this->displayProjectGantt($subproject, $graph, $rows++);
        }
      }

      //send data
      $type = "image/png";
      $name = "projectpiergantt.png";
      header("Content-Type: $type");
      header("pragma: no-cache");
      header("Content-Disposition: attachment; filename=\"$name\"");
      $graph->Stroke();
      die(); //end process do not send other informations
  }  //MakeGantt
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:69,代码来源:Reports.class.php


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