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


PHP Text::SetPos方法代码示例

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


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

示例1: generate_image

function generate_image($lang, $idx)
{
    global $LANGUAGES;
    $up_to_date = get_stats($idx, $lang, 'uptodate');
    $up_to_date = $up_to_date[0];
    //
    $outdated = @get_stats($idx, $lang, 'outdated');
    $outdated = $outdated[0];
    //
    $missing = get_stats($idx, $lang, 'notrans');
    $missing = $missing[0];
    //
    $no_tag = @get_stats($idx, $lang, 'norev');
    $no_tag = $no_tag[0];
    $data = array($up_to_date, $outdated, $missing, $no_tag);
    $percent = array();
    $total = array_sum($data);
    // Total ammount in EN manual (to calculate percentage values)
    $total_files_lang = $total - $missing;
    // Total ammount of files in translation
    foreach ($data as $value) {
        $percent[] = round($value * 100 / $total);
    }
    $legend = array($percent[0] . '%% up to date (' . $up_to_date . ')', $percent[1] . '%% outdated (' . $outdated . ')', $percent[2] . '%% missing (' . $missing . ')', $percent[3] . '%% without EN-Revision (' . $no_tag . ')');
    $title = 'Details for ' . $LANGUAGES[$lang] . ' PHP Manual';
    $graph = new PieGraph(530, 300);
    $graph->SetShadow();
    $graph->title->Set($title);
    $graph->title->Align('left');
    $graph->title->SetFont(FF_FONT1, FS_BOLD);
    $graph->legend->Pos(0.02, 0.18, "right", "center");
    $graph->subtitle->Set('(Total: ' . $total_files_lang . ' files)');
    $graph->subtitle->Align('left');
    $graph->subtitle->SetColor('darkred');
    $t1 = new Text(date('m/d/Y'));
    $t1->SetPos(522, 294);
    $t1->SetFont(FF_FONT1, FS_NORMAL);
    $t1->Align("right", 'bottom');
    $t1->SetColor("black");
    $graph->AddText($t1);
    $p1 = new PiePlot3D($data);
    $p1->SetSliceColors(array("#68d888", "#ff6347", "#dcdcdc", "#f4a460"));
    if ($total_files_lang != $up_to_date) {
        $p1->ExplodeAll();
    }
    $p1->SetCenter(0.35, 0.55);
    $p1->value->Show(false);
    $p1->SetLegends($legend);
    $graph->Add($p1);
    $graph->Stroke("../www/images/revcheck/info_revcheck_php_{$lang}.png");
}
开发者ID:phpsource,项目名称:web-doc,代码行数:51,代码来源:gen_picture_info.php

示例2: Text

$graph->AddY2($lineFound);
//
// Infotexte einfuegen
//
$txtStat1 = new Text(tr('graph_statistics_04') . strftime('%d-%m-%Y', time()));
$txtStat1->SetPos(55, 55);
$txtStat1->SetFont(FF_ARIAL, FS_NORMAL, 10);
$lineHeight = $txtStat1->GetFontHeight($graph->img);
$hiddenCaches = XDb::xSimpleQueryValue("SELECT COUNT(*) FROM `caches` WHERE (`status`=1 OR `status`=2 OR `status`=3)", 0);
$txtStat2 = new Text(tr('graph_statistics_05') . str_replace(',', '.', number_format($hiddenCaches)));
$txtStat2->SetPos(55, 55 + $lineHeight * 1.5);
$txtStat2->SetFont(FF_ARIAL, FS_NORMAL, 8);
$txtStat2->SetColor('blue');
$activeCaches = XDb::xSimpleQueryValue("SELECT COUNT(*) FROM `caches` WHERE `status`=1", 0);
$txtStat3 = new Text(tr('graph_statistics_06') . str_replace(',', '.', number_format($activeCaches)));
$txtStat3->SetPos(55, 55 + $lineHeight * 2.5);
$txtStat3->SetFont(FF_ARIAL, FS_NORMAL, 8);
$txtStat3->SetColor('blue');
$foundEntries = XDb::xMultiVariableQueryValue("SELECT COUNT(*) FROM `cache_logs` WHERE `type`=1 AND `deleted`=0", 0);
$txtStat5 = new Text(tr('graph_statistics_07') . str_replace(',', '.', number_format($foundEntries)));
$txtStat5->SetPos(55, 55 + $lineHeight * 5.0);
$txtStat5->SetFont(FF_ARIAL, FS_NORMAL, 8);
$txtStat5->SetColor('darkgreen');
$graph->AddText($txtStat1);
$graph->AddText($txtStat2);
$graph->AddText($txtStat3);
$graph->AddText($txtStat5);
//
// Display the graph
//
$graph->Stroke();
开发者ID:kojoty,项目名称:opencaching-pl,代码行数:31,代码来源:new-caches-oc.php

