本文整理汇总了PHP中pImage::autoOutput方法的典型用法代码示例。如果您正苦于以下问题:PHP pImage::autoOutput方法的具体用法?PHP pImage::autoOutput怎么用?PHP pImage::autoOutput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pImage
的用法示例。
在下文中一共展示了pImage::autoOutput方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: grafico
/**
* Gera um gráfico de linha
* @param array $dados Array no formato array('Label' => array(pontos))
* @param string $tipo linha ou barra
*/
function grafico($dados, $tipo = 'linha')
{
require_once 'exemplos/graficos/pChart/class/pDraw.class.php';
require_once 'exemplos/graficos/pChart/class/pImage.class.php';
require_once 'exemplos/graficos/pChart/class/pData.class.php';
// precisamos ter dados para montar os gráficos
$DataSet = new pData();
// Adicionando os pontos de um gráfico de linha
// horas de trabalho na semana
foreach ($dados as $label => $pontos) {
$DataSet->addPoints($pontos, $label);
}
$DataSet->setAxisName(0, 'Horas');
// unidade
$DataSet->setAxisUnit(0, 'h');
$settings = array("R" => 229, "G" => 11, "B" => 11, "Alpha" => 80);
$DataSet->setPalette("Joao", $settings);
// Labels
$DataSet->addPoints(array('Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado'), 'Dias');
$DataSet->setSerieDescription('Dias', 'Dias da Semana');
$DataSet->setAbscissa('Dias');
$Graph = new pImage(700, 230, $DataSet);
$Graph->setFontProperties(array('FontName' => 'exemplos/graficos/pChart/fonts/verdana.ttf', 'FontSize' => 8));
$Graph->setGraphArea(50, 40, 670, 190);
$scale = array('GridR' => 150, 'GridG' => 150, 'GridB' => 150, 'DrawSubTicks' => true, 'CycleBackground' => true);
$Graph->drawScale($scale);
if ($tipo == 'linha') {
$Graph->drawLineChart();
} else {
$Graph->drawBarChart();
}
$Graph->drawLegend(540, 25, array('Style' => LEGEND_ROUND, 'Mode' => LEGEND_VERTICAL));
$Graph->drawText(60, 20, "Horas Trabalhadas");
$Graph->autoOutput();
}
示例2: ring2d
function ring2d($x, $y, $name)
{
$MyData = new pData();
$MyData->addPoints($x, "ScoreA");
$MyData->setSerieDescription("ScoreA", "Application A");
/* Define the absissa serie */
$MyData->addPoints($y, "Labels");
$MyData->setAbscissa("Labels");
/* Create the pChart object */
$myPicture = new pImage(500, 250, $MyData);
/* Draw a solid background */
$Settings = array("R" => 170, "G" => 183, "B" => 87, "Dash" => 1, "DashR" => 190, "DashG" => 203, "DashB" => 107);
$myPicture->drawFilledRectangle(0, 0, 500, 500, $Settings);
/* Overlay with a gradient */
$Settings = array("StartR" => 219, "StartG" => 231, "StartB" => 139, "EndR" => 1, "EndG" => 138, "EndB" => 68, "Alpha" => 50);
$myPicture->drawGradientArea(0, 0, 500, 500, DIRECTION_VERTICAL, $Settings);
$myPicture->drawGradientArea(0, 0, 500, 30, DIRECTION_VERTICAL, array("StartR" => 0, "StartG" => 0, "StartB" => 0, "EndR" => 50, "EndG" => 50, "EndB" => 50, "Alpha" => 100));
/* Add a border to the picture */
$myPicture->drawRectangle(0, 0, 500, 250, array("R" => 0, "G" => 0, "B" => 0));
/* Write the picture title */
$myPicture->setFontProperties(array("FontName" => "mod/pchart/fonts/verdana.ttf", "FontSize" => 12));
$myPicture->drawText(15, 20, $name, array("R" => 255, "G" => 255, "B" => 255));
/* Set the default font properties */
$myPicture->setFontProperties(array("FontName" => "mod/pchart/fonts/verdana.ttf", "FontSize" => 12, "R" => 80, "G" => 80, "B" => 80));
/* Enable shadow computing */
$myPicture->setShadow(TRUE, array("X" => 2, "Y" => 2, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 50));
/* Create the pPie object */
$PieChart = new pPie($myPicture, $MyData);
/* Draw an AA pie chart */
$PieChart->draw2DRing(390, 140, array("WriteValues" => TRUE, "ValueR" => 255, "ValueG" => 255, "ValueB" => 255, "Border" => TRUE));
/* Write the legend box */
$myPicture->setShadow(FALSE);
$PieChart->drawPieLegend(10, 50, array("Alpha" => 20));
/* Render the picture (choose the best way) */
$myPicture->autoOutput("2dring.png");
}
示例3: array
$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_VERTICAL, $Settings);
$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, "drawLabel() - Write labels over your charts", array("R" => 255, "G" => 255, "B" => 255));
/* Write the chart title */
$myPicture->setFontProperties(array("FontName" => "../fonts/Forgotte.ttf", "FontSize" => 11));
$myPicture->drawText(155, 55, "Average temperature", array("FontSize" => 20, "Align" => TEXT_ALIGN_BOTTOMMIDDLE));
/* Draw the scale and the 1st chart */
$myPicture->setGraphArea(60, 60, 670, 190);
$myPicture->drawFilledRectangle(60, 60, 670, 190, array("R" => 255, "G" => 255, "B" => 255, "Surrounding" => -200, "Alpha" => 10));
$myPicture->setFontProperties(array("FontName" => "../fonts/pf_arma_five.ttf", "FontSize" => 6));
$myPicture->drawScale(array("DrawSubTicks" => TRUE));
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
$myPicture->drawSplineChart();
$myPicture->setShadow(FALSE);
/* Write the chart legend */
$myPicture->drawLegend(600, 210, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL));
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
$myPicture->setFontProperties(array("FontName" => "../fonts/pf_arma_five.ttf", "FontSize" => 6));
/* Write a label over the chart */
$LabelSettings = array("TitleR" => 255, "TitleG" => 255, "TitleB" => 255, "DrawSerieColor" => FALSE, "TitleMode" => LABEL_TITLE_BACKGROUND, "OverrideTitle" => "Information", "ForceLabels" => array("Issue with the recording device", "New recording device"), "GradientEndR" => 220, "GradientEndG" => 255, "GradientEndB" => 220, "TitleBackgroundG" => 155);
$myPicture->writeLabel(array("Probe 2"), array(1, 3), $LabelSettings);
/* Write a label over the chart */
$LabelSettings = array("NoTitle" => TRUE, "GradientEndR" => 255, "GradientEndG" => 200, "GradientEndB" => 200);
$myPicture->writeLabel(array("Probe 1"), 5, $LabelSettings);
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.drawLabel.caption.png");
示例4: array
$Settings = array("StartR" => 219, "StartG" => 231, "StartB" => 139, "EndR" => 1, "EndG" => 138, "EndB" => 68, "Alpha" => 50);
$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_VERTICAL, $Settings);
$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, "drawRectangle() - Transparency & colors", array("R" => 255, "G" => 255, "B" => 255));
/* Enable shadow computing */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 20));
/* Draw a rectangle */
$RectangleSettings = array("R" => 181, "G" => 209, "B" => 27, "Alpha" => 100);
$myPicture->drawRectangle(20, 60, 400, 170, $RectangleSettings);
/* Draw a rectangle */
$RectangleSettings = array("R" => 209, "G" => 134, "B" => 27, "Alpha" => 30);
$myPicture->drawRectangle(30, 30, 200, 200, $RectangleSettings);
/* Draw a rectangle */
$RectangleSettings = array("R" => 209, "G" => 31, "B" => 27, "Alpha" => 100);
$myPicture->drawRectangle(480, 50, 650, 80, $RectangleSettings);
/* Draw a rectangle */
$RectangleSettings = array("R" => 209, "G" => 125, "B" => 27, "Alpha" => 100);
$myPicture->drawRectangle(480, 90, 650, 120, $RectangleSettings);
/* Draw a rectangle */
$RectangleSettings = array("R" => 209, "G" => 198, "B" => 27, "Alpha" => 100, "Ticks" => 2);
$myPicture->drawRectangle(480, 130, 650, 160, $RectangleSettings);
/* Draw a rectangle */
$RectangleSettings = array("R" => 134, "G" => 209, "B" => 27, "Alpha" => 100, "Ticks" => 2);
$myPicture->drawRectangle(480, 170, 650, 200, $RectangleSettings);
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.drawRectangle.png");
示例5: pData
/* CAT:Stacked chart */
/* pChart library inclusions */
include "class/pData.class.php";
include "class/pDraw.class.php";
include "class/pImage.class.php";
/* Create and populate the pData object */
$MyData = new pData();
$MyData->addPoints(array(4, 1, 0, 12, 8, 4, 0, 12, 8), "Frontend #1");
$MyData->addPoints(array(3, 12, 15, 8, VOID, VOID, 12, 15, 8), "Frontend #2");
$MyData->addPoints(array(4, 4, 4, 4, 4, 4, 4, 4, 4), "Frontend #3");
$MyData->setAxisName(0, "Average Usage");
$MyData->addPoints(array("January", "February", "March", "April", "May", "June", "July", "August", "September"), "Labels");
$MyData->setSerieDescription("Labels", "Months");
$MyData->setAbscissa("Labels");
/* Create the pChart object */
$myPicture = new pImage(700, 230, $MyData);
$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_VERTICAL, array("StartR" => 240, "StartG" => 240, "StartB" => 240, "EndR" => 180, "EndG" => 180, "EndB" => 180, "Alpha" => 100));
$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_HORIZONTAL, array("StartR" => 240, "StartG" => 240, "StartB" => 240, "EndR" => 180, "EndG" => 180, "EndB" => 180, "Alpha" => 20));
/* Set the default font properties */
$myPicture->setFontProperties(array("FontName" => "../fonts/pf_arma_five.ttf", "FontSize" => 6));
/* Draw the scale and the chart */
$myPicture->setGraphArea(60, 20, 680, 190);
$myPicture->drawScale(array("XMargin" => 10, "YMargin" => 10, "Floating" => TRUE, "DrawSubTicks" => TRUE, "Mode" => SCALE_MODE_ADDALL_START0));
$myPicture->drawStackedAreaChart(array("DrawPlot" => TRUE, "DrawLine" => TRUE, "LineSurrounding" => -20));
/* Turn on shadow processing */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
/* Write the chart legend */
$myPicture->drawLegend(480, 210, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL));
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.drawStackedAreaChart.simple.png");
示例6: pImage
$MyData->setAxisDisplay(0, AXIS_FORMAT_METRIC);
/* Create the abscissa serie */
$MyData->addPoints(array(1230768000, 1233446400, 1235865600, 1238544000, 1241136000, 1243814400), "Timestamp");
$MyData->setSerieDescription("Timestamp", "Sampled Dates");
$MyData->setAbscissa("Timestamp");
$MyData->setXAxisDisplay(AXIS_FORMAT_DATE);
/* Create the pChart object */
$myPicture = new pImage(700, 230, $MyData);
/* Draw the background */
$Settings = array("R" => 170, "G" => 183, "B" => 87, "Dash" => 1, "DashR" => 190, "DashG" => 203, "DashB" => 107);
$myPicture->drawFilledRectangle(0, 0, 700, 230, $Settings);
/* Overlay with a gradient */
$Settings = array("StartR" => 219, "StartG" => 231, "StartB" => 139, "EndR" => 1, "EndG" => 138, "EndB" => 68, "Alpha" => 50);
$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_VERTICAL, $Settings);
$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, "drawScale() - draw the X-Y scales", array("R" => 255, "G" => 255, "B" => 255));
/* Set the default font */
$myPicture->setFontProperties(array("FontName" => "../fonts/Forgotte.ttf", "FontSize" => 11));
/* Write the chart title */
$myPicture->setGraphArea(60, 60, 660, 190);
$myPicture->drawText(350, 55, "My chart title", array("FontSize" => 20, "Align" => TEXT_ALIGN_BOTTOMMIDDLE));
$myPicture->drawFilledRectangle(60, 60, 660, 190, array("R" => 255, "G" => 255, "B" => 255, "Surrounding" => -200, "Alpha" => 10));
/* Draw the scale */
$myPicture->drawScale();
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.drawScale.dates.png");
示例7: drawChart
/**
* 绘制图表并生成图片
* @method drawChart
* @return [type] [description]
*/
protected function drawChart($data_arr, $lab_arr, $pic_name)
{
/* pChart library inclusions */
include "libs/pChart2.1.4/class/pData.class.php";
include "libs/pChart2.1.4/class/pDraw.class.php";
include "libs/pChart2.1.4/class/pPie.class.php";
include "libs/pChart2.1.4/class/pImage.class.php";
/* pData object creation */
$MyData = new \pData();
/* Data definition */
$MyData->addPoints($data_arr, "Value");
/* Labels definition */
$MyData->addPoints($lab_arr, "Legend");
$MyData->setAbscissa("Legend");
/* Create the pChart object */
$myPicture = new \pImage(500, 150, $MyData);
/* Draw a gradient background */
$myPicture->drawGradientArea(0, 0, 500, 150, DIRECTION_HORIZONTAL, array("StartR" => 220, "StartG" => 220, "StartB" => 220, "EndR" => 180, "EndG" => 180, "EndB" => 180, "Alpha" => 100));
/* Add a border to the picture */
// $myPicture->drawRectangle(0,0,399,149,array("R"=>0,"G"=>0,"B"=>0));
/* Create the pPie object */
$PieChart = new \pPie($myPicture, $MyData);
/* Enable shadow computing */
$myPicture->setShadow(FALSE);
/* Set the default font properties */
$myPicture->setFontProperties(array("FontName" => __DIR__ . "/libs/pChart2.1.4/fonts/msyh.ttf", "FontSize" => 10, "R" => 80, "G" => 80, "B" => 80));
/* Draw a splitted pie chart */
$PieChart->draw3DPie(250, 100, array("Radius" => 80, "DrawLabels" => TRUE, "DataGapAngle" => 10, "DataGapRadius" => 6, "Border" => FALSE));
/* Render the picture (choose the best way) */
$myPicture->autoOutput(public_path() . '/pictures/' . $pic_name);
}
示例8: array
/* Draw a rectangle */
$myPicture->drawFilledRectangle(58, 27, 816, 228, array("R" => 0, "G" => 0, "B" => 0, "Dash" => TRUE, "DashR" => 0, "DashG" => 51, "DashB" => 51, "BorderR" => 0, "BorderG" => 0, "BorderB" => 0));
/* Turn on shadow computing */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 20));
/* Draw the scale */
$myPicture->setFontProperties(array("R" => 255, "G" => 255, "B" => 255));
$ScaleSettings = array("XMargin" => 4, "DrawSubTicks" => TRUE, "GridR" => 255, "GridG" => 255, "GridB" => 255, "AxisR" => 255, "AxisG" => 255, "AxisB" => 255, "GridAlpha" => 30, "CycleBackground" => TRUE);
$myPicture->drawScale($ScaleSettings);
/* Draw the spline chart */
$myPicture->drawFilledSplineChart();
/* Write the chart boundaries */
$BoundsSettings = array("MaxDisplayR" => 237, "MaxDisplayG" => 23, "MaxDisplayB" => 48, "MinDisplayR" => 23, "MinDisplayG" => 144, "MinDisplayB" => 237);
$myPicture->writeBounds(BOUND_BOTH, $BoundsSettings);
/* Write the 0 line */
$myPicture->drawThreshold(0, array("WriteCaption" => TRUE));
/* Write the chart legend */
$myPicture->setFontProperties(array("R" => 255, "G" => 255, "B" => 255));
$myPicture->drawLegend(560, 266, array("Style" => LEGEND_NOBORDER));
/* Write the 1st data series statistics */
$Settings = array("R" => 188, "G" => 224, "B" => 46, "Align" => TEXT_ALIGN_BOTTOMLEFT);
$myPicture->drawText(620, 270, "Max : " . ceil($MyData->getMax("Probe 1")), $Settings);
$myPicture->drawText(680, 270, "Min : " . ceil($MyData->getMin("Probe 1")), $Settings);
$myPicture->drawText(740, 270, "Avg : " . ceil($MyData->getSerieAverage("Probe 1")), $Settings);
/* Write the 2nd data series statistics */
$Settings = array("R" => 224, "G" => 100, "B" => 46, "Align" => TEXT_ALIGN_BOTTOMLEFT);
$myPicture->drawText(620, 283, "Max : " . ceil($MyData->getMax("Probe 2")), $Settings);
$myPicture->drawText(680, 283, "Min : " . ceil($MyData->getMin("Probe 2")), $Settings);
$myPicture->drawText(740, 283, "Avg : " . ceil($MyData->getSerieAverage("Probe 2")), $Settings);
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.drawFilledSplineChart.png");
开发者ID:Esleelkartea,项目名称:herramienta_para_autodiagnostico_ADEADA,代码行数:30,代码来源:example.drawFilledSplineChart.php
示例9: array
$Settings = array("StartR" => 219, "StartG" => 231, "StartB" => 139, "EndR" => 1, "EndG" => 138, "EndB" => 68, "Alpha" => 50);
$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_VERTICAL, $Settings);
$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, "drawText() - add some text to your charts", array("R" => 255, "G" => 255, "B" => 255));
/* Enable shadow computing */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 20));
/* Write some text */
$myPicture->setFontProperties(array("FontName" => "../fonts/advent_light.ttf", "FontSize" => 20));
$TextSettings = array("R" => 255, "G" => 255, "B" => 255, "Angle" => 10);
$myPicture->drawText(60, 115, "10 degree text", $TextSettings);
/* Write some text */
$TextSettings = array("R" => 0, "G" => 0, "B" => 0, "Angle" => 0, "FontSize" => 40);
$myPicture->drawText(220, 130, "Simple text", $TextSettings);
/* Write some text */
$TextSettings = array("R" => 200, "G" => 100, "B" => 0, "Angle" => 90, "FontSize" => 14);
$myPicture->drawText(500, 170, "Vertical Text", $TextSettings);
/* Write some text */
$myPicture->setFontProperties(array("FontName" => "../fonts/Bedizen.ttf", "FontSize" => 6));
$TextSettings = array("DrawBox" => TRUE, "BoxRounded" => TRUE, "R" => 0, "G" => 0, "B" => 0, "Angle" => 0, "FontSize" => 10);
$myPicture->drawText(220, 160, "Encapsulated text", $TextSettings);
/* Write some text */
$myPicture->setFontProperties(array("FontName" => "../fonts/Forgotte.ttf", "FontSize" => 6));
$TextSettings = array("DrawBox" => TRUE, "R" => 0, "G" => 0, "B" => 0, "Angle" => 0, "FontSize" => 10);
$myPicture->drawText(220, 195, "Text in a box", $TextSettings);
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.drawText.png");
示例10: pImage
$myPicture = new pImage(700, 230, $MyData);
/* Draw the background */
$Settings = array("R" => 170, "G" => 183, "B" => 87, "Dash" => 1, "DashR" => 190, "DashG" => 203, "DashB" => 107);
$myPicture->drawFilledRectangle(0, 0, 700, 230, $Settings);
/* Overlay with a gradient */
$Settings = array("StartR" => 219, "StartG" => 231, "StartB" => 139, "EndR" => 1, "EndG" => 138, "EndB" => 68, "Alpha" => 50);
$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_VERTICAL, $Settings);
$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(60, 60, 450, 190, array("R" => 255, "G" => 255, "B" => 255, "Surrounding" => -200, "Alpha" => 10));
$myPicture->drawScale(array("DrawSubTicks" => TRUE));
/* Draw one static threshold area */
$myPicture->drawThresholdArea(5, 15, array("R" => 226, "G" => 194, "B" => 54, "Alpha" => 40));
/* Draw the scale and do some cosmetics */
$myPicture->setGraphArea(500, 60, 670, 190);
$myPicture->drawFilledRectangle(500, 60, 670, 190, array("R" => 255, "G" => 255, "B" => 255, "Surrounding" => -200, "Alpha" => 10));
$myPicture->drawScale(array("Pos" => SCALE_POS_TOPBOTTOM, "DrawSubTicks" => TRUE));
/* Draw one static threshold area */
$myPicture->drawThresholdArea(5, 15, array("R" => 206, "G" => 231, "B" => 64, "Alpha" => 20));
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.drawThresholdArea.png");
开发者ID:Esleelkartea,项目名称:herramienta_para_autodiagnostico_ADEADA,代码行数:30,代码来源:example.drawThresholdArea.php
示例11: pImage
include "../class/pImage.class.php";
/* Create the pChart object */
$myPicture = new pImage(700, 230);
/* Draw the background */
$Settings = array("R" => 170, "G" => 183, "B" => 87, "Dash" => 1, "DashR" => 190, "DashG" => 203, "DashB" => 107);
$myPicture->drawFilledRectangle(0, 0, 700, 230, $Settings);
/* Overlay with a gradient */
$Settings = array("StartR" => 219, "StartG" => 231, "StartB" => 139, "EndR" => 1, "EndG" => 138, "EndB" => 68, "Alpha" => 50);
$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_VERTICAL, $Settings);
$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, "drawFromGIF() - add pictures to your charts", array("R" => 255, "G" => 255, "B" => 255));
/* Turn off shadow computing */
$myPicture->setShadow(FALSE);
/* Draw a GIF object */
$myPicture->drawFromGIF(180, 50, "resources/computer.gif");
/* Turn on shadow computing */
$myPicture->setShadow(TRUE, array("X" => 2, "Y" => 2, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 20));
/* Draw a GIF object */
$myPicture->drawFromGIF(400, 50, "resources/computer.gif");
/* Write the legend */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 20));
$TextSettings = array("R" => 255, "G" => 255, "B" => 255, "FontSize" => 10, "FontName" => "../fonts/calibri.ttf", "Align" => TEXT_ALIGN_BOTTOMMIDDLE);
$myPicture->drawText(240, 200, "Without shadow", $TextSettings);
$myPicture->drawText(460, 200, "With enhanced shadow", $TextSettings);
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.drawFromGIF.png");
示例12: array
$myPicture->drawPolygon($Plots, $PolygonSettings);
$myPicture->addToImageMap("POLY", "402,62,460,80,420,190,360,168", $myPicture->toHTMLColor(71, 87, 145), "Polygon", "My Message");
/* Turn of Antialiasing */
$myPicture->Antialias = FALSE;
/* Draw a customized filled rectangle */
$RectangleSettings = array("R" => 150, "G" => 200, "B" => 170, "Dash" => TRUE, "DashR" => 170, "DashG" => 220, "DashB" => 190, "BorderR" => 255, "BorderG" => 255, "BorderB" => 255);
$myPicture->drawFilledRectangle(20, 60, 210, 170, $RectangleSettings);
$myPicture->addToImageMap("RECT", "20,60,210,170", $myPicture->toHTMLColor(150, 200, 170), "Box 1", "Message 1");
/* Draw a customized filled rectangle */
$RectangleSettings = array("R" => 209, "G" => 134, "B" => 27, "Alpha" => 30);
$myPicture->drawFilledRectangle(30, 30, 200, 200, $RectangleSettings);
$myPicture->addToImageMap("RECT", "30,30,200,200", $myPicture->toHTMLColor(209, 134, 27), "Box 2", "Message 2");
/* Draw a customized filled rectangle */
$RectangleSettings = array("R" => 209, "G" => 31, "B" => 27, "Alpha" => 100, "Surrounding" => 30);
$myPicture->drawFilledRectangle(480, 50, 650, 80, $RectangleSettings);
$myPicture->addToImageMap("RECT", "480,50,650,80", $myPicture->toHTMLColor(209, 31, 27), "Box 3", "Message 3");
/* Draw a customized filled rectangle */
$RectangleSettings = array("R" => 209, "G" => 125, "B" => 27, "Alpha" => 100, "Surrounding" => 30);
$myPicture->drawFilledRectangle(480, 90, 650, 120, $RectangleSettings);
$myPicture->addToImageMap("RECT", "480,90,650,120", $myPicture->toHTMLColor(209, 125, 27), "Box 4", "Message 4");
/* Draw a customized filled rectangle */
$RectangleSettings = array("R" => 209, "G" => 198, "B" => 27, "Alpha" => 100, "Surrounding" => 30, "Ticks" => 2);
$myPicture->drawFilledRectangle(480, 130, 650, 160, $RectangleSettings);
$myPicture->addToImageMap("RECT", "480,130,650,160", $myPicture->toHTMLColor(209, 198, 27), "Box 5", "Message 5");
/* Draw a customized filled rectangle */
$RectangleSettings = array("R" => 134, "G" => 209, "B" => 27, "Alpha" => 100, "Surrounding" => 30, "Ticks" => 2);
$myPicture->drawFilledRectangle(480, 170, 650, 200, $RectangleSettings);
$myPicture->addToImageMap("RECT", "480,170,650,200", $myPicture->toHTMLColor(134, 209, 27), "Box 6", "Message 6");
/* Render the picture (choose the best way) */
$myPicture->autoOutput("../tmp/Shapes.png");
示例13: pImage
/* Give a name to the Y axis */
$MyData->setAxisName(0, "Temperatures");
/* Create the pChart object */
$myPicture = new pImage(700, 230, $MyData);
/* Turn of Antialiasing */
$myPicture->Antialias = FALSE;
/* Add a border to the picture */
$myPicture->drawRectangle(0, 0, 699, 229, array("R" => 0, "G" => 0, "B" => 0));
/* Write the chart title */
$myPicture->setFontProperties(array("FontName" => "../fonts/Forgotte.ttf", "FontSize" => 11));
$myPicture->drawText(150, 35, "Average temperature", array("FontSize" => 20, "Align" => TEXT_ALIGN_BOTTOMMIDDLE));
/* Set the default font */
$myPicture->setFontProperties(array("FontName" => "../fonts/pf_arma_five.ttf", "FontSize" => 6));
/* Define the chart area */
$myPicture->setGraphArea(60, 40, 650, 200);
/* Draw the scale */
$scaleSettings = array("XMargin" => 10, "YMargin" => 10, "Floating" => TRUE, "GridR" => 200, "GridG" => 200, "GridB" => 200, "DrawSubTicks" => TRUE, "CycleBackground" => TRUE);
$myPicture->drawScale($scaleSettings);
/* Turn on Antialiasing */
$myPicture->Antialias = TRUE;
/* Draw the line of best fit */
$myPicture->drawBestFit();
/* Turn on shadows */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
/* Draw the line chart */
$myPicture->drawPlotChart();
/* Write the chart legend */
$myPicture->drawLegend(580, 20, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL));
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.drawBestFit.png");
示例14: array
/* Do a gradient overlay */
$Settings = array("StartR" => 194, "StartG" => 231, "StartB" => 44, "EndR" => 43, "EndG" => 107, "EndB" => 58, "Alpha" => 50);
$myPicture->drawGradientArea(0, 0, 210, 100, DIRECTION_VERTICAL, $Settings);
$myPicture->drawGradientArea(0, 0, 210, 20, DIRECTION_VERTICAL, array("StartR" => 0, "StartG" => 0, "StartB" => 0, "EndR" => 50, "EndG" => 50, "EndB" => 50, "Alpha" => 100));
/* Add a border to the picture */
$myPicture->drawRectangle(0, 0, 209, 99, array("R" => 0, "G" => 0, "B" => 0));
/* Write the picture title */
$myPicture->setFontProperties(array("FontName" => "../fonts/Silkscreen.ttf", "FontSize" => 6));
$myPicture->drawText(10, 13, "pSurface() :: Surface charts", array("R" => 255, "G" => 255, "B" => 255));
/* Define the charting area */
$myPicture->setGraphArea(50, 60, 180, 80);
$myPicture->drawFilledRectangle(50, 60, 180, 80, array("R" => 255, "G" => 255, "B" => 255, "Surrounding" => -200, "Alpha" => 20));
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1));
/* Create the surface object */
$mySurface = new pSurface($myPicture);
/* Set the grid size */
$mySurface->setGrid(9, 1);
/* Write the axis labels */
$myPicture->setFontProperties(array("FontName" => "../fonts/pf_arma_five.ttf", "FontSize" => 6));
$myPicture->setFontProperties(array("FontName" => "../fonts/Bedizen.ttf", "FontSize" => 7));
$mySurface->writeXLabels(array("Angle" => 45, "Labels" => array("Run 1", "Run 2", "Run 3", "Run 4", "Run 5", "Run 6", "Run 7", "Run 8", "Run 9", "Run 10")));
$mySurface->writeYLabels(array("Labels" => array("Probe 1", "Probe 2")));
/* Add random values */
for ($i = 0; $i <= 10; $i++) {
$mySurface->addPoint($i, rand(0, 1), rand(0, 100));
}
/* Draw the surface chart */
$mySurface->drawSurface(array("Border" => TRUE, "Surrounding" => 40));
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.surface.simple.png");
示例15: array
$myPicture->drawFilledRectangle(0, 0, 700, 230, $Settings);
/* Overlay with a gradient */
$Settings = array("StartR" => 219, "StartG" => 231, "StartB" => 139, "EndR" => 1, "EndG" => 138, "EndB" => 68, "Alpha" => 50);
$myPicture->drawGradientArea(0, 0, 700, 230, DIRECTION_VERTICAL, $Settings);
/* Add a border to the picture */
$myPicture->drawRectangle(0, 0, 699, 229, array("R" => 0, "G" => 0, "B" => 0));
/* Set the default font */
$myPicture->setFontProperties(array("FontName" => FONT_PATH . "/pf_arma_five.ttf", "FontSize" => 6));
/* Define the chart area */
$myPicture->setGraphArea(60, 40, 650, 200);
/* Draw the scale */
$scaleSettings = array("GridR" => 200, "GridG" => 200, "GridB" => 200, "DrawSubTicks" => TRUE, "CycleBackground" => TRUE);
$myPicture->drawScale($scaleSettings);
/* Write the chart legend */
$myPicture->drawLegend(580, 12, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL));
/* Turn on shadow computing */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
/* Draw the chart */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
$Settings = array("RecordImageMap" => TRUE);
$myPicture->drawBarChart($Settings);
/* Replace the labels of the image map */
$Labels = array("Jan: 140", "Feb: 0", "Mar: 340", "Apr: 300", "May: 320", "Jun: 300", "Jul: 200", "Aug: 100", "Sep: 50");
$myPicture->replaceImageMapValues("Server B", $Labels);
/* Repalce the titles of the image map */
$Titles = array("Jan 2k11", "Feb 2k11", "Mar 2k11", "Apr 2k11", "May 2k11", "Jun 2k11", "Jul 2k11", "Aug 2k11", "Sep 2k11");
$myPicture->replaceImageMapTitle("Server A", "Second server");
$myPicture->replaceImageMapTitle("Server B", $Titles);
/* Render the picture (choose the best way) */
$myPicture->autoOutput("../tmp/BarChart.labels.png");