ASNMTAP
view release on metacpan or search on metacpan
applications/htmlroot/cgi-bin/moderator/generateCollectorDaemonSchedulingReport.pl view on Meta::CPAN
# Set the labels on the x axis
$c->xAxis()->setLabels(\@labels);
$c->xAxis()->setLabelStyle("tahoma.ttf", 8, $forGround);
# Reverse the x-axis scale so that it points downwards.
$c->xAxis()->setReverse();
# Set the horizontal ticks and grid lines to be between the bars
$c->xAxis()->setTickOffset(0.5);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Use a red hash pattern as the color for the actual dates. The pattern is created as a 4 x 4 bitmap defined in memory as an array of colors.
my $actualColor = $c->patternColor([0xFF000000, 0xFF000000, 0xFF000000, 0xff0000, 0xFF000000, 0xFF000000, 0xff0000, 0xFF000000, 0xFF000000, 0xff0000, 0xFF000000, 0xFF000000, 0xff0000, 0xFF000000, 0xFF000000, 0xFF000000], 4);
# Add a box whisker layer to represent the actual dates. We add the actual dates layer first, so it will be the top layer.
my $actualLayer = $c->addBoxLayer(\@actualStartDate, \@actualEndDate, $actualColor, "Actual");
$actualLayer->setXData(\@dataPoints);
# Set the bar height to 16 pixels so they will not block the bottom bar
$actualLayer->setDataWidth(16);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Add a box-whisker layer to represent the timeslot schedule date
my $scheduledLayer = $c->addBoxWhiskerLayer2(\@startDate, \@endDate, undef, undef, undef, \@colors, 0);
# $scheduledLayer->setBorderColor($perlchartdir::Transparent);
$scheduledLayer->setXData(\@dataPoints);
# Set the bar height to 4 pixels so they will not block the bottom bar
$scheduledLayer->setDataWidth(4);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Add a box-whisker layer to represent the crontab schedule date
my $crontabLayer = $c->addBoxWhiskerLayer2(\@crontabStartDate, \@crontabEndDate, undef, undef, undef, \@colorsCrontab, 0);
$crontabLayer->setXData(\@dataPoints);
# Set the bar height to 12 pixels so they will not block the bottom bar
$crontabLayer->setDataWidth(12);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Add a box-whisker layer to represent the crontab timeslot schedule date
my $timeslotLayer = $c->addBoxWhiskerLayer2(\@crontabEndDate, \@crontabEndTimeslot, undef, undef, undef, \@colorsTimeslot, 0);
$timeslotLayer->setXData(\@dataPoints);
# Set the bar height to 8 pixels so they will not block the bottom bar
$timeslotLayer->setDataWidth(8);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if ($pf eq 'on') {
$c->addLegend(2, $hight - 32, 0, "arial.ttf", 8)->setBackground($perlchartdir::Transparent);
} else {
$c->addLegend(2, $hight - 32, 0, "arial.ttf", 8)->setFontColor($forGround);
}
}
# Output the chart
binmode(STDOUT);
print "Content-type: image/png\n\n";
print $c->makeChart2($perlchartdir::PNG);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
( run in 0.625 second using v1.01-cache-2.11-cpan-39bf76dae61 )