示例3: array

// content="text/plain; charset=utf-8"
require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_bar.php';
$datay = array(12, 8, 19, 3, 10, 5);
// Create the graph. These two calls are always required
$graph = new Graph(300, 200);
$graph->SetScale('textlin');
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40, 30, 20, 40);
// Create a bar pot
$bplot = new BarPlot($datay);
$graph->Add($bplot);
// Create and add a new text
$txt = new Text("This is a text\nwith many\nand even\nmore\nlines of text");
$txt->SetPos(0.5, 0.5, 'center', 'center');
$txt->SetFont(FF_FONT2, FS_BOLD);
$txt->ParagraphAlign('center');
$txt->SetBox('yellow', 'navy', 'gray');
$txt->SetColor('red');
$graph->AddText($txt);
// Setup the titles
$graph->title->Set("A simple bar graph");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
// Display the graph
$graph->Stroke();
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:31,代码来源:example25.2.php

示例4: Stroke


//.........这里部分代码省略.........
                 $g->img->FilledRectangle($x, $ystart, $x + $wb - 1, $yend);
             } else {
                 $g->img->FilledRectangle($x, $ystart, $x + $wb - 1, $yend - $th);
             }
             $x += $wb;
         }
         if ($this->iDebugBackground) {
             $g->SetAlphaBlending();
             if (($i & 1) == 0) {
                 $g->img->SetColor('lightblue@0.5');
             } else {
                 $g->img->SetColor('yellow@0.5');
             }
             $g->img->FilledRectangle($startx, $ystart - 2, $x, $yend);
         }
         if ($spec->iInterCharModuleSpace) {
             $x += $w;
         }
     }
     $g->img->SetColor($this->iColor);
     if (!($spec->iLeftData === '')) {
         $g->img->SetTextAlign('right', 'top');
         $g->img->SetFont($this->iSmallFontFam, $this->iSmallFontStyle, $this->iSmallFontSize);
         $g->img->StrokeText($w * $spec->iLeftMargin - 3, $yend - $th, $spec->iLeftData);
     }
     if (!($spec->iRightData === '')) {
         $g->img->SetTextAlign('left', 'top');
         $g->img->SetFont($this->iSmallFontFam, $this->iSmallFontStyle, $this->iSmallFontSize);
         $g->img->StrokeText($x + 3, $yend - $th, $spec->iRightData);
     }
     if ($spec->iStrokeDataBelow) {
         $y = $yend + $this->iDataBelowMargin;
         $bw = $totwidth - $spec->iLeftMargin * $w - $spec->iRightMargin * $w;
         $x = $spec->iLeftMargin * $w + floor($bw / 2);
         $g->img->SetTextAlign('center', 'top');
         $g->img->SetFont($this->iFontFam, $this->iFontStyle, $this->iFontSize);
         if ($this->iHumanTxt !== '') {
             $g->img->StrokeText($x, $y, $this->iHumanTxt);
         } else {
             $g->img->StrokeText($x, $y, $spec->iData);
         }
     }
     if ($aShowDetails) {
         $g->img->SetColor('navy');
         $g->img->SetTextAlign('left', 'top');
         $g->img->SetFont(FF_FONT2);
         $g->img->StrokeText($textmargin, $this->iTopMargin, $s);
     }
     if (ADD_DEMOTXT === true) {
         $t = new Text("<<DEMO>>", $totwidth / 2, $ystart);
         if ($this->iModuleWidth > 1) {
             if ($this->iModuleWidth > 4) {
                 $t->SetFont(FF_ARIAL, FS_BOLD, 32);
                 $step = 140;
                 $yadj = 50;
             } else {
                 $t->SetFont(FF_ARIAL, FS_BOLD, 24);
                 $step = 110;
                 $yadj = 40;
             }
         } else {
             $t->SetFont(FF_ARIAL, FS_BOLD, 18);
             $step = 80;
             $yadj = 30;
         }
         $t->SetColor('red@0.4');
         $t->Align('center', 'center');
         $t->SetAngle(-25);
         $n = ceil($totwidth / $step);
         for ($i = 0; $i < $n; ++$i) {
             $t->SetPos(-30 + $i * $step, ($yend - $ystart) / 2 - $yadj);
             $t->Stroke($g->img);
         }
     }
     if ($this->iVertical) {
         $g->img->img = $this->Rotate($g->img->img, 90);
     }
     if ($this->iScale != 1) {
         $nwidth = round($width * $this->iScale);
         $nheight = round($height * $this->iScale);
         if ($this->iVertical) {
             $tmp = $height;
             $height = $width;
             $width = $tmp;
             $tmp = $nheight;
             $nheight = $nwidth;
             $nwidth = $tmp;
         }
         $img = @imagecreatetruecolor($nwidth, $nheight);
         if ($img) {
             imagealphablending($img, true);
             imagecopyresampled($img, $g->img->img, 0, 0, 0, 0, $nwidth, $nheight, $width, $height);
             $g->img->CreateImgCanvas($nwidth, $nheight);
             $g->img->img = $img;
         } else {
             return false;
         }
     }
     return $g->Stroke($aFile);
 }
