本文整理汇总了PHP中GanttGraph::CreateSimple方法的典型用法代码示例。如果您正苦于以下问题:PHP GanttGraph::CreateSimple方法的具体用法?PHP GanttGraph::CreateSimple怎么用?PHP GanttGraph::CreateSimple使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GanttGraph
的用法示例。
在下文中一共展示了GanttGraph::CreateSimple方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
// content="text/plain; charset=utf-8"
// Gantt example
require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_gantt.php';
//
// The data for the graphs
//
$data = array(array(0, ACTYPE_GROUP, "Phase 1", "2001-10-26", "2001-11-23", ''), array(1, ACTYPE_NORMAL, " Label 2", "2001-10-26", "2001-11-16", ''), array(2, ACTYPE_NORMAL, " Label 3", "2001-11-20", "2001-11-22", ''), array(3, ACTYPE_NORMAL, " Label 4", "2001-11-20", "2001-11-22", ''), array(4, ACTYPE_MILESTONE, " Phase 1 Done", "2001-11-23", 'M2'));
// The constrains between the activities
$constrains = array(array(1, 2, CONSTRAIN_ENDEND), array(2, 3, CONSTRAIN_STARTEND), array(3, 4, CONSTRAIN_ENDSTART));
$progress = array(array(1, 0.4));
// Create the basic graph
$graph = new GanttGraph();
$graph->title->Set("Example with grouping and constrains");
// Setup scale
$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK);
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAYWNBR);
// Add the specified activities
$graph->CreateSimple($data, $constrains, $progress);
// .. and stroke the graph
$graph->Stroke();
?>
示例2: graficar
//.........这里部分代码省略.........
if (isset($dataset[$i]['etapa']) && $dataset[$i]['etapa'] != '') {
$desc_principal = ' ' . $dataset[$i]['etapa'] . ' [' . trim($desc_principal) . ']';
}
//mostramos cuenta de usuario si existe
if ($dataset[$i]['nombre_usuario_ai'] != '' && $dataset[$i]['nombre_usuario_ai'] != 'NULL') {
$desc_principal = $desc_principal . ' (por AI: ' . $dataset[$i]['nombre_usuario_ai'] . ")";
} elseif ($dataset[$i]['cuenta'] != '') {
$desc_principal = $desc_principal . ' (por: ' . $dataset[$i]['cuenta'] . ")";
}
if ($dataset[$i]['disparador'] == 'no' && $dataset[$i]['estado_reg'] == 'activo' || $dataset[$i]['tipo'] == 'estado_final') {
$desc_principal = $desc_principal . ' *****';
}
$cabecera = array(utf8_decode($desc_principal), utf8_decode($resp), $tiempo, $fini, $ffin);
array_push($actividad, $tipo);
array_push($actividad, $cabecera);
array_push($actividad, $fecha_reg_ini->format('Y-m-d H:i:s'));
if ($dataset[$i]['tipo'] != 'estado_final') {
array_push($actividad, $fecha_reg_fin->format('Y-m-d H:i:s'));
}
array_push($actividad, utf8_decode($dataset[$i]['descripcion']));
array_push($actividad, '#' . $dataset[$i]['id']);
array_push($actividad, $fecha_reg_ini->format('Y-m-d H:i:s'));
//prepara las relaciones entre tipos
if ($dataset[$i]['tipo'] == 'estado' && $dataset[$i]['id_siguiente'] != 0) {
array_push($constrains, array($dataset[$i]['id'], $dataset[$i]['id_siguiente'], CONSTRAIN_ENDSTART));
}
array_push($data, $actividad);
}
//definir scala en funcion al dia inicial y dia final
$diferencia = $fechaInicio->diff($fechaFin);
if ($diferencia->format('%m') >= 24) {
//escala de meses
$graph->ShowHeaders(GANTT_HYEAR);
$sw = 1;
$fechaFin = $fechaFin->add(new DateInterval('PT9000H'));
} elseif ($diferencia->format('%m') >= 7) {
//escala de meses
$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH);
$sw = 1;
$fechaFin = $fechaFin->add(new DateInterval('PT29000H'));
} elseif ($diferencia->format('%m') > 6) {
//escala de meses
$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH);
$graph->scale->week->SetStyle(HOURSTYLE_HM24);
$sw = 1;
$fechaFin = $fechaFin->add(new DateInterval('PT6000H'));
} elseif ($diferencia->format('%m') > 1) {
//escala de semanas
$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HWEEK);
$graph->scale->week->SetStyle(HOURSTYLE_HM24);
$sw = 2;
$fechaFin = $fechaFin->add(new DateInterval('PT7000H'));
} elseif ($diferencia->format('%m') > 0) {
//escala de dias
$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HWEEK | GANTT_HDAY);
$graph->scale->week->SetStyle(HOURSTYLE_HM24);
$sw = 3;
$fechaFin = $fechaFin->add(new DateInterval('PT4600H'));
} elseif ($diferencia->format('%m') == 0 && $diferencia->format('%d') > 1) {
//escala de dias
$graph->ShowHeaders(GANTT_HMONTH | GANTT_HWEEK | GANTT_HDAY | GANTT_HHOUR);
$graph->scale->week->SetStyle(HOURSTYLE_HM24);
$graph->scale->hour->SetInterval(12);
$sw = 4;
$fechaFin = $fechaFin->add(new DateInterval('PT400H'));
} else {
//escala de horas
$graph->ShowHeaders(GANTT_HDAY | GANTT_HHOUR);
$graph->scale->week->SetStyle(HOURSTYLE_HM24);
$fechaFin = $fechaFin->add(new DateInterval('PT250H'));
$sw = 5;
}
$graph->scale->actinfo->SetColTitles(array('Tipo', 'Responsable', 'Duracion', 'Inicio', 'Fin'), array(40, 100));
// Setup a horizontal grid
$graph->hgrid->Show();
$graph->hgrid->SetRowFillColor('darkblue@0.9');
$graph->SetDateRange($fechaInicio->format('Y-m-d H:i:s'), $fechaFin->format('Y-m-d H:i:s'));
//$graph->SetDateRange('2013-06-04','2013-08-04');
$graph->title->Set("Diagrama Gant Work Flow");
//$graph->scale->week->SetStyle(MINUTESTYLE_MM);
$graph->scale->week->SetFont(FF_FONT1);
$progress = array();
$graph->CreateSimple($data, $constrains, $progress);
$archivo = dirname(__FILE__) . '/../../../reportes_generados/' . $filename;
//$graph->StrokeCSIM();
$graph->Stroke($archivo);
/*
echo ('<pre>');
var_dump($sw);
var_dump($fechaInicio->format('Y-m-d H:i:s'));
var_dump($fechaFin->format('Y-m-d H:i:s'));
var_dump($data);
echo ('</pre>');
echo ('<pre>');
print_r($constrains);
echo ('</pre>');*/
}
示例3: createGanttGraph
private function createGanttGraph($dataorder, $datalabel, $datastart, $dataende, $datamilestone, $dataprogress, $scale, $title, $constraitkey, $constraitvalue, $constrait, $startdate, $enddate)
{
// Create the graph.
$graph = new GanttGraph($this->width, $this->height, "auto");
$graph->scale->actinfo->SetColTitles(array('Paket'), array(30));
// $icon = new IconPlot( dirname(__FILE__).'/../../themes/basic/gfx/logorisklogiq.png', 0.65,0.90,1 ,40);
// $icon->SetAnchor( 'left', 'bottom');
// $graph->Add( $icon);
$todaydate = new DateTime();
$vline = new GanttVLine($todaydate->format("Y-m-d"), "Today");
$graph->Add($vline);
if ($startdate == NULL) {
$myDate = new DateTime();
$startdate = $myDate->format("Y-m-d");
}
if ($enddate == NULL) {
$my2Date = new DateTime($startdate);
$my2Date->modify("30days");
$enddate = $my2Date->format("Y-m-d");
}
$graph->SetDateRange($startdate, $enddate);
$graph->title->Set($title);
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
$graph->scale->week->setStyle(WEEKSTYLE_FIRSTDAY);
$graph->scale->month->setStyle(MONTHSTYLE_SHORTNAMEYEAR2);
// Setup a horizontal grid
$graph->hgrid->Show();
$graph->hgrid->SetRowFillColor('darkblue@0.93');
if ($this->shadow) {
$graph->SetShadow();
}
$mapper = array();
$mydata = array();
$progress = array();
$color = array();
$ii = 0;
foreach ($this->dataorder as $dorder) {
if ($datamilestone[$ii] == 0) {
$mapper[$dataorder[$ii]] = $ii;
array_push($mydata, array($ii, ACTYPE_NORMAL, $datalabel[$ii], $datastart[$ii], $dataende[$ii], ' '));
array_push($progress, array($ii, $dataprogress[$ii] / 100));
array_push($color, array($ii, 'gray'));
} else {
$mapper[$dataorder[$ii]] = $ii;
array_push($mydata, array($ii, ACTYPE_MILESTONE, $datalabel[$ii], $datastart[$ii], $datalabel[$ii]));
}
$ii++;
}
$myconstrait = array();
$ii = 0;
foreach ($constraitkey as $dorder) {
array_push($myconstrait, array($mapper[$constraitvalue[$ii]], $mapper[$constraitkey[$ii]], $constrait[$ii]));
$ii++;
}
//print_r($myconstrait);
//print_r($mydata);
$graph->CreateSimple($mydata, $myconstrait, $progress, $color);
return $graph;
}
示例4: array
<?php
// content="text/plain; charset=utf-8"
// Gantt example
require_once "jpgraph/jpgraph.php";
require_once "jpgraph/jpgraph_gantt.php";
//
// The data for the graphs
//
$data = array(array(0, ACTYPE_GROUP, "Phase 1", "2001-10-26", "2001-11-23", ''), array(1, ACTYPE_NORMAL, " Label 2", "2001-10-26", "2001-11-13", '[KJ]'), array(2, ACTYPE_NORMAL, " Label 3", "2001-11-20", "2001-11-22", '[EP]'), array(3, ACTYPE_MILESTONE, " Phase 1 Done", "2001-11-23", 'M2'));
// Create the basic graph
$graph = new GanttGraph();
$graph->title->Set("Gantt Graph using CreateSimple()");
// Setup scale
$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK);
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
// Add the specified activities
$graph->CreateSimple($data);
// .. and stroke the graph
$graph->Stroke();
?>
示例5: gantt_simple_example2
function gantt_simple_example2($p_metrics, $p_title = "", $p_subtitle = "")
{
// $data = array(
// array(0,ACTYPE_GROUP, "Phase 1", "2001-10-26","2001-11-23",""),
// array(1,ACTYPE_NORMAL, " Label 2", "2001-10-26","2001-11-13","[KJ]"),
// array(2,ACTYPE_NORMAL, " Label 3", "2001-11-20","2001-11-22","[EP]"),
// array(3,ACTYPE_MILESTONE," Phase 1 Done", "2001-11-23","M2") );
// Create the basic graph
$graph = new GanttGraph();
$graph->title->Set($p_title);
$graph->subtitle->Set("({$p_subtitle})");
// Setup scale
$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK);
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
// Add the specified activities
$graph->CreateSimple($p_metrics);
// .. and stroke the graph
$graph->Stroke();
}