本文整理汇总了PHP中Text::Pos方法的典型用法代码示例。如果您正苦于以下问题:PHP Text::Pos方法的具体用法?PHP Text::Pos怎么用?PHP Text::Pos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Text
的用法示例。
在下文中一共展示了Text::Pos方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: top
function top($VAR)
{
global $smarty, $C_translate, $C_auth;
# Get the period type, default to month
if (empty($VAR['period'])) {
$p = 'm';
} else {
$p = $VAR['period'];
}
# Load the jpgraph class
include PATH_GRAPH . "jpgraph.php";
include PATH_GRAPH . "jpgraph_bar.php";
# check the validation for this function
if (!$C_auth->auth_method_by_name($this->module, 'search')) {
$error = $C_translate->translate('module_non_auth', '', '');
include PATH_GRAPH . "jpgraph_canvas.php";
$graph = new CanvasGraph(460, 55, "auto");
$t1 = new Text($error);
$t1->Pos(0.2, 0.5);
$t1->SetOrientation("h");
$t1->SetBox("white", "black", 'gray');
$t1->SetFont(FF_FONT1, FS_NORMAL);
$t1->SetColor("black");
$graph->AddText($t1);
$graph->Stroke();
exit;
}
# Get the period start & end
switch ($p) {
# By Weeks:
case 'w':
$interval = "1";
$width = ".9";
$title = 'Top Accounts for Last Last Week';
$dow = date('w');
$start_str = mktime(0, 0, 0, date('m'), date('d') - $dow, date('y'));
$end_str = mktime(23, 59, 59, date('m'), date('d'), date('y'));
break;
# By Months:
# By Months:
case 'm':
$interval = "3";
$width = ".6";
$title = 'Top Accounts for Last Last Month';
$start_str = mktime(0, 0, 0, date('m'), 1, date('y'));
$end_str = mktime(23, 59, 59, date('m'), date('d'), date('y'));
break;
# By Years:
# By Years:
case 'y':
$interval = "1";
$width = ".8";
$title = 'Top Accounts for Last Last Year';
$start_str = mktime(0, 0, 0, 1, 1, date('y'));
$end_str = mktime(23, 59, 59, date('m'), date('d'), date('y'));
break;
}
##############################@@@@@@@@
# Get accounts & sales for this period
##############################@@@@@@@@
$db =& DB();
$sql = 'SELECT account_id,total_amt FROM ' . AGILE_DB_PREFIX . 'invoice WHERE
date_orig >= ' . $db->qstr($start_str) . ' AND date_orig <= ' . $db->qstr($end_str) . ' AND
site_id = ' . $db->qstr(DEFAULT_SITE);
$result = $db->Execute($sql);
if (@$result->RecordCount() == 0) {
$file = fopen(PATH_THEMES . 'default_admin/images/invisible.gif', 'r');
fpassthru($file);
exit;
}
while (!$result->EOF) {
$amt = $result->fields['total_amt'];
$acct = $result->fields['account_id'];
if (!isset($arr[$acct])) {
$arr[$acct] = 0;
}
$arr[$acct] += $amt;
$result->MoveNext();
}
$i = 0;
while (list($key, $var) = each(@$arr)) {
# Get the user name
$sql = 'SELECT first_name,last_name FROM ' . AGILE_DB_PREFIX . 'account WHERE
id = ' . $db->qstr($key) . ' AND
site_id = ' . $db->qstr(DEFAULT_SITE);
$rs = $db->Execute($sql);
$_lbl[] = strtoupper(substr($rs->fields['first_name'], 0, 1)) . ". " . $rs->fields['last_name'];
$_datay[] = $var;
$i++;
}
### Sort the arrays
array_multisort($_datay, SORT_DESC, SORT_NUMERIC, $_lbl);
### Limit the results to 10 or less
for ($i = 0; $i < count($_lbl); $i++) {
$lbl[$i] = $_lbl[$i];
$datay[$i] = $_datay[$i];
if ($i >= 9) {
$i = count($_lbl);
}
}
//.........这里部分代码省略.........
示例2: 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->Pos(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
示例3: 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->Pos(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();
示例4: Stroke
function Stroke(&$img, &$xscale, &$yscale)
{
$img->SetLineWeight($this->weight);
for ($i = 0; $i < $this->numpoints - 1; $i++) {
$accy = 0;
$accy_neg = 0;
for ($j = 0; $j < $this->nbrplots; ++$j) {
$img->SetColor($this->plots[$j]->color);
if ($this->plots[$j]->coords[0][$i] > 0) {
$yt = $yscale->Translate($this->plots[$j]->coords[0][$i] + $accy);
$accyt = $yscale->Translate($accy);
$accy += $this->plots[$j]->coords[0][$i];
} else {
$yt = $yscale->Translate($this->plots[$j]->coords[0][$i] + $accy_neg);
$accyt = $yscale->Translate($accy_neg);
$accy_neg += $this->plots[$j]->coords[0][$i];
}
$xt = $xscale->Translate($i);
$abswidth = round($this->width * $xscale->scale_factor, 0);
$pts = array($xt, $accyt, $xt, $yt, $xt + $abswidth, $yt, $xt + $abswidth, $accyt);
if ($this->plots[$j]->grad) {
$grad = new Gradient($img);
$grad->FilledRectangle($pts[2], $pts[3], $pts[6], $pts[7], $this->plots[$j]->grad_fromcolor, $this->plots[$j]->grad_tocolor, $this->plots[$j]->grad_style);
} elseif ($this->plots[$j]->fill_color) {
$img->SetColor($this->plots[$j]->fill_color);
$img->FilledPolygon($pts, 4);
$img->SetColor($this->plots[$j]->color);
}
if ($this->bar_shadow) {
$ssh = $this->bar_shadow_hsize;
$ssv = $this->bar_shadow_vsize;
// Create points to create a "upper-right" shadow
$sp[0] = $pts[6];
$sp[1] = $pts[7];
$sp[2] = $pts[4];
$sp[3] = $pts[5];
$sp[4] = $pts[2];
$sp[5] = $pts[3];
$sp[6] = $pts[2] + $ssh;
$sp[7] = $pts[3] - $ssv;
$sp[8] = $pts[4] + $ssh;
$sp[9] = $pts[5] - $ssv;
$sp[10] = $pts[6] + $ssh;
$sp[11] = $pts[7] - $ssv;
$img->SetColor($this->bar_shadow_color);
$img->FilledPolygon($sp, 4);
}
if ($i < count($this->plots[$j]->csimtargets)) {
$this->csimareas .= "<area shape=\"rect\" coords=\"";
// Hmmm, this is fishy. Fixes a bug in Opera whereby if Y2<Y1 or X2<X1 the csim doesn't work
// This means that the area MUST specify top left and bottom right corners
if ($pts[3] < $pts[7]) {
if ($pts[2] < $pts[6]) {
$this->csimareas .= "{$pts['2']}, {$pts['3']}, {$pts['6']}, {$pts['7']}\"";
} else {
$this->csimareas .= "{$pts['6']}, {$pts['3']}, {$pts['2']}, {$pts['7']}\"";
}
} else {
if ($pts[2] < $pts[6]) {
$this->csimareas .= "{$pts['2']}, {$pts['7']}, {$pts['6']}, {$pts['3']}\"";
} else {
$this->csimareas .= "{$pts['6']}, {$pts['7']}, {$pts['2']}, {$pts['3']}\"";
}
}
$this->csimareas .= " href=\"" . $this->plots[$j]->csimtargets[$i] . "\"";
if (!empty($this->plots[$j]->csimalts[$i])) {
$sval = sprintf($this->plots[$j]->csimalts[$i], $this->plots[$j]->coords[0][$i]);
$this->csimareas .= " alt=\"{$sval}\"";
}
$this->csimareas .= ">\r\n";
}
$img->Polygon($pts, 4);
}
$yt = $yscale->Translate($accy);
if ($this->show_value) {
$sval = sprintf($this->show_value_format, $accy);
$txt = new Text($sval);
$txt->SetFont($this->show_value_ff, $this->show_value_fs, $this->show_value_fsize);
$txt->SetColor($this->show_value_color);
$x = $pts[2] + ($pts[4] - $pts[2]) / 2;
if ($this->bar_shadow) {
$x += $ssh;
}
$txt->Pos($x, $yt - $this->show_value_margin);
$txt->Align("center", "bottom");
$txt->SetOrientation($this->show_value_angle);
$txt->Stroke($img);
}
}
return true;
}
示例5: setupGraph
function setupGraph($XUnits = "hours", $startTime, $count, $options = array())
{
global $conf;
$graph = new Graph($conf['graph']['width'], $conf['graph']['height'], "auto");
$graph->SetScale("intlin");
//$graph->SetScale("linlin",$mintemp,$maxtemp,$mintime, $maxtime);
//$graph->SetShadow();
$rightMargin = 20;
if (isset($options['showMargin']) && $options['showMargin'] == 1) {
$rightMargin = 110;
}
$graph->img->SetMargin(50, $rightMargin, 20, 40);
$graph->SetBox(true, 'black', 2);
$graph->SetColor($conf['graph']['bgcolor']);
$graph->SetMarginColor($conf['html']['bgcolor']);
//$graph->title->Set("Digitemp Activity");
$graph->title->Set("Digitemp Activity starting " . date("H:i:s m/d/Y", $startTime));
/**
$txt =new Text("Starting ".date("H:i:s m/d/Y", $startTime));
$txt->Pos( 0.59,0.01);
$txt->SetColor( "blue");
$graph->AddText( $txt);
**/
//junk:
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xgrid->Show();
$graph->legend->Pos(0.02, 0.02, "right", "top");
/*
$graph->yaxis->SetPos(0);
$graph->yaxis->SetWeight(2);
$graph->yaxis->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->SetColor('black','darkblue');
*/
$graph->xaxis->SetWeight(2);
$graph->xaxis->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->SetColor('black', 'darkblue');
// echo "Setting limits to $mintime, $maxtime, $mintemp, $maxtemp";
//$graph->SetScale("linlin",$mintemp,$maxtemp,$mintime, $maxtime);
$graph->xaxis->title->Set("Time ({$XUnits})");
$graph->yaxis->title->Set('Temperature (' . $options['units'] . ')');
$txt2 = new Text("Measurements shown: {$count}");
$txt2->Pos(0.02, 0.96);
$txt2->SetColor("blue");
$graph->AddText($txt2);
return $graph;
}
示例6: CanvasGraph
function BAR_graph($module, $type, $start, $extra_fields)
{
global $C_translate, $C_auth;
include_once PATH_CORE . 'validate.inc.php';
$dt = new CORE_validate();
include PATH_GRAPH . "jpgraph.php";
####################################################################
### Check if 'search' is authorized for this account
####################################################################
# check the validation for this function
if ($C_auth->auth_method_by_name($module, 'search')) {
# validate this file exists, and include it.
if (file_exists(PATH_MODULES . '/' . $module . '/' . $module . '.inc.php')) {
include_once PATH_MODULES . '/' . $module . '/' . $module . '.inc.php';
} else {
### Not exist!
$error = $C_translate->translate('module_non_existant', '', '');
}
} else {
### Not auth
$error = $C_translate->translate('module_non_auth', '', '');
}
if (isset($error)) {
include PATH_GRAPH . "jpgraph_canvas.php";
// Create the graph.
$graph = new CanvasGraph(460, 55, "auto");
$t1 = new Text($error);
$t1->Pos(0.2, 0.5);
$t1->SetOrientation("h");
$t1->SetBox("white", "black", 'gray');
$t1->SetFont(FF_FONT1, FS_NORMAL);
$t1->SetColor("black");
$graph->AddText($t1);
$graph->Stroke();
exit;
}
####################################################################
### BY WEEK
####################################################################
if ($type == 'week') {
$FONT_SIZE = 7;
$AbsWidth = 12;
$interval = 4;
$type = $C_translate->translate('week', '', '');
if ($start == "" || $start <= 12) {
## Get the beginning/end of this week
$start_str = mktime(24, 0, 0, 12, 31, date("Y") - 1);
$start = date(UNIX_DATE_FORMAT, $start_str);
$end_str = mktime(24, 0, 0, 12, 30, date("Y", $start_str));
$end = date(UNIX_DATE_FORMAT, $end_str);
} else {
## Get the beginning/end of the specified week
$start_str = mktime(24, 0, 0, 12, 31, date("{$start}") - 1);
$start = date(UNIX_DATE_FORMAT, $start_str);
$end_str = mktime(24, 0, 0, 12, 30, date("Y", $start_str));
$end = date(UNIX_DATE_FORMAT, $end_str);
}
### Set the constraint array:
$curr_str = $start_str;
while ($curr_str <= $end_str) {
$new_curr_str = mktime(0, 0, 0, date("m", $curr_str), date("d", $curr_str) + 7, date("Y", $curr_str));
$constraint_array[] = array('start' => $curr_str, 'end' => $new_curr_str);
$curr_str = $new_curr_str;
$default_array[] = 0;
}
} else {
if ($type == 'month') {
$FONT_SIZE = 10;
$AbsWidth = 12;
$TickLables = $gDateLocale->GetShortMonth();
$interval = 1;
$type = $C_translate->translate('month', '', '');
if ($start == "" || $start < 12) {
## Get the beginning/end of this week
$start_str = mktime(24, 0, 0, 12, 31, date("Y") - 1);
$start = date(UNIX_DATE_FORMAT, $start_str);
$end_str = mktime(24, 0, 0, 12, 30, date("Y", $start_str));
$end = date(UNIX_DATE_FORMAT, $end_str);
} else {
## Get the beginning/end of the specified week
## Get the beginning/end of this week
$start_str = mktime(24, 0, 0, 12, 31, date("{$start}") - 1);
$start = date(UNIX_DATE_FORMAT, $start_str);
$end_str = mktime(24, 0, 0, 12, 30, date("Y", $start_str));
$end = date(UNIX_DATE_FORMAT, $end_str);
}
### Set the constraint array:
$curr_str = $start_str;
while ($curr_str <= $end_str) {
$new_curr_str = mktime(0, 0, 0, date("m", $curr_str) + 1, date("d", $curr_str), date("Y", $curr_str));
$constraint_array[] = array('start' => $curr_str, 'end' => $new_curr_str);
$curr_str = $new_curr_str;
$default_array[] = 0;
}
} else {
if ($type == 'year') {
$FONT_SIZE = 10;
$interval = 1;
$AbsWidth = 13;
$type = $C_translate->translate('year', '', '');
//.........这里部分代码省略.........
示例7: array
// The label array values may have printf() formatting in them. The argument to the
// form,at string will be the value of the slice (either the percetage or absolute
// depending on what was specified in the SetLabelType() above.
$lbl = array("adam\n%.1f%%", "bertil\n%.1f%%", "johan\n%.1f%%", "peter\n%.1f%%", "daniel\n%.1f%%", "erik\n%.1f%%");
$p1->SetLabels($lbl);
// Uncomment this line to remove the borders around the slices
// $p1->ShowBorder(false);
// Add drop shadow to slices
$p1->SetShadow();
// Explode all slices 15 pixels
$p1->ExplodeAll(15);
// Setup the CSIM targets
$targ = array("piec_csimex1.php#1", "piec_csimex1.php#2", "piec_csimex1.php#3", "piec_csimex1.php#4", "piec_csimex1.php#5", "piec_csimex1.php#6");
$alts = array("val=%d", "val=%d", "val=%d", "val=%d", "val=%d", "val=%d");
$p1->SetCSIMTargets($targ, $alts);
$p1->SetMidCSIM("piec_csimex1.php#7", "Center");
// Setup a small help text in the image
$txt = new Text("Note: This is an example of image map. Hold\nyour mouse over the slices to see the values.\nThe URL just points back to this page");
$txt->SetFont(FF_FONT1, FS_BOLD);
$txt->Pos(0.5, 0.97, 'center', 'bottom');
$txt->SetBox('yellow', 'black');
$txt->SetShadow();
$graph->AddText($txt);
// Add plot to pie graph
$graph->Add($p1);
// .. and send the image on it's marry way to the browser
$graph->StrokeCSIM('piec_csimex1.php');
?>
示例8: array
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\nwith many\nand even\nmore\nlines of text");
$txt->Pos(0.5, 0.5, "center", "center");
$txt->SetFont(FF_FONT2, FS_BOLD);
$txt->ParagraphAlign('cenetered');
$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();
示例9: CanvasGraph
<?php
include "../jpgraph.php";
include "../jpgraph_canvas.php";
// Create the graph.
$graph = new CanvasGraph(350, 200, "auto");
$t1 = new Text("This is a text with more text");
$t1->Pos(0.05, 0.5);
$t1->SetOrientation("h");
$t1->SetFont(FF_FONT1, FS_NORMAL);
$t1->SetBox("white", "black", 'gray');
$t1->SetColor("black");
$graph->AddText($t1);
$graph->Stroke();
示例10: CanvasGraph
<?php
include "../jpgraph.php";
include "../jpgraph_canvas.php";
// Create the graph.
$graph = new CanvasGraph(350, 200, "auto");
$t1 = new Text("This is a text with more text");
$t1->Pos(0.01, 0.5);
$t1->SetOrientation("h");
$t1->SetFont(FF_FONT1, FS_NORMAL);
$t1->SetBox("white", "black", true);
$t1->SetColor("black");
$graph->AddText($t1);
$graph->Stroke();
示例11: buildGraphicByYear
//.........这里部分代码省略.........
inicialmente ele eh inicializada com o gabarito, e serao preenchidos os valores
dos meses no laço for logo abaixo
*/
$valores = $data;
for ($k = 0; $k <= count($valores); $k++) {
if ($meses[$k]) {
$valores[$k] = $meses[$k];
}
}
if (count($valores) > 12) {
unset($valores[0]);
}
$valores = array_values($valores);
/*
aqui eu uso "Variáveis Variáveis" do PHP para poder
inserir vária linhas no gráfico
*/
$nome = "barplot" . $ano;
${$nome} = new BarPlot($valores);
$cor = $cores[$colorIndex];
${$nome}->SetFillColor($cor);
${$nome}->SetColor($cor);
/*configs para os valores do ponto*/
${$nome}->value->SetColor("darkred");
${$nome}->value->SetFont(FF_FONT1, FS_BOLD);
${$nome}->value->SetFormat("%0.1d");
// $$nome->SetWeight(20);
// Arrumando para um tamanho mais amigavel
if (count($anos) < 3) {
${$nome}->SetWidth(20);
} else {
if (count($anos) < 4) {
${$nome}->SetWidth(15);
} else {
if (count($anos) < 6) {
${$nome}->SetWidth(10);
} else {
if (count($anos) < 8) {
${$nome}->SetWidth(5);
} else {
if (count($anos) < 11) {
${$nome}->SetWidth(3);
}
}
}
}
}
${$nome}->value->Show();
${$nome}->value->iHideZero = true;
${$nome}->setLegend($ano);
/*adicionando a linha ao grafico*/
$colorIndex++;
// Somente monta o gráfico dos anos exigidos pelo usuário
for ($i = 0; $i < count($anos); $i++) {
if ($ano == $startYear + $i) {
$graficoStatus = true;
// entrou no for significa que o gráfico vai ser construido
array_push($bars, ${$nome});
}
}
}
/****************************************************************
* Se não existir dados estatísticos para o período selecionado *
* Então ele constroi uma imagem com a mensagem de que não *
* existem dados estatísticos. *
*****************************************************************/
if ($graficoStatus == false) {
$graph = new CanvasGraph(600, 30);
$t1 = new Text(GRAFIC_STATS_FALSE);
$t1->Pos(0.05, 0.5);
$t1->SetOrientation('h');
$t1->SetFont(FF_FONT1, FS_BOLD);
$t1->SetColor('black');
$graph->AddText($t1);
$graph->Stroke();
return $graficoStatus;
}
$gbplot = new GroupBarPlot($bars);
$gbplot->SetWidth(0.9);
$graph->Add($gbplot);
$graph->yaxis->scale->SetGrace(20);
$graph->img->SetMargin(40, 20, 20, 40);
$graph->title->Set(ARTICLE_ACCESS);
$graph->xaxis->title->Set(MONTHS);
$graph->yaxis->title->Set(ACCESSES);
$graph->title->SetFont(FF_FONT1, FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->SetShadow();
$graph->xaxis->SetTickLabels(explode(",", MONTH_LIST));
// Adjust the legend position
// $graph->legend->SetLayout(LEGEND_VER);
$graph->legend->Pos(0.04, 0.092, "", "center");
$graph->legend->SetLayout(LEGEND_HOR);
// Mostra o gráfico somente se, o ano que o usuario entrou existir estatisticas
if ($graficoStatus == true) {
$graph->Stroke();
}
return $graficoStatus;
}
示例12: CanvasGraph
<?php
include "../jpgraph.php";
include "../jpgraph_canvas.php";
// Create the graph.
$graph = new CanvasGraph(350, 200, "auto");
$t1 = new Text("a good\nas you can see right now per see\nThis is a text with\nseveral lines\n");
$t1->Pos(0.05, 100);
$t1->SetFont(FF_FONT1, FS_NORMAL);
$t1->SetBox("white", "black", true);
$t1->ParagraphAlign("right");
$t1->SetColor("black");
$graph->AddText($t1);
$graph->Stroke();
示例13: PolarGraph
function create_image()
{
include './lib/jpgraph/jpgraph.php';
include './lib/jpgraph/jpgraph_polar.php';
$graph = new PolarGraph(250, 250);
$graph->SetScale('lin');
$graph->SetMargin(0, 1, 0, 1);
$graph->axis->ShowAngleLabel(false);
$graph->axis->HideTicks();
$graph->axis->HideLabels();
$graph->axis->HideLine();
$fonts = array(FF_ARIAL, FF_VERDANA, FF_TREBUCHE, FF_GEORGIA, FF_COMIC, FF_COURIER, FF_TIMES);
$styles = array(FS_NORMAL, FS_BOLD, FS_ITALIC);
$text = $this->generate_pass(6);
$font = $fonts[rand(0, count($fonts) - 1)];
$style = $styles[rand(0, count($styles) - 1)];
if ($font == FF_COMIC && $style == FS_ITALIC) {
$style = FS_NORMAL;
}
$txt = new Text($text);
$txt->Pos(rand(10, 140), rand(10, 140));
$txt->SetFont($font, $style, rand(20, 26));
$txt->SetColor('black');
$txt->SetAngle(rand(-45, 45));
$graph->AddText($txt);
$graph->Stroke('./register.png');
return array(md5("{$this->sets['db_pass']}{$this->sets['mostonlinetime']}{$text}"), './register.png');
}
示例14: CanvasGraph
<?php
include "../jpgraph.php";
include "../jpgraph_canvas.php";
// Create the graph.
$graph = new CanvasGraph(350, 200, "auto");
$t1 = new Text("a good\nas you can see right now per see\nThis is a text with \nseveral lines\n");
$t1->Pos(0.01, 100);
//$t1->SetOrientation("h");
$t1->SetFont(FF_FONT1, FS_NORMAL);
$t1->SetBox("white", "black", true);
$t1->ParagraphAlign("right");
$t1->SetColor("black");
$graph->AddText($t1);
$graph->Stroke();
示例15: imagejpeg
function create_image()
{
include './lib/jpgraph/jpgraph.php';
include './lib/jpgraph/jpgraph_polar.php';
if (!function_exists('imagejpeg')) {
JpGraphError::Raise("This PHP installation is not configured with JPEG support meaning that anti-robot registration cannnot be run at this current time. Please recompile PHP with GD and JPEG support to run JpGraph and that will allow anti-robot registration to fully function. (Function imagejpeg() does not exist)");
}
$graph = new PolarGraph(250, 250);
$graph->SetScale('lin');
$graph->SetMargin(0, 1, 0, 1);
$graph->axis->ShowAngleLabel(false);
$graph->axis->HideTicks();
$graph->axis->HideLabels();
$graph->axis->HideLine();
$fonts = array(FF_ARIAL, FF_VERDANA, FF_TREBUCHE, FF_GEORGIA, FF_COMIC, FF_COURIER, FF_TIMES);
$styles = array(FS_NORMAL, FS_BOLD, FS_ITALIC);
$text = $this->generate_pass(6);
$font = $fonts[rand(0, count($fonts) - 1)];
$style = $styles[rand(0, count($styles) - 1)];
if ($font == FF_COMIC && $style == FS_ITALIC) {
$style = FS_NORMAL;
}
$txt = new Text($text);
$txt->Pos(rand(10, 140), rand(10, 140));
$txt->SetFont($font, $style, rand(20, 26));
$txt->SetColor('black');
$txt->SetAngle(rand(-45, 45));
$graph->AddText($txt);
$graph->Stroke('./register.png');
return array(md5("{$this->sets['db_pass']}{$this->sets['mostonlinetime']}{$text}"), './register.png');
}