开发者ID:halimc17,项目名称:magsys,代码行数:101,代码来源:jpgraph_barcode.php

示例5: createhorizoncolumnar

 /**
  * 横柱图
  * 
  */
 function createhorizoncolumnar($title, $subtitle, $data = array(), $size = 40, $height = 100, $width = 80, $legend = array())
 {
     vendor("Jpgraph.jpgraph");
     vendor("Jpgraph.jpgraph_bar");
     $datay = $data;
     $datax = $legend;
     //编码转化
     foreach ($datax as $k => $v) {
         $datax[$k] = iconv('utf-8', 'gb2312', $v);
     }
     // Size of graph
     $count = count($datay);
     $addheight = 0;
     if ($count > 10) {
         $addheight = ($count - 10) * 20;
     }
     $height = $height + $addheight;
     // Set the basic parameters of the graph
     $graph = new Graph($width, $height, 'auto');
     $graph->SetScale("textlin");
     // No frame around the image
     $graph->SetFrame(false);
     $graph->SetFrame(false, '#ffffff', 0);
     //去掉周围的边框
     // Rotate graph 90 degrees and set margin
     $graph->Set90AndMargin(70, 10, 50, 30);
     // Set white margin color
     $graph->SetMarginColor('white');
     // Use a box around the plot area
     $graph->SetBox();
     // Use a gradient to fill the plot area
     $graph->SetBackgroundGradient('white', 'white', GRAD_HOR, BGRAD_PLOT);
     // Setup title
     $graph->title->Set(iconv('utf-8', 'gb2312', "{$title}"));
     $graph->title->SetFont(FF_SIMSUN, FS_BOLD, 12);
     $graph->subtitle->Set("(" . iconv('utf-8', 'gb2312', $subtitle) . ")");
     $graph->subtitle->SetFont(FF_SIMSUN, FS_NORMAL, 10);
     // Setup X-axis
     $graph->xaxis->SetTickLabels($datax);
     $graph->xaxis->SetFont(FF_SIMSUN, FS_NORMAL, 10);
     // Some extra margin looks nicer
     $graph->xaxis->SetLabelMargin(10);
     // Label align for X-axis
     $graph->xaxis->SetLabelAlign('right', 'center');
     // Add some grace to y-axis so the bars doesn't go
     // all the way to the end of the plot area
     $graph->yaxis->scale->SetGrace(10);
     // We don't want to display Y-axis
     $graph->yaxis->Hide();
     // Now create a bar pot
     $bplot = new BarPlot($datay);
     //$bplot->SetShadow();
     //You can change the width of the bars if you like
     //$bplot->SetWidth(0.5);
     // Set gradient fill for bars
     $bplot->SetFillGradient('blue', '#0080C0', GRAD_HOR);
     // We want to display the value of each bar at the top
     $bplot->value->Show();
     $bplot->value->SetFont(FF_ARIAL, FS_NORMAL, 7);
     $bplot->value->SetAlign('left', 'center');
     $bplot->value->SetColor("black");
     $bplot->value->SetFormat('%.0f');
     //$bplot->SetValuePos('max');
     // Add the bar to the graph
     $graph->Add($bplot);
     // Add some explanation text
     $txt = new Text('');
     $txt->SetPos(130, 399, 'center', 'bottom');
     $txt->SetFont(FF_COMIC, FS_NORMAL, 8);
     $graph->Add($txt);
     // .. and stroke the graph
     $graph->Stroke();
 }
