本文整理汇总了PHP中GanttGraph::Stroke方法的典型用法代码示例。如果您正苦于以下问题:PHP GanttGraph::Stroke方法的具体用法?PHP GanttGraph::Stroke怎么用?PHP GanttGraph::Stroke使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GanttGraph
的用法示例。
在下文中一共展示了GanttGraph::Stroke方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$graph->scale->month->grid->SetColor('gray');
$graph->scale->month->grid->Show(true);
$graph->scale->year->grid->SetColor('gray');
$graph->scale->year->grid->Show(true);
// Setup activity info
// For the titles we also add a minimum width of 100 pixels for the Task name column
$graph->scale->actinfo->SetColTitles(array('Name', 'Duration', 'Start', 'Finish'), array(100));
$graph->scale->actinfo->SetBackgroundColor('green:0.5@0.5');
$graph->scale->actinfo->SetFont(FF_ARIAL, FS_NORMAL, 10);
$graph->scale->actinfo->vgrid->SetStyle('solid');
$graph->scale->actinfo->vgrid->SetColor('gray');
// Data for our example activities
$data = array(array(0, array("Pre-study", "102 days", "23 Nov '01", "1 Mar '02"), "2001-11-23", "2002-03-1", FF_ARIAL, FS_NORMAL, 8), array(1, array("Prototype", "21 days", "26 Oct '01", "16 Nov '01"), "2001-10-26", "2001-11-16", FF_ARIAL, FS_NORMAL, 8), array(2, array("Report", "12 days", "1 Mar '02", "13 Mar '02"), "2002-03-01", "2002-03-13", FF_ARIAL, FS_NORMAL, 8));
// Create the bars and add them to the gantt chart
for ($i = 0; $i < count($data); ++$i) {
$bar = new GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], "[50%]", 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("gray");
$bar->progress->Set(0.5);
$bar->progress->SetPattern(GANTT_SOLID, "darkgreen");
$graph->Add($bar);
}
// Output the chart
$graph->Stroke();
?>
示例2: graph_schedule
function graph_schedule($data, $title, $show_day)
{
require_once "jpgraph/jpgraph.php";
require_once "jpgraph/jpgraph_gantt.php";
// Some sample Gantt data
/*
$data = array(
array(0, " Bryce", "2009-08-28 11:00","2009-08-28 15:30"),
array(1, " Kyla", "2009-08-28 08:00","2009-08-28 15:30"),
array(2, " Nathan", "2009-08-28 08:00","2009-08-28 17:00")
);
*/
// Basic graph parameters
$graph = new GanttGraph(700);
$graph->SetMarginColor('darkgreen@0.8');
$graph->SetColor('white');
$graph->title->Set("{$title}'s Schedule");
$graph->title->SetColor('darkgray');
// We want to display day, hour and minute scales
if ($show_day) {
$graph->ShowHeaders(GANTT_HDAY | GANTT_HHOUR);
} else {
$graph->ShowHeaders(GANTT_HHOUR);
}
#$graph->ShowHeaders(GANTT_HDAY | GANTT_HHOUR);
#$graph->ShowHeaders(GANTT_HHOUR);
// Setup day format
$graph->scale->day->SetBackgroundColor('lightyellow:1.5');
$graph->scale->day->SetStyle(DAYSTYLE_LONG);
$graph->scale->day->SetFont(FF_FONT1, FS_NORMAL, 16);
// Setup hour format
$graph->scale->hour->SetIntervall(1);
$graph->scale->hour->SetBackgroundColor('lightyellow:1.5');
$graph->scale->hour->SetStyle(HOURSTYLE_HAMPM);
$graph->scale->hour->grid->SetColor('gray:0.8');
$graph->scale->hour->SetFont(FF_FONT1, FS_NORMAL, 13);
for ($i = 0; $i < count($data); ++$i) {
$bar = new GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], $data[$i][4]);
$bar->SetPattern(BAND_RDIAG, "yellow");
$bar->SetFillColor("gray");
$graph->Add($bar);
}
// Draw graph
$graph->Stroke();
}
示例3: CDate
$caption .= $t['project_name'] . ' (' . $t['perc_assignment'] . '%)';
/*
$caption .= (($p['project_status']) != 7 ? $AppUI->_('active') : $AppUI->_('inactive'));
*/
}
if ($t['task_milestone'] != 1) {
$enddate = new CDate($end);
$startdate = new CDate($start);
$bar = new GanttBar($row++, array($name, $startdate->format($df), $enddate->format($df), ' '), $start, $actual_end, $cap, $t['task_dynamic'] == 1 ? 0.1 : 0.6);
if (is_file(TTF_DIR . 'FreeSans.ttf')) {
$bar->title->SetFont(FF_CUSTOM, FS_NORMAL, 10);
}
$bar->SetFillColor('#' . $t['project_color_identifier']);
$bar->SetPattern(BAND_SOLID, '#' . $t['project_color_identifier']);
//adding captions
$bar->caption = new TextProperty($caption);
$bar->caption->Align('left', 'center');
} else {
$bar = new MileStone($row++, $name, $start, substr($start, 0, 10));
$bar->title->SetColor('#CC0000');
}
$graph2->Add($bar);
// If showAllGant checkbox is checked
}
}
// End of check for valid projects array.
$today = date('y-m-d');
$vline = new GanttVLine($today, $AppUI->_('Today', UI_OUTPUT_RAW));
$graph->Add($vline);
$graph2->Stroke();
示例4: GanttVLine
if (count($data[$i]) > 4) {
$bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]);
}
$bar->rightMark->Show();
$bar->rightMark->SetType(MARK_FILLEDCIRCLE);
$bar->rightMark->SetWidth(8);
$bar->rightMark->SetColor("red");
$bar->rightMark->SetFillColor("red");
$bar->rightMark->title->Set($i + 1);
$bar->rightMark->title->SetFont(FF_ARIAL, FS_BOLD, 12);
$bar->rightMark->title->SetColor("white");
$bar->SetPattern(BAND_RDIAG, "yellow");
$bar->SetFillColor("red");
$bar->progress->Set($i / 10);
$bar->progress->SetPattern(GANTT_SOLID, "darkgreen");
$graph->Add($bar);
}
// The line will NOT be shown since it is outside the specified slice
$vline = new GanttVLine("2002-02-28");
$vline->title->Set("2002-02-28");
$vline->title->SetFont(FF_FONT1, FS_BOLD, 10);
$graph->Add($vline);
// The milestone will NOT be shown since it is outside the specified slice
$ms = new MileStone(7, "M5", "2002-01-28", "28/1");
$ms->title->SetFont(FF_FONT1, FS_BOLD);
$graph->Add($ms);
$graph->Stroke("../bodega/faxtmp/grafica.png");
?>
示例5: unset
unset($query);
$q->clear();
$graph->Add($bar);
}
unset($gantt_arr);
$today = date('y-m-d');
$vline = new GanttVLine($today, $AppUI->_('Today', UI_OUTPUT_RAW));
//if ($monospacefont) {
// $vline->title->SetFont(FF_DEJAVUMONO, FS_BOLD, 10); //specify the use of VeraMono
//} else {
$vline->title->SetFont(FF_DEJAVU, FS_BOLD, 10);
//}
$graph->Add($vline);
if ($addLinksToGantt == 1) {
$graph->SetMargin(5, 5, 15, 20);
$graph->Stroke((dPgetConfig('overlay_dir') == '' ? DP_BASE_DIR : dPgetConfig('overlay_dir')) . "/files/temp/gantt" . $filedate . ".png");
$ganttMap = $graph->GetHTMLImageMap("csimap");
$ganttSource = "<img src=\"./files/temp/gantt" . $filedate . ".png\" ISMAP USEMAP=\"#csimap\" border=0>";
$ganttMap = dPgetParam($_POST, 'ganttMap');
$ganttSource = dPgetParam($_POST, 'ganttSource');
echo $graph->GetHTMLImageMap("csimap");
echo "<img src=\"./files/temp/gantt" . $filedate . ".png\" ISMAP USEMAP=\"#csimap\" border=0>";
/*
$gantt_file = '/files/temp/gantt2.png';
// $bar = new MileStone($row++, $gantt_file, $today, $s);
$graph->StrokeCSIM(basename(__FILE__));
//$graph->StrokeCSIM(auto);
//$graph->StrokeCSIM('gant.php', 'gantt_map', 0);
//$gantt_map = $graph->GetHTMLImageMap ('gantt_map');
//echo "<img src=\"./files/temp/gantt.png\" ISMAP USEMAP=\"#gantt_map\" border=0>";
// Map Names
示例6: DEFINE
//.........这里部分代码省略.........
// check for Resources
if ($showResources == 'true') {
$linkedObjects = $bolink->get_links('projects', $pro[project_id]);
$projectACL = $this->boprojects->get_acl_for_project($pro[project_id]);
if (is_array($projectACL)) {
// if beginn
foreach ($projectACL as $accountID) {
#_debug_array($projectData);
$accountData = CreateObject('phpgwapi.accounts', $accountID);
$accountData->read_repository();
$accountName = $GLOBALS['phpgw']->common->display_fullname($accountData->data['account_lid'], $accountData->data['firstname'], $accountData->data['lastname']);
$calData = array('syear' => date('Y', $sdate), 'smonth' => date('m', $sdate), 'sday' => date('d', $sdate), 'eyear' => date('Y', $edate), 'emonth' => date('m', $edate), 'eday' => date('d', $edate), 'owner' => array($accountID));
$calEntries = $bocalendar->store_to_cache($calData);
$bocalendar->remove_doubles_in_cache(date('Y', $sdate) . date('m', $sdate) . date('d', $sdate), date('Y', $edate) . date('m', $edate) . date('d', $edate));
$calEntries = $bocalendar->cached_events;
#_debug_array($calEntries);
if (is_array($calEntries) && count($calEntries)) {
#_debug_array($calEntries);
foreach ($calEntries as $calDayDate => $calDayEntries) {
foreach ($calDayEntries as $calDayEntry) {
if ($calDayEntry['recur_type']) {
$bocalendar->set_recur_date($calDayEntry, $calDayDate);
}
#_debug_array($calDayEntry);
if (!$bocalendar->rejected_no_show($calDayEntry)) {
$startDate = date('Y-m-d H:i:s', mktime($calDayEntry['start']['hour'], $calDayEntry['start']['min'], $calDayEntry['start']['sec'], $calDayEntry['start']['month'], $calDayEntry['start']['mday'], $calDayEntry['start']['year']));
$endDate = date('Y-m-d H:i:s', mktime($calDayEntry['end']['hour'], $calDayEntry['end']['min'], $calDayEntry['end']['sec'], $calDayEntry['end']['month'], $calDayEntry['end']['mday'], $calDayEntry['end']['year']));
#$endDate = $startDate+1000;
#_debug_array($startDate);
$bar = new GanttBar($counter, str_repeat(' ', $pro['level'] + 1) . $accountName, $startDate, $endDate, '', 0.5);
$bar->SetPattern(BAND_SOLID, "#DDDDDD");
$bar->SetColor('#CCCCCC');
#$bar->SetShadow(true,"darkgray");
if (count($projectLinks = $bolink->get_links('calendar', $calDayEntry['id'], 'projects'))) {
$projectLinks = array_flip($projectLinks);
#_debug_array($projectLinks);
if (isset($projectLinks[$pro[project_id]])) {
$bar->SetPattern(BAND_SOLID, "#33FF33");
$bar->SetColor('#33FF33');
}
}
$graphs['bars'][] = $bar;
#$graph->Add($bar);
} else {
print "rejected<br>";
}
}
}
$counter++;
}
}
}
// if end
}
// check for milstones
if (is_array($pro['mstones']) && $showMilestones == 'true') {
$msColor = "#999999";
foreach ($pro['mstones'] as $ms) {
if ($sdate < $ms['edate'] && $ms['edate'] <= $edate) {
$ms[title] = $this->botranslation->convert($ms[title], $this->displayCharset, 'iso-8859-1');
$msData = array('title' => $ms['title'], 'extracolor' => 'yellow', 'edate' => $ms['edate'], 'pro_id' => $pro['project_id']);
// Create a milestone mark
$ms = new MileStone($counter, str_repeat(' ', $pro['level'] + 1) . lang('Milestone'), date('Y-m-d', $msData['edate']), $msData['title']);
$ms->caption->SetFont(FF_VERA, FS_NORMAL, 8);
$ms->title->SetFont(FF_VERA, FS_NORMAL, 8);
$ms->mark->SetColor($msColor);
$ms->mark->SetFillColor('#EEEEEE');
$graphs['ms'][$counter] = $ms;
// Create a vertical line to emphasize the milestone
$vl = new GanttVLine(date('Y-m-d', $msData[edate]), '', $msColor, 2);
$vl->SetDayOffset(0.5);
// Center the line in the day
$graphs['vl'][$counter] = $vl;
$counter++;
}
}
}
}
// add the vertical lines
if (is_array($graphs['vl'])) {
foreach ($graphs['vl'] as $graphCounter => $graphPointer) {
$graph->Add($graphPointer);
}
}
// add the milestones
if (is_array($graphs['ms'])) {
foreach ($graphs['ms'] as $graphCounter => $graphPointer) {
$graph->Add($graphPointer);
}
}
// add the resources
if (is_array($graphs['bars'])) {
foreach ($graphs['bars'] as $graphCounter => $graphPointer) {
$graph->Add($graphPointer);
}
}
#$graph->Stroke(PHPGW_SERVER_ROOT . SEP . 'phpgwapi' . SEP . 'images' . SEP . 'draw_tmp.png');
$graph->Stroke($_filename);
}
}
示例7: 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>');*/
}
示例8: grafica
function grafica($fecha_max, $fecha_min, $datos)
{
$graph = new GanttGraph();
$graph->title->Set("");
// Rango de fechas a presentar
$graph->SetDateRange($fecha_min, $fecha_max);
// linea de espaciado vertical entre los elementos
$graph->SetVMarginFactor(2);
// configuracion de colores
$graph->SetMarginColor('lightgreen@0.8');
// color del fondo
$graph->SetBox(true, 'yellow:0.6', 2);
// contorno del marco interior
$graph->SetFrame(true, 'darkgreen', 4);
// contorno del marco exterior
$graph->scale->divider->SetColor('yellow:0.6');
// linea divisora de datos y grafico
$graph->scale->dividerh->SetColor('red:0.6');
//liena que divide el tiempo con las barras de la grafica
// Ponemos la medida de tiempo que queremos usar, por ejemplo años, meses, dias, hors o minutos
//por ejemplo, si queremos solamente la division por meses y semanas en lugar de tener
//GANTT_HWEEK | GANTT_HMONTH | GANTT_HYEAR | GANTT_HDAY
//dejamos
//GANTT_HWEEK | GANTT_HMONTH
// para mas opciones de division de tiempo ver comentarios abajo
$graph->ShowHeaders(GANTT_HWEEK | GANTT_HMONTH | GANTT_HYEAR | GANTT_HDAY);
$graph->scale->month->grid->SetColor('gray');
//lineas verticales que dividen los meses
$graph->scale->month->grid->Show(true);
$graph->scale->year->grid->SetColor('gray');
// linea verticales que dividen los años
$graph->scale->year->grid->Show(true);
$graph->scale->actinfo->SetColTitles(array('Acción', 'Duracion', 'Inicio', 'Final', 'Porcentaje'), array(30, 100));
$graph->scale->actinfo->SetBackgroundColor('blue:0.5@0.5');
//color de fondo de los titulos de la tabla
$graph->scale->actinfo->SetFont(FF_ARIAL, FS_NORMAL, 12);
//tipografia
// division vertical de los datos a la izquierda, posibles valores 'solid', 'dotted', 'dashed'
$graph->scale->actinfo->vgrid->SetStyle('solid');
$graph->scale->actinfo->vgrid->SetColor('red');
// color de las divisiones puestas en el renglon anterior
// Configuración de los iconos que queremos usar
//para poner algun icono no definido podemos usarlo de la siguiente manera
//$icon = new IconImage("imagen.png",0.7);
//en el ejemplo estoy usando una omagen desde blogspot
//el numero que es el segundo parametro de IconImage es el porcentaje de la imagen, en este caso esta al 20%
$erricon = new IconImage("logo-copia.png", 0.2);
$startconicon = new IconImage(GICON_FOLDEROPEN, 0.6);
$endconicon = new IconImage(GICON_TEXTIMPORTANT, 0.5);
//ahora ponemos los datos de la tabla e iniciamos los datos de las barras
// $data = array(
// //valores del arreglo:
// //indice del arreglo, arreglo de datos para la informacion a la izquierda, fecha de inicio de la barra, fecha final de la barra, tipografia, estilo,tamaño tipografia,% de progreso en la barra
// array(0,array("Pre-study","17 days","1 Nov '2011","1 Mar '2012")
// , "2011-11-01","2012-01-1",FF_ARIAL,FS_NORMAL,8, 0.5),//el 0.5 indica el 50%, que ocuparemos en la linea 74, dando su posicion en el arreglo
// array(1,array("Prototype","10 days","26 Oct '2011","16 Nov '2011"),
// "2011-10-26","2011-11-01",FF_ARIAL,FS_NORMAL,8, 0.12),
// array(2,array("Report","12 days","1 Mar '2012","13 Mar '2012"),
// "2012-03-01","2012-03-13",FF_ARIAL,FS_NORMAL,8, 1)
// );
$data = $datos;
// Crea las barras y las añade a la grafica gantt
for ($i = 0; $i < count($data); ++$i) {
$bar = new GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], '', 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("gray");
$bar->progress->Set($data[$i][7]);
// ocupamos el % de adelanto en la actividad
$bar->progress->SetPattern(GANTT_SOLID, "darkgreen");
//$bar->title->SetCSIMTarget(array('#1'.$i,'#2'.$i,'#3'.$i,'#4'.$i,'#5'.$i),array('11'.$i,'22'.$i,'33'.$i));
$graph->Add($bar);
//echo "<br>--> ".$data[$i][7];
}
// Creamos la imagen y le damos nombre, la imagen se guarda donde estan estos archivos
$graph->Stroke('imagenprueba.jpg');
}
示例9: graficar
public function graficar($filename)
{
$graph = new GanttGraph();
$graph->SetShadow();
$graph->SetBox();
// Only show part of the Gantt
$graph = new GanttGraph(1000);
/*
$graph->title->Set('Proceso '.$this->dataSource->getParameter('desc_proceso_macro')."\n".
'Seguimiento de Solicitud '.$this->dataSource->getParameter('numero')."\n".
'Unidad '.$this->dataSource->getParameter('desc_uo'));
$graph->title->SetFont(FF_ARIAL,FS_BOLD,6);
*/
define('UTF-8', $locale_char_set);
// Setup some "very" nonstandard colors
$graph->SetMarginColor('lightgreen@0.8');
$graph->SetBox(true, 'yellow:0.6', 2);
$graph->SetFrame(true, 'darkgreen', 4);
$graph->scale->divider->SetColor('yellow:0.6');
$graph->scale->dividerh->SetColor('yellow:0.6');
// Explicitely set the date range
// (Autoscaling will of course also work)
// Display month and year scale with the gridlines
$graph->ShowHeaders(GANTT_HMONTH | GANTT_HYEAR | GANTT_HDAY);
$graph->scale->month->grid->SetColor('gray');
$graph->scale->month->grid->Show(true);
$graph->scale->year->grid->SetColor('gray');
$graph->scale->year->grid->Show(true);
// Setup a horizontal grid
$graph->hgrid->Show();
$graph->hgrid->SetRowFillColor('darkblue@0.9');
// Setup activity info
// For the titles we also add a minimum width of 100 pixels for the Task name column
$graph->scale->actinfo->SetColTitles(array('Tipo', 'Estado', 'Responsable', 'Duracion', 'Inicio', 'Fin'), array(40, 100));
$graph->scale->actinfo->SetBackgroundColor('green:0.5@0.5');
$graph->scale->actinfo->SetFont(FF_ARIAL, FS_NORMAL, 10);
$data = array();
$dataset = $this->dataSource->getDataset();
$tamanioDataset = count($dataset);
$fechaInicio = 0;
$fechaFin = 0;
for ($i = 0; $i < $tamanioDataset; $i++) {
if ($i == 0) {
$fechaInicio = $dataset[$i]['fecha_reg'];
}
/*
if($dataset[$i]['nombre_estado']=='En_Proceso'||$dataset[$i]['nombre_estado']=='Habilitado para pagar'||$dataset[$i]['nombre_estado']=='En Pago'){
$milestone = new MileStone($i,$dataset[$i]['nombre_estado'],$dataset[$i]['fecha_reg'],$dataset[$i]['fecha_reg']);
$milestone->title->SetColor("black");
$milestone->title->SetFont(FF_FONT1,FS_BOLD);
$graph->Add($milestone);
continue;
}
*/
$actividad = array();
array_push($actividad, $i);
if ($i == $tamanioDataset - 1) {
$fechaFin = $dataset[$i]['fecha_reg'];
} else {
$fechaFin = $dataset[$i + 1]['fecha_reg'];
}
$startLiteral = new DateTime($dataset[$i]['fecha_reg']);
$endLiteral = new DateTime($fechaFin);
$start = strtotime($dataset[$i]['fecha_reg']);
$end = strtotime($fechaFin);
$days_between = round(($end - $start) / 86400);
$cabecera = array($dataset[$i]['proceso'], $dataset[$i]['estado'], $dataset[$i]['funcionario'] != '-' ? $dataset[$i]['func'] : $dataset[$i]['depto'], "{$days_between}" . ' dias', $startLiteral->format('d M Y'), $endLiteral->format('d M Y'));
array_push($actividad, $cabecera);
array_push($actividad, $dataset[$i]['fecha_reg']);
array_push($actividad, $fechaFin);
array_push($actividad, FF_ARIAL);
array_push($actividad, FS_NORMAL);
array_push($actividad, 8);
array_push($data, $actividad);
}
// Create the bars and add them to the gantt chart
for ($i = 0; $i < count($data); $i++) {
$bar = new GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], "[100%]", 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("gray");
$bar->progress->Set(1);
$bar->progress->SetPattern(GANTT_SOLID, "darkgreen");
$graph->Add($bar);
}
//$graph->SetDateRange($fechaInicio,$fechaFin);
$archivo = dirname(__FILE__) . '/../../../reportes_generados/' . $filename;
//$graph->StrokeCSIM();
//exit;
$graph->Stroke($archivo);
}
示例10: ganttPDF
function ganttPDF($reportName, $listTasks)
{
include "../includes/jpgraph/jpgraph.php";
include "../includes/jpgraph/jpgraph_gantt.php";
$graph = new GanttGraph();
$graph->SetBox();
$graph->SetMarginColor("white");
$graph->SetColor("white");
$graph->title->Set($strings["project"] . " " . $reportName);
// $graph->subtitle->Set("(".$strings["created"].": "..")");
$graph->title->SetFont(FF_FONT1);
$graph->SetColor("white");
$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK);
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
$graph->scale->week->SetFont(FF_FONT0);
$graph->scale->year->SetFont(FF_FONT1);
$comptListTasks = count($listTasks->tas_id);
$posGantt = 0;
for ($i = 0; $i < $comptListTasks; $i++) {
$listTasks->tas_name[$i] = str_replace('"', '"', $listTasks->tas_name[$i]);
$listTasks->tas_name[$i] = str_replace("'", "'", $listTasks->tas_name[$i]);
$progress = round($listTasks->tas_completion[$i] / 10, 2);
$printProgress = $listTasks->tas_completion[$i] * 10;
$activity = new GanttBar($posGantt, $listTasks->tas_pro_name[$i] . " / " . $listTasks->tas_name[$i], $listTasks->tas_start_date[$i], $listTasks->tas_due_date[$i]);
$activity->SetPattern(BAND_LDIAG, "yellow");
$activity->caption->Set($listTasks->tas_mem_login[$i] . " (" . $printProgress . "%)");
$activity->SetFillColor("gray");
if ($listTasks->tas_priority[$i] == "4" || $listTasks->tas_priority[$i] == "5") {
$activity->progress->SetPattern(BAND_SOLID, "#BB0000");
} else {
$activity->progress->SetPattern(BAND_SOLID, "#0000BB");
}
$activity->progress->Set($progress);
$graph->Add($activity);
// begin if subtask
$tmpquery = "WHERE task = " . $listTasks->tas_id[$i];
$listSubTasks = new request();
$listSubTasks->openSubtasks($tmpquery);
$comptListSubTasks = count($listSubTasks->subtas_id);
if ($comptListSubTasks >= 1) {
// list subtasks
for ($j = 0; $j < $comptListSubTasks; $j++) {
$listSubTasks->subtas_name[$j] = str_replace('"', '"', $listSubTasks->subtas_name[$j]);
$listSubTasks->subtas_name[$j] = str_replace("'", "'", $listSubTasks->subtas_name[$j]);
$progress = round($listSubTasks->subtas_completion[$j] / 10, 2);
$printProgress = $listSubTasks->subtas_completion[$j] * 10;
$posGantt += 1;
// $activity = new GanttBar($posGantt,$listTasks->tas_pro_name[$i]." / ".$listSubTasks->subtas_name[$j],$listSubTasks->subtas_start_date[$j],$listSubTasks->subtas_due_date[$j]);
// change name of project for name of parent task
$activity = new GanttBar($posGantt, $listSubTasks->subtas_tas_name[$j] . " / " . $listSubTasks->subtas_name[$j], $listSubTasks->subtas_start_date[$j], $listSubTasks->subtas_due_date[$j]);
//$activity = new GanttBar($j,$strings["project"].": ".$listSubTasks->subtas_pro_name[$j]." / ".$strings["task"].": ".$listSubTasks->subtas_name[$j],$listSubTasks->subtas_start_date[$j],$listSubTasks->subtas_due_date[$j]);
$activity->SetPattern(BAND_LDIAG, "yellow");
$activity->caption->Set($listSubTasks->subtas_mem_login[$j] . " (" . $printProgress . "%)");
$activity->SetFillColor("gray");
if ($listSubTasks->subtas_priority[$j] == "4" || $listSubTasks->subtas_priority[$j] == "5") {
$activity->progress->SetPattern(BAND_SOLID, "#BB0000");
} else {
$activity->progress->SetPattern(BAND_SOLID, "#0000BB");
}
$activity->progress->Set($progress);
$graph->Add($activity);
}
// end for comptListSubTasks
}
// end if subtask
$posGantt += 1;
}
// end for complisttask
$tmpGantt = "../files/" . md5(uniqid(rand()));
$graph->Stroke($tmpGantt);
return $tmpGantt;
}
示例11: unset
$graph->Add($bar);
}
unset($gts);
$today = date('y-m-d');
$vline = new GanttVLine($today, $AppUI->_('Today', UI_OUTPUT_RAW));
if ($monospacefont) {
$vline->title->SetFont(FF_DEJAVUMONO, FS_BOLD, $printpdfhr == '1' ? 12 : 8);
//16); //8); //specify the use of VeraMono
} else {
$vline->title->SetFont(FF_DEJAVU, FS_BOLD, $printpdfhr == '1' ? 12 : 8);
//16); //8);
}
$graph->Add($vline);
$filename = (dPgetConfig('overlay_dir') == '' ? DP_BASE_DIR : dPgetConfig('overlay_dir')) . "/files/temp/GanttPDF" . $AppUI->user_id . sprintf("%2u", $page) . ".png";
// Prepare Gantt image and store in $filename
$graph->Stroke($filename);
$outpfiles[] = $filename;
$page++;
}
//Override of some variables, not very tidy but necessary when importing code from other sources...
$skip_page = 0;
$do_report = 1;
$show_task = 1;
$show_assignee = 1;
$show_gantt = 1;
if ($showTaskNameOnly == '1') {
$show_gantt_taskdetails = 0;
} else {
$show_gantt_taskdetails = 1;
}
$ganttfile = $outpfiles;
示例12: 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();
}