当前位置: 首页>>代码示例>>PHP>>正文


PHP pImage::drawXThresholdArea方法代码示例

本文整理汇总了PHP中pImage::drawXThresholdArea方法的典型用法代码示例。如果您正苦于以下问题:PHP pImage::drawXThresholdArea方法的具体用法?PHP pImage::drawXThresholdArea怎么用?PHP pImage::drawXThresholdArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pImage的用法示例。


在下文中一共展示了pImage::drawXThresholdArea方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: pImage

/* Create the pChart object */
$myPicture = new pImage(700, 230, $MyData);
$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_VERTICAL, array("StartR" => 100, "StartG" => 100, "StartB" => 100, "EndR" => 50, "EndG" => 50, "EndB" => 50, "Alpha" => 100));
$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_HORIZONTAL, array("StartR" => 100, "StartG" => 100, "StartB" => 100, "EndR" => 50, "EndG" => 50, "EndB" => 50, "Alpha" => 20));
$myPicture->drawGradientArea(0, 0, 60, 230, DIRECTION_HORIZONTAL, array("StartR" => 0, "StartG" => 0, "StartB" => 0, "EndR" => 50, "EndG" => 50, "EndB" => 50, "Alpha" => 100));
/* Do some cosmetics */
$myPicture->drawLine(60, 0, 60, 230, array("R" => 70, "G" => 70, "B" => 70));
$myPicture->drawRectangle(0, 0, 699, 229, array("R" => 0, "G" => 0, "B" => 0));
$myPicture->setFontProperties(array("FontName" => "../fonts/Forgotte.ttf", "FontSize" => 11));
$myPicture->drawText(35, 115, "Recorded cases", array("R" => 255, "G" => 255, "B" => 255, "FontSize" => 20, "Angle" => 90, "Align" => TEXT_ALIGN_BOTTOMMIDDLE));
/* Prepare the chart area */
$myPicture->setGraphArea(100, 30, 680, 190);
$myPicture->drawFilledRectangle(100, 30, 680, 190, array("R" => 255, "G" => 255, "B" => 255, "Alpha" => 20));
$myPicture->setFontProperties(array("R" => 255, "G" => 255, "B" => 255, "FontName" => "../fonts/pf_arma_five.ttf", "FontSize" => 6));
$myPicture->drawScale(array("AxisR" => 255, "AxisG" => 255, "AxisB" => 255, "DrawSubTicks" => TRUE, "CycleBackground" => TRUE));
/* Write two thresholds over the chart */
$myPicture->drawThreshold(10, array("WriteCaption" => TRUE, "Caption" => "Agreed SLA", "NoMargin" => TRUE));
$myPicture->drawThreshold(15, array("WriteCaption" => TRUE, "Caption" => "Best effort", "NoMargin" => TRUE));
/* Draw one static X threshold area */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 30));
$myPicture->drawXThresholdArea(3, 5, array("AreaName" => "Service closed", "R" => 226, "G" => 194, "B" => 54, "Alpha" => 40));
$myPicture->setShadow(FALSE);
/* Draw the chart */
$myPicture->drawSplineChart();
$myPicture->drawPlotChart(array("PlotSize" => 3, "PlotBorder" => TRUE));
/* Write the data bounds */
$myPicture->writeBounds();
/* Write the chart legend */
$myPicture->drawLegend(630, 215, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL));
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.drawThreshold.labels.png");
开发者ID:ambagasdowa,项目名称:projections,代码行数:31,代码来源:example.drawThreshold.labels.php

示例2: array