开发者ID:leifuchen0111,项目名称:company,代码行数:77,代码来源:Chart.class.php

示例6: BarPlot

$graph->xaxis->SetLabelMargin(10);
// Label align for X-axis
$graph->xaxis->SetLabelAlign('right', 'center');
// Add some grace to y-axis so the bars doesn't go
// all the way to the end of the plot area
$graph->yaxis->scale->SetGrace(20);
// We don't want to display Y-axis
$graph->yaxis->Hide();
// Now create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetShadow();
//You can change the width of the bars if you like
//$bplot->SetWidth(0.5);
// Set gradient fill for bars
$bplot->SetFillGradient('darkred', 'yellow', GRAD_HOR);
// We want to display the value of each bar at the top
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL, FS_BOLD, 10);
//$bplot->value->SetAlign('left','center');
$bplot->value->SetColor("white");
$bplot->value->SetFormat('%.1f');
$bplot->SetValuePos('max');
// Add the bar to the graph
$graph->Add($bplot);
// Add some explanation text
$txt = new Text('Note: Higher value is better.');
$txt->SetPos(190, 399, 'center', 'bottom');
$txt->SetFont(FF_ARIAL, FS_NORMAL, 8);
$graph->Add($txt);
// .. and stroke the graph
$graph->Stroke();
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:horizbarex6.php

示例7: Text

$bplot->SetCSIMTargets($targ, $alts);
$bplot->SetFillColor("orange");
$bplot->SetLegend('Year 2001 %%', '#kalle ', '%s');
// Display the values on top of each bar
$bplot->SetShadow();
$bplot->value->SetFormat(" \$ %2.1f", 70);
$bplot->value->SetFont(FF_ARIAL, FS_NORMAL, 9);
$bplot->value->SetColor("blue");
$bplot->value->Show();
$graph->Add($bplot);
// Create a big "button" that has an image map action
$txt1 = new Text("A simple text with\ntwo rows");
$txt1->SetFont(FF_ARIAL);
$txt1->SetBox('lightblue', 'black', 'white@1', 5);
$txt1->SetParagraphAlign('center');
$txt1->SetPos(40, 50);
$txt1->SetCSIMTarget('#88', 'Text element');
$graph->Add($txt1);
// Add image map to the graph title as well (you can do this to the
// sub- and subsub-title as well)
$graph->title->Set("Image maps barex1");
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->title->SetCSIMTarget('#45', 'Title for Bar');
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
// Setup the axis title image map and font style
$graph->yaxis->title->SetFont(FF_FONT2, FS_BOLD);
$graph->yaxis->title->SetCSIMTarget('#55', 'Y-axis title');
$graph->xaxis->title->SetFont(FF_FONT2, FS_BOLD);
$graph->xaxis->title->SetCSIMTarget('#55', 'X-axis title');
// Send back the HTML page which will call this script again
开发者ID:Lazaro-Gallo,项目名称:psmn,代码行数:31,代码来源:titlecsimex01.php

示例8: array

