本文整理汇总了PHP中pImage::base64方法的典型用法代码示例。如果您正苦于以下问题:PHP pImage::base64方法的具体用法?PHP pImage::base64怎么用?PHP pImage::base64使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pImage
的用法示例。
在下文中一共展示了pImage::base64方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reportday
public function reportday($projectID)
{
/* pChart library inclusions */
include "../p_chart/class/pData.class.php";
include "../p_chart/class/pDraw.class.php";
include "../p_chart/class/pImage.class.php";
//每日剩余
$where = "project = {$projectID} AND deleted = '0' AND status NOT IN ( 'cancel','closed') ";
$tasks_all = $this->task->getTasksByCondition($where);
$tasks_all_count = count($tasks_all);
$this->view->tasks_all_count = $tasks_all_count;
$where = "project = {$projectID} AND deleted = '0'";
$allFinishedDate = $this->task->getAllFinishedDate($where);
$tasks_un_finished_x = array();
$tasks_un_finished_y = array();
foreach (array_reverse($allFinishedDate) as $v) {
$where = "project = {$projectID} AND deleted = '0' AND status NOT IN ( 'cancel','closed') AND finishedDate <= '{$v->date} 23:59:59' AND finishedDate != '0000-00-00 00:00:00'";
$count = $this->task->getUnFinishedTasksPerDay($where, $tasks_all_count);
$tasks_un_finished_x[] = date('m-d', strtotime($v->date));
$tasks_un_finished_y[] = $count;
}
/* Create and populate the pData object */
$MyData = new pData();
$MyData->addPoints($tasks_un_finished_y, "Probe 1");
$MyData->setSerieWeight("Probe 1", 2);
$MyData->setAxisName(0, "");
$MyData->addPoints($tasks_un_finished_x, "Labels");
$MyData->setSerieDescription("Labels", "Months");
$MyData->setAbscissa("Labels");
/* Create the pChart object */
$myPicture = new pImage(700, 230, $MyData);
/* Turn of Antialiasing */
$myPicture->Antialias = FALSE;
/* 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 chart title */
$myPicture->setFontProperties(array("FontName" => "../p_chart/fonts/msyh.ttf", "FontSize" => 8, "R" => 255, "G" => 255, "B" => 255));
$myPicture->drawText(10, 16, "每日剩余任务数", array("FontSize" => 10, "Align" => TEXT_ALIGN_BOTTOMLEFT));
/* Set the default font */
$myPicture->setFontProperties(array("FontName" => "../p_chart/fonts/msyh.ttf", "FontSize" => 8, "R" => 0, "G" => 0, "B" => 0));
/* 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;
/* Enable shadow computing */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
/* Draw the line chart */
$myPicture->drawLineChart();
$myPicture->drawPlotChart(array("DisplayValues" => TRUE, "PlotBorder" => TRUE, "BorderSize" => 2, "Surrounding" => -60, "BorderAlpha" => 80));
/* Write the chart legend */
$myPicture->drawLegend(590, 9, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL, "FontR" => 255, "FontG" => 255, "FontB" => 255));
/* Render the picture (choose the best way) */
$myPicture->autoOutput();
$img = $myPicture->base64("output.png");
$this->view->src_line = $img;
//每位成员剩余
$where = "project = {$projectID} AND deleted = '0' AND (status = 'wait' OR status = 'doing') AND assignedTo !='' ";
$tasks_un_finished_per_member = $this->task->getUnFinishedTasksPerAssignedTo($where);
$tasks_un_finished_member_x = array();
$tasks_un_finished_member_y = array();
foreach ($tasks_un_finished_per_member as $v) {
$tasks_un_finished_member_x[] = $v->value;
$tasks_un_finished_member_y[] = $v->name;
}
/* Create and populate the pData object */
$MyData = new pData();
$MyData->addPoints($tasks_un_finished_member_x, "Hits");
$MyData->setAxisName(0, "剩余任务数");
$MyData->addPoints($tasks_un_finished_member_y, "Browsers");
$MyData->setSerieDescription("Browsers", "Browsers");
$MyData->setAbscissa("Browsers");
//$MyData->setAbscissaName("Browsers");
/* Create the pChart object */
$myPicture = new pImage(500, 500, $MyData);
$myPicture->drawGradientArea(0, 0, 500, 500, DIRECTION_VERTICAL, array("StartR" => 240, "StartG" => 240, "StartB" => 240, "EndR" => 180, "EndG" => 180, "EndB" => 180, "Alpha" => 100));
$myPicture->drawGradientArea(0, 0, 500, 500, DIRECTION_HORIZONTAL, array("StartR" => 240, "StartG" => 240, "StartB" => 240, "EndR" => 180, "EndG" => 180, "EndB" => 180, "Alpha" => 20));
$myPicture->setFontProperties(array("FontName" => "../p_chart/fonts/msyh.ttf", "FontSize" => 8));
/* Draw the chart scale */
$myPicture->setGraphArea(100, 30, 480, 480);
$myPicture->drawScale(array("CycleBackground" => TRUE, "DrawSubTicks" => TRUE, "GridR" => 0, "GridG" => 0, "GridB" => 0, "GridAlpha" => 10, "Pos" => SCALE_POS_TOPBOTTOM));
/* Turn on shadow computing */
$myPicture->setShadow(TRUE, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
/* Create the per bar palette */
$Palette = array("0" => array("R" => 188, "G" => 224, "B" => 46, "Alpha" => 100), "1" => array("R" => 224, "G" => 100, "B" => 46, "Alpha" => 100), "2" => array("R" => 224, "G" => 214, "B" => 46, "Alpha" => 100), "3" => array("R" => 46, "G" => 151, "B" => 224, "Alpha" => 100), "4" => array("R" => 176, "G" => 46, "B" => 224, "Alpha" => 100), "5" => array("R" => 224, "G" => 46, "B" => 117, "Alpha" => 100), "6" => array("R" => 92, "G" => 224, "B" => 46, "Alpha" => 100), "7" => array("R" => 224, "G" => 176, "B" => 46, "Alpha" => 100));
/* Draw the chart */
$myPicture->drawBarChart(array("DisplayPos" => LABEL_POS_INSIDE, "DisplayValues" => TRUE, "Rounded" => TRUE, "Surrounding" => 30, "OverrideColors" => $Palette));
/* Write the legend */
$myPicture->drawLegend(570, 215, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL));
/* Render the picture (choose the best way) */
$myPicture->autoOutput();
//.........这里部分代码省略.........