ASNMTAP
view release on metacpan or search on metacpan
applications/htmlroot/cgi-bin/moderator/generatePluginCrontabSchedulingReport.pl view on Meta::CPAN
# swap the x and y axes to create a horziontal box-whisker chart
$c->swapXY();
# Set the axes width to 1 pixels
$c->xAxis()->setWidth(1);
$c->yAxis()->setWidth(1);
# Set the axis colors
$c->xAxis()->setColors($axisColor);
$c->yAxis()->setColors($axisColor);
# Set the y-axis scale to be hh:nn
my $lowerLimit = timelocal(0, 0, 0, 1, 0, 105);
my $upperLimit = timelocal(0, 0, 1, 1, 0, 105);
my @dateScalelabels = ('0'..'59', '0');
$c->yAxis()->setDateScale2(perlchartdir::chartTime2($lowerLimit), perlchartdir::chartTime2($upperLimit), \@dateScalelabels);
$c->yAxis()->setLabelStyle("tahoma.ttf", 8, $forGround);
# Set the y-axis to shown on the top (right + swapXY = top)
$c->setYAxisOnRight();
# 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);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Add a box-whisker layer to represent the timeslot schedule date
my $crontabLayer = $c->addBoxWhiskerLayer2(\@crontabStartDate, \@crontabEndDate, undef, undef, undef, \@colorsCrontab, 0);
$crontabLayer->setXData(\@dataPoints);
# Set the bar height to 10 pixels so they will not block the bottom bar
$crontabLayer->setDataWidth(10);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 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 4 pixels so they will not block the bottom bar
$timeslotLayer->setDataWidth(4);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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.630 second using v1.01-cache-2.11-cpan-39bf76dae61 )