include "../jpgraph.php";
include "../jpgraph_line.php";
include "../jpgraph_error.php";
include "../jpgraph_bar.php";
$l1datay = array(11, 9, 2, 4, 3, 13, 17);
$l2datay = array(23, 12, 5, 19, 17, 10, 15);
$datax = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul");
// Create the graph.
$graph = new Graph(350, 200, "auto");
$graph->img->SetMargin(40, 70, 20, 40);
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->SetColor(array(250, 250, 250));
$graph->img->SetTransparent("white");
$t1 = new Text("This is a text");
$t1->SetPos(0.5, 0.5);
$t1->SetOrientation("h");
$t1->SetFont(FF_FONT1, FS_BOLD);
$t1->SetBox("white", "black", "gray");
$t1->SetColor("black");
$graph->AddText($t1);
// Create the linear error plot
$l1plot = new LinePlot($l1datay);
$l1plot->SetColor("blue");
$l1plot->SetWeight(2);
$l1plot->SetLegend("Prediction");
// Create the bar plot
$l2plot = new BarPlot($l2datay);
$l2plot->SetFillColor("orange");
$l2plot->SetLegend("Result");
// Add the plots to the graph
开发者ID:jeromecc,项目名称:tuv2,代码行数:31,代码来源:example16.5.php

示例9: WindrosePlot

$wp1 = new WindrosePlot($data);
$wp1->SetType(WINDROSE_TYPE16);
// This is the default encoding
$wp1->SetDataKeyEncoding(KEYENCODING_ANTICLOCKWISE);
$wp1->legend->Hide();
$wp1->SetPos($xpos1, $ypos1);
$wp1->SetSize(0.5);
// Create the second plot
$wp2 = new WindrosePlot($data);
$wp2->SetType(WINDROSE_TYPE16);
$wp2->SetDataKeyEncoding(KEYENCODING_CLOCKWISE);
$wp2->legend->Hide();
$wp2->SetPos($xpos2, $ypos1);
$wp2->SetSize(0.5);
$txt1 = new Text('KEYENCODING_ANTICLOCKWISE');
$txt1->SetFont(FF_COURIER, FS_BOLD, 12);
$txt1->SetPos($xpos1, $ypos2);
$txt1->SetAlign('center', 'top');
$txt2 = new Text('KEYENCODING_CLOCKWISE');
$txt2->SetFont(FF_COURIER, FS_BOLD, 12);
$txt2->SetPos($xpos2, $ypos2);
$txt2->SetAlign('center', 'top');
// Finally add it to the graph and send back to the client
$graph->Add($wp1);
$graph->Add($txt1);
$graph->Add($wp2);
$graph->Add($txt2);
$graph->Stroke();
?>

开发者ID:munishsethi777,项目名称:eliveui,代码行数:29,代码来源:windrose_ex9.1.php

示例10: elseif

if ($z == 2) {
    $omimai = " 熊本地震の被災地の皆様に、心よりお見舞い申し上げます。\n";
} elseif ($z == 1) {
    $omimai = "東日本大震災の被災地の皆様に、心よりお見舞い申し上げます。\n";
} elseif ($z == 0) {
    $omimai = "鳥取県中部地震の被災地の皆様に、心よりお見舞い申し上げます。\n";
}
$omimai .= " 一日も早く、復興が出来ますように、お祈り申し上げます。\n";
$omimai .= "                           " . $data_time . "更新";
$graph->xaxis->title->Set($omimai);
$graph->xaxis->title->SetFont(FF_GOTHIC, FS_NORMAL, 10);
$graph->xaxis->title->SetMargin(-585);
$graph->Set90AndMargin(312, 89, 90, 90);
$graph->SetBackgroundGradient('white', 'green:1.5', GRAD_HOR, BGRAD_PLOT);
$txt = new Text($data_w);
$txt->SetPos(686, -16);
$data_XXX = $xml->pref[10]->time_x;
$url = "http://s-proj.com/utils/checkHoliday.php?kind=h&date=" . $data_XXX;
$holiday_status = file_get_contents($url);
if ($holiday_status == "holiday") {
    $txt->SetColor("#FF0000");
} else {
    $txt->SetColor("#000000");
}
if ($data_w == "土") {
    $txt->SetColor("#0000FF");
}
$txt->SetFont(FF_GOTHIC, FS_NORMAL, 10);
$graph->AddText($txt);
$graph->add($bplot);
$graph->Stroke();
开发者ID:mintwavio,项目名称:TanpopoWeather,代码行数:31,代码来源:Denryoku.php