$myPicture->drawGradientArea(0, 0, 700, 20, DIRECTION_VERTICAL, array("StartR" => 0, "StartG" => 0, "StartB" => 0, "EndR" => 50, "EndG" => 50, "EndB" => 50, "Alpha" => 80));
/* Add a border to the picture */
$myPicture->drawRectangle(0, 0, 699, 229, array("R" => 0, "G" => 0, "B" => 0));
/* Write the picture title */
$myPicture->setFontProperties(array("FontName" => "../fonts/Silkscreen.ttf", "FontSize" => 6));
$myPicture->drawText(10, 13, "drawThresholdArea() - draw treshold areas in the charting area", array("R" => 255, "G" => 255, "B" => 255));
/* Write the chart title */
$myPicture->setFontProperties(array("FontName" => "../fonts/Forgotte.ttf", "FontSize" => 11));
$myPicture->drawText(250, 55, "My chart title", array("FontSize" => 20, "Align" => TEXT_ALIGN_BOTTOMMIDDLE));
/* Draw the scale and do some cosmetics */
$myPicture->setGraphArea(60, 60, 450, 190);
$myPicture->drawFilledRectangle(70, 70, 440, 180, array("R" => 255, "G" => 255, "B" => 255, "Surrounding" => -200, "Alpha" => 10));
$myPicture->drawScale(array("XMargin" => 10, "YMargin" => 10, "Floating" => TRUE, "DrawSubTicks" => TRUE));
/* Draw one static threshold area */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1));
$myPicture->setFontProperties(array("FontName" => "../fonts/MankSans.ttf", "FontSize" => 10));
$myPicture->drawXThresholdArea(2, 3, array("AreaName" => "Test Zone", "R" => 226, "G" => 194, "B" => 54, "Alpha" => 40));
$myPicture->setShadow(FALSE);
/* Set the font properties */
$myPicture->setFontProperties(array("FontName" => "../fonts/Forgotte.ttf", "FontSize" => 11));
/* Draw the scale and do some cosmetics */
$myPicture->setGraphArea(500, 60, 670, 190);
$myPicture->drawFilledRectangle(505, 65, 665, 185, array("R" => 255, "G" => 255, "B" => 255, "Surrounding" => -200, "Alpha" => 10));
$myPicture->drawScale(array("XMargin" => 5, "YMargin" => 5, "Floating" => TRUE, "Pos" => SCALE_POS_TOPBOTTOM, "DrawSubTicks" => TRUE));
/* Draw one static threshold area */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1));
$myPicture->setFontProperties(array("FontName" => "../fonts/MankSans.ttf", "FontSize" => 10));
$myPicture->drawXThresholdArea(2, 3, array("NameR" => 0, "NameG" => 0, "NameB" => 0, "AreaName" => "Test Zone", "R" => 206, "G" => 231, "B" => 64, "Alpha" => 20));
$myPicture->setShadow(FALSE);
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.drawXThresholdArea.png");
开发者ID:OndroNR,项目名称:bitcoin-hal10k,代码行数:31,代码来源:example.drawXThresholdArea.php

示例3: array

    $scaleSettings = array("Mode" => $scale, "ManualScale" => $AxisBoundaries, "DrawXLines" => FALSE, "DrawYLines" => FALSE, "AxisR" => 240, "AxisG" => 240, "AxisB" => 240, "TickR" => 240, "TickG" => 240, "TickB" => 240, "InnerTickWidth" => 0, "OuterTickWidth" => 5, "LabelSkip" => 0, "GridTicks" => 1, "ScaleSpacing" => 100, "XMargin" => 0, "YMargin" => 0, "Floating" => TRUE, "GridR" => 200, "GridG" => 200, "GridB" => 200, "DrawSubTicks" => FALSE, "CycleBackground" => TRUE);
    $ThresholdSettings = array("Alpha" => 50, "Ticks" => 0, "R" => 230, "G" => 230, "B" => 230, "CaptionR" => 230, "CaptionG" => 230, "CaptionB" => 230, "WriteCaption" => TRUE, "DrawBox" => FALSE, "CaptionOffset" => -18, "NoMargin" => TRUE, "Border" => FALSE, "CaptionAlign" => CAPTION_RIGHT_BOTTOM);
    /* Choose a nice font */
    $Test->setFontProperties(array("FontName" => $font, "R" => 240, "G" => 240, "B" => 240, "FontSize" => $scale_fontsize));
}
$Test->drawScale($scaleSettings);
//$Test->drawGraphAreaGradient(162,183,202,50);
$Test->setFontProperties(array("FontName" => $font, "FontSize" => $threshold_fontsize));
$drawThreshold = $ThresholdSettings;
$drawThreshold["Alpha"] = 10;
//празрачность вертикальной закраски
$index = 0;
$Alpha = $drawThreshold["Alpha"];
while ($index < sizeof($thresholds)) {
    if ($index == 0) {
        $Test->drawXThresholdArea(0, $thresholds[$index], $drawThreshold);
    } elseif ($index % 2 == 1) {
        if ($index + 1 >= sizeof($thresholds)) {
            $Test->drawXThresholdArea($thresholds[$index], sizeof($hours), $drawThreshold);
        } else {
            $Test->drawXThresholdArea($thresholds[$index], $thresholds[$index + 1], $drawThreshold);
        }
    }
    ++$index;
}
$drawThreshold["Alpha"] = $Alpha;
$Test->drawThreshold(round(max($values), 1), $ThresholdSettings);
//горизонтальная линия по максимальному значению
$Test->drawThreshold(round(min($values), 1), $ThresholdSettings);
//горизонтальная линия по минимальному значению
$Test->drawThreshold(round(array_sum($values) / sizeof($values), 1), $ThresholdSettings);
开发者ID:NioFBI,项目名称:majordomo,代码行数:31,代码来源:index.php


注:本文中的pImage::drawXThresholdArea方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。