本文整理匯總了PHP中FusionCharts::setGanttTasksParams方法的典型用法代碼示例。如果您正苦於以下問題:PHP FusionCharts::setGanttTasksParams方法的具體用法?PHP FusionCharts::setGanttTasksParams怎麽用?PHP FusionCharts::setGanttTasksParams使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FusionCharts
的用法示例。
在下文中一共展示了FusionCharts::setGanttTasksParams方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: fs_gantt_chart
function fs_gantt_chart($title, $from, $to, $tasks, $milestones, $width, $height)
{
// Generate the XML
$chart = new FusionCharts("Gantt", $width, $height, "1", "0");
$chart->setSWFPath("include/graphs/FusionCharts/");
$chart->setChartParams('dateFormat=dd/mm/yyyy;hoverCapBorderColor=2222ff;hoverCapBgColor=e1f5ff;ganttLineAlpha=80;canvasBorderColor=024455;canvasBorderThickness=0;gridBorderColor=2179b1;gridBorderAlpha=20;ganttWidthPercent=80');
$chart->setGanttProcessesParams('headerText=' . __('Task') . ';fontColor=ffffff;fontSize=9;isBold=1;isAnimated=1;bgColor=2179b1;headerbgColor=2179b1;headerFontColor=ffffff;headerFontSize=12;align=left');
$chart->setGanttTasksParams('');
$start_date = explode('/', $from);
$start_day = $start_date[0];
$start_month = $start_date[1];
$start_year = $start_date[2];
$end_date = explode('/', $to);
$end_day = $end_date[0];
$end_month = $end_date[1];
$end_year = $end_date[2];
$time_span = date_to_epoch($to) - date_to_epoch($from);
// Years
$chart->addGanttCategorySet('bgColor=2179b1;fontColor=ff0000');
for ($i = $start_year; $i <= $end_year; $i++) {
if ($i == $start_year) {
$start = sprintf('%02d/%02d/%04d', $start_day, $start_month, $start_year);
} else {
$start = sprintf('%02d/%02d/%04d', 1, 1, $i);
}
if ($i == $end_year) {
$end = sprintf('%02d/%02d/%04d', $end_day, $end_month, $end_year);
} else {
$end = sprintf('%02d/%02d/%04d', cal_days_in_month(CAL_GREGORIAN, 12, $i), 12, $i);
}
$chart->addGanttCategory($i, ';start=' . $start . ';end=' . $end . ';align=center;fontColor=ffffff;isBold=1;fontSize=16');
}
// Months
$chart->addGanttCategorySet('bgColor=ffffff;fontColor=1288dd;fontSize=10');
for ($i = $start_year; $i <= $end_year; $i++) {
for ($j = 1; $j <= 12; $j++) {
if ($i == $start_year && $j < $start_month) {
continue;
} else {
if ($i == $end_year && $j > $end_month) {
break;
}
}
if ($i == $start_year && $j == $start_month) {
$start = sprintf('%02d/%02d/%04d', $start_day, $start_month, $start_year);
} else {
$start = sprintf('%02d/%02d/%04d', 1, $j, $i);
}
if ($i == $end_year && $j == $end_month) {
$end = sprintf('%02d/%02d/%04d', $end_day, $end_month, $end_year);
} else {
$end = sprintf('%02d/%02d/%04d', cal_days_in_month(CAL_GREGORIAN, $j, $i), $j, $i);
}
$chart->addGanttCategory(date('F', mktime(0, 0, 0, $j, 1)), ';start=' . $start . ';end=' . $end . ';align=center;isBold=1');
}
}
// Days
if ($time_span < 2592000) {
$chart->addGanttCategorySet();
for ($i = $start_year; $i <= $end_year; $i++) {
for ($j = 1; $j <= 12; $j++) {
if ($i == $start_year && $j < $start_month) {
continue;
} else {
if ($i == $end_year && $j > $end_month) {
break;
}
}
$num_days = cal_days_in_month(CAL_GREGORIAN, $j, $i);
for ($k = 1; $k <= $num_days; $k++) {
if ($i == $start_year && $j == $start_month && $k < $start_day) {
continue;
} else {
if ($i == $end_year && $j == $end_month && $k > $end_day) {
break;
}
}
$start = sprintf('%02d/%02d/%04d', $k, $j, $i);
$end = sprintf('%02d/%02d/%04d', $k, $j, $i);
$chart->addGanttCategory($k, ';start=' . $start . ';end=' . $end . ';fontSize=8;isBold=0');
}
}
}
} else {
if ($time_span < 10368000) {
$chart->addGanttCategorySet();
for ($i = $start_year; $i <= $end_year; $i++) {
for ($j = 1; $j <= 12; $j++) {
if ($i == $start_year && $j < $start_month) {
continue;
} else {
if ($i == $end_year && $j > $end_month) {
break;
}
}
$num_days = cal_days_in_month(CAL_GREGORIAN, $j, $i);
for ($k = 1, $l = 1; $k <= $num_days; $k += 8, $l++) {
if ($i == $start_year && $j == $start_month && $k + 7 < $start_day) {
continue;
}
//.........這裏部分代碼省略.........