示例11: GanttBar

// ($row,$title,$startdate,$enddate)
$activity2 = new GanttBar(1, "Project", "2001-12-21", "2001-12-27", "[30%]");
// Yellow diagonal line pattern on a red background
$activity2->SetPattern(BAND_RDIAG, "yellow");
$activity2->SetFillColor("red");
// Set absolute height
$activity2->SetHeight(10);
// Specify progress to 30%
$activity2->progress->Set(0.3);
$activity2->progress->SetPattern(BAND_HVCROSS, "blue");
// Finally add the bar to the graph
$graph->Add($activity);
$graph->Add($activity2);
// Add text to top left corner of graph
$txt1 = new Text();
$txt1->SetPos(5, 2);
$txt1->Set("Note:\nEstimate done w148");
$txt1->SetFont(FF_ARIAL, FS_BOLD, 12);
$txt1->SetColor('darkred');
$graph->Add($txt1);
// Add text to the top bar
$txt2 = new Text();
$txt2->SetScalePos("2002-01-01", 1);
$txt2->SetFont(FF_ARIAL, FS_BOLD, 12);
$txt2->SetAlign('left', 'center');
$txt2->Set("Remember this!");
$txt2->SetBox('yellow');
$graph->Add($txt2);
// Add a vertical line
$vline = new GanttVLine("2001-12-24", "Phase 1");
$vline->SetDayOffset(0.5);
开发者ID:hcvcastro,项目名称:pxp,代码行数:31,代码来源:gantt_textex1.php

示例12: templateGraph


//.........这里部分代码省略.........
             //				$first[$siteid] = $percent;
             if (!$this->withZoom) {
                 $xdata[$userid][$siteid][] = $start;
                 $ydata[$userid][$siteid][] = $percent;
             }
         }
         $xdata[$userid][$siteid][] = $time;
         $ydata[$userid][$siteid][] = $percent;
         $ylast[$userid][$siteid] = $percent;
         $no_data = false;
     }
     if (!$this->withZoom) {
         foreach (array_keys($ydata[$uid1]) as $siteid) {
             $xdata[$uid1][$siteid][] = $end;
             $ydata[$uid1][$siteid][] = $ylast[$uid1][$siteid];
         }
         if (isset($ydata[$uid2])) {
             foreach (array_keys($ydata[$uid2]) as $siteid) {
                 $xdata[$uid2][$siteid][] = $end;
                 $ydata[$uid2][$siteid][] = $ylast[$uid2][$siteid];
             }
         }
     }
     //		$xdata[$siteid][] = $end;
     //		$ydata[$siteid][] = $percent;
     //		$ylast[$siteid] = $percent;
     //		foreach ($sites2 as $siteid)
     //		{
     //			$xdata[$siteid][] = $end;
     //			$ydata[$siteid][] = isset($ylast[$siteid]) ;
     //		}
     //define the graph
     $dateformat = "d.M.y";
     $datemargin = strlen(date($dateformat)) * 11;
     //		$graph = new Graph($this->module->cfgGraphWidth()*2, $this->module->cfgGraphHeight()*2);
     $graph = new Graph($this->width, $this->height);
     if ($no_data) {
         $graph->SetScale('textint', 0, 100, 0, 1);
     } else {
         $graph->SetScale('datlin', 0, 100);
         $graph->xaxis->scale->SetDateFormat($dateformat);
     }
     $graph->SetColor(array(238, 238, 238));
     $graph->SetMarginColor(array(208, 211, 237));
     $graph->title->Set($this->getGraphTitle());
     $graph->yaxis->title->Set($this->module->lang('percentage'));
     $graph->SetShadow();
     $graph->xaxis->SetLabelAngle(90);
     $graph->img->SetMargin(40, 170, 20, $datemargin);
     //		$graph->img->SetMargin(40, 140, 0, $datemargin);
     $graph->legend->Pos(0.015, 0.05, "right", "top");
     $weights = array($uid1 => 3, $uid2 => 1);
     $labeled = array();
     //make a line for each site (and user)
     foreach ($ydata as $userid => $ydata2) {
         $curr_weight = $weights[$userid];
         foreach ($ydata2 as $siteid => $data) {
             //			var_dump($data);
             if (!isset($this->sites[$siteid])) {
                 continue;
             }
             $site = $this->sites[$siteid];
             $site instanceof WC_Site;
             $lineplot = new LinePlot($data, $xdata[$userid][$siteid]);
             list($color, $style) = $this->getColorAndStyle($site);
             $lineplot->SetStyle($style);
             $lineplot->SetColor($color);
             $lineplot->SetWeight($curr_weight);
             if ($this->withNumbers) {
                 $lineplot->value->Show();
             }
             if ($this->withIcons) {
                 $path = 'dbimg/logo_gif/' . $siteid . '.gif';
                 if (is_readable($path)) {
                     $lineplot->mark->SetType(MARK_IMG, $path, 0.5);
                 }
             }
             if (!in_array($siteid, $labeled, true)) {
                 $lineplot->SetLegend($site->getVar('site_name'));
                 $labeled[] = $siteid;
             }
             $graph->Add($lineplot);
         }
     }
     //		$graph->img->SetAntiAliasing();
     if ($no_data) {
         if (count($this->sites) === 0) {
             $text = $this->module->lang('err_no_sites');
         } else {
             $text = $this->module->lang('err_graph_empty');
         }
         $txt = new Text($text);
         //			$txt->SetFont(FF_ARIAL,FS_NORMAL,18);
         $txt->SetColor("#0000ff");
         $txt->SetPos(0.45, 0.45, 'center', 'center');
         $graph->AddText($txt);
     }
     $graph->Stroke();
     die;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:101,代码来源:GraphStats.php

示例13: init

 public function init($title, $xdata, $ydata, $width = 350, $height = 320)
 {
     // 1. Setup some member variables
     //$graph_width=$width;
     //$graph_height=$height;
     //$graph_title=$title;
     // 2. We'll need a graph object
     $this->graph = new \Graph($width, $height);
     // 3. Set some random values
     $this->graph->SetScale("textlin");
     $this->graph->title->Set($title);
     // 4. Build the linear regression class
     $linreg = new \LinearRegression($xdata, $ydata);
     // 4.1 Get the basic linear regression statistics
     list($stderr, $corr) = $linreg->GetStat();
     list($xd, $yd) = $linreg->GetY(1, count($xdata));
     list($b, $m) = $linreg->GetAB();
     // 4.2 Create the regression line
     $lplot = new \LinePlot($yd);
     $lplot->SetWeight(3);
     $lplot->SetColor('navy');
     // 5. Calculate regression and goal statistics
     //$mp = CakeNumber::precision($m, 0);
     //$bp = CakeNumber::precision($b, 0);
     // 5.1 y=mx+b
     //$s = "y = ".CakeNumber::precision($m,$p)."x + $bp";
     $s = "y = {$m} x + {$b}";
     $txt = new \Text($s);
     $txt->SetPos($this->left_margin, $this->stats_base_y);
     // Set color and font for the text
     $txt->SetColor('red');
     $txt->SetFont(FF_FONT2, FS_BOLD);
     $this->graph->AddText($txt);
     // 4.2 present amount
     //$present_amt = end($this->ydata);
     //App::uses("CakeNumber", "Utility");
     //$txt = new Text("p=" . CakeNumber::precision($present_amt,0));
     //$txt->SetPos($this->left_margin, $this->stats_base_y+$this->stats_line_ht);
     //$this->graph->AddText($txt);
     // 4.3 the goal
     //$delta = $this->goal - $present_amt;
     //$deltaP = $delta/$m;
     //$deltaP = CakeNumber::precision($deltaP, 1);
     //$s = "g = $this->goal";
     //$txt = new Text($s);
     //$txt->SetPos($this->left_margin, $this->stats_base_y+$this->stats_line_ht*2);
     //$this->graph->AddText($txt);
     //$s = "t = $deltaP";
     //$txt = new Text($s);
     //$txt->SetPos($this->left_margin, $this->stats_base_y+$this->stats_line_ht*3);
     //$this->graph->AddText($txt);
     $this->graph->Add($lplot);
     //$this->graph->legend->SetPos(0.5,0.98,'center','bottom');
     //$this->graph->legend->SetAbsPos(0,0);
     //$this->graph->yaxis->SetColor('red');// this works here, but not earlier
     //$this->graph->xaxis->SetColor('blue');
     //$this->graph->SetAxisLabelBackground(1,'red');
     //$this->graph->SetAxisLabelBackground(2,'green');
     //$this->graph->SetBackgroundCFlag(2,BGIMG_FILLPLOT,100); // no discernable effect
     //$this->graph->SetBackgroundGradient('navy','silver',2,BGRAD_FRAME); // no discernable effect
     //$this->graph->SetBox(true, array(80,80,80), 10);
     //$this->graph->SetBox();
     //$this->graph->SetFrame(true,'darkblue',20);
     //$this->graph->SetFrameBevel(20,true,'black');
     //$this->graph->SetMarginColor('silver');
     //$this->graph->SetMargin($this->left_margin,50,50,50); // left, right, top, bottom
     //$this->graph->SetMargin(50,50,50,0); // left, right, top, bottom
 }
开发者ID:bostontrader,项目名称:acctwerx,代码行数:68,代码来源:FingraphComponent.php

示例14: BarPlot

$lineplot7->SetLegend("Dew Point");
$lineplot7->SetColor("green");
$lineplot7->SetWeight(3);
$bp1 = new BarPlot($pcpn, $times);
$bp1->SetLegend("Precip");
$bp1->SetFillColor("black");
$bp1->SetAbsWidth(1.0);
// Create the linear plot
$fz = new LinePlot($freezing, $times);
$fz->SetColor("blue");
// Title Box
$tx1 = new Text($cities[$station]['name'] . " \nMeteogram ");
$tx1->SetPos(0.01, 0.01, 'left', 'top');
$tx1->SetFont(FF_FONT1, FS_BOLD, 16);
$tx2 = new Text("Time series showing temperatures\n   from the pavement sensors and \n   the sub-surface sensor ");
$tx2->SetPos(0.01, 0.11, 'left', 'top');
$tx2->SetFont(FF_FONT1, FS_NORMAL, 10);
include "{$rootpath}/include/mlib.php";
$mySOb = array();
if ($mode == "hist") {
    $ptext = "Historical Plot for dates:\n";
    $tx3 = new Text($ptext . $plotTitle);
} else {
    /*
     $tx3 = new Text("Last Ob @ ". strftime("%m/%d %I:%M %p", $mySOb['ts']) ." 
      Sensor 0: ". $mySOb['tmpf0'] ." F 
      Sensor 1: ". $mySOb['tmpf1'] ." F 
      Sensor 2: ". $mySOb['tmpf2'] ." F 
      Sensor 3: ". $mySOb['tmpf3'] ." F 
     Air  Temp: ". $myOb['tmpf'] ." F
     Dew Point: ". $myOb['dwpf'] ." F
开发者ID:muthulatha,项目名称:iem,代码行数:31,代码来源:SFtemps.php

示例15: array

<?php

include "../jpgraph.php";
include "../jpgraph_bar.php";
$datay = array(12, 8, 19, 3, 10, 5);
// Create the graph. These two calls are always required
$graph = new Graph(300, 200, "auto");
$graph->SetScale("textlin");
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40, 30, 20, 40);
// Create a bar pot
$bplot = new BarPlot($datay);
$graph->Add($bplot);
// Create and add a new text
$txt = new Text("This is a text");
$txt->SetPos(10, 25);
$txt->SetFont(FF_FONT1, FS_BOLD);
$txt->SetBox('yellow', 'navy', 'gray');
$txt->SetColor("red");
$graph->AddText($txt);
// Setup the titles
$graph->title->Set("A simple bar graph");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
// Display the graph
$graph->Stroke();
开发者ID:centaurustech,项目名称:BenFund,代码行数:31,代码来源:example25.1.php


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