本文整理汇总了PHP中CanvasGraph::SetMargin方法的典型用法代码示例。如果您正苦于以下问题:PHP CanvasGraph::SetMargin方法的具体用法?PHP CanvasGraph::SetMargin怎么用?PHP CanvasGraph::SetMargin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CanvasGraph
的用法示例。
在下文中一共展示了CanvasGraph::SetMargin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CanvasGraph
<?php
// content="text/plain; charset=utf-8"
// $Id: canvasex03.php,v 1.1 2002/08/27 20:08:57 aditus Exp $
require_once 'jpgraph/jpgraph.php';
require_once 'jpgraph/jpgraph_canvas.php';
require_once 'jpgraph/jpgraph_canvtools.php';
// Define work space
$xmax = 20;
$ymax = 20;
// Setup a basic canvas we can work
$g = new CanvasGraph(400, 200, 'auto');
$g->SetMargin(5, 11, 6, 11);
$g->SetShadow();
$g->SetMarginColor("teal");
// We need to stroke the plotarea and margin before we add the
// text since we otherwise would overwrite the text.
$g->InitFrame();
// Create a new scale
$scale = new CanvasScale($g);
$scale->Set(0, $xmax, 0, $ymax);
// The shape class is wrapper around the Imgae class which translates
// the coordinates for us
$shape = new Shape($g, $scale);
$shape->SetColor('black');
// Add a black line
$shape->SetColor('black');
$shape->Line(0, 0, 20, 20);
// .. and a circle (x,y,diameter)
$shape->Circle(5, 14, 2);
// .. and a filled circle (x,y,diameter)
示例2: displayGraph
//.........这里部分代码省略.........
}
}
}
}
}
}
}
}
}
}
}
//*****************************************//
// ***** ***** ***** ***** * * //
// * * * * * * * * * //
// * *** ***** ***** ***** ***** //
// * * * * * * * * * //
// ***** * * * * * * * //
//*****************************************//
// L I N E P L O T
if (sizeof($G_YDATAS) >= 1) {
// true no funciona porque cada cadena u otro valor que se retorne es valor "valido o verdadero"
// y equivale a true, entonces para diferenciarlo verdaderamente se compara con 'true'
$str = checkAttributes($G_TITLE, $G_TYPE, $G_LABEL_Y, $_MSJ_ERROR, $_MSJ_NOTHING);
if ($str != 'true') {
showError($str, $G_SIZE);
return;
}
if ($G_TYPE == 'lineplot') {
$graph = new Graph($G_SIZE[0], $G_SIZE[1], "auto");
if ($G_SHADOW) {
$graph->SetShadow();
}
$graph->SetScale($G_SCALE);
$graph->SetMarginColor($G_COLOR);
$graph->title->Set($G_TITLE);
$graph->SetFrame(true, '#999999');
$graph->img->SetMargin($G_MARGIN[0], $G_MARGIN[1], $G_MARGIN[2], $G_MARGIN[3]);
$graph->img->SetAntiAliasing();
$graph->xaxis->SetLabelFormatCallback("CallBack");
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->title->Set($G_LABEL[0]);
$graph->yaxis->title->Set($G_LABEL[1]);
$graph->xgrid->Show();
$graph->legend->SetFillColor("#fafafa");
$graph->legend->Pos($G_LEYEND_POS[0], $G_LEYEND_POS[1], "right", "center");
$graph->legend->SetColumns($G_LEYEND_NUM_COLUMN);
$graph->legend->SetColor("#444444", "#999999");
$arr_lineplot = array();
foreach ($G_YDATAS as $num => $yDatas) {
$lineplot = new LinePlot($yDatas);
if ($G_ARR_STEP[$num] == true) {
$lineplot->SetStepStyle();
}
if ($G_ARR_FILL_COLOR[$num] == true) {
$lineplot->SetFillColor($G_ARR_COLOR[$num]);
}
$lineplot->SetColor($G_ARR_COLOR[$num]);
$lineplot->SetWeight($G_WEIGHT);
$lineplot->SetLegend($G_ARR_LEYEND[$num]);
$arr_lineplot[] = $lineplot;
}
foreach ($arr_lineplot as $num => $yDatas) {
$graph->Add($yDatas);
}
if (sizeof($xData) > 100) {
$graph->xaxis->SetTextTickInterval((int) (sizeof($xData) / 10));
示例3: CanvasGraph
<?php
// $Id: listfontsex1.php,v 1.3 2002/10/25 22:44:15 aditus Exp $
include "../jpgraph.php";
include "../jpgraph_canvas.php";
include "../jpgraph_canvtools.php";
$g = new CanvasGraph(550, 450, 'auto');
$scale = new CanvasScale($g);
$scale->Set(0, 27, 0, 53);
$g->SetMargin(5, 6, 5, 6);
$g->SetColor('white');
$g->SetMarginColor("teal");
$g->InitFrame();
$t = new CanvasRectangleText();
$t->SetFillColor('lightgreen');
$t->SetFontColor('navy');
$t->SetFont(FF_ARIAL, FS_NORMAL, 16);
$t->Set("\n\n\n\n\n\n\n\n\n\n\nTTF Fonts", 0.5, 19, 26, 32);
$t->Stroke($g->img, $scale);
$t = new CanvasRectangleText();
$t->SetFillColor('');
$t->SetFontColor('black');
$t->SetColor('');
$t->SetShadow('');
$t->SetFont(FF_ARIAL, FS_BOLD, 18);
$t->Set('Family', 1, 1, 8);
$t->Stroke($g->img, $scale);
$t->Set('Italic style', 9, 1, 8);
$t->Stroke($g->img, $scale);
$t->Set('Bold style', 17.5, 1, 8);
$t->Stroke($g->img, $scale);
示例4: CanvasGraph
<?php
// $Id: canvas_jpgarchex.php,v 1.1.1.1 2005/11/30 23:01:53 gth2 Exp $
include "../jpgraph.php";
include "../jpgraph_canvas.php";
include "../jpgraph_canvtools.php";
// Scale we are using
$ymax = 24;
$xmax = 20;
// Setup the basic canvas
$g = new CanvasGraph(700, 650, 'auto');
$g->SetMargin(2, 3, 2, 3);
$g->SetMarginColor("teal");
$g->InitFrame();
// ... and a scale
$scale = new CanvasScale($g);
$scale->Set(0, $xmax, 0, $ymax);
// ... we need shape since we want the indented rectangle
$shape = new Shape($g, $scale);
$shape->SetColor('black');
// ... basic parameters for the overall image
$l = 2;
// Left margin
$r = 18;
// Row number to start the lowest line on
$width = 16;
// Total width
// Setup the two basic rectangle text object we will use
$tt = new CanvasRectangleText();
$tt->SetFont(FF_ARIAL, FS_NORMAL, 14);
$tt->SetFillColor('');
示例5: CanvasGraph
$limit = $db->sql_numrows($result);
if ($limit < $numstick) {
$numstick = $limit;
}
if ($limit == 0 || $limit == "") {
$graph = new CanvasGraph(660, 200, "auto");
$graph->SetMarginColor('white');
$graph->SetMargin(2, 60, 2, 25);
$graph->InitFrame();
$text = new Text(" [This chart does not have enough data]");
$text->SetPos(400, 60, 'right');
$text->SetColor("black");
$graph->AddText($text);
$graph2 = new CanvasGraph(660, 170, 'auto');
$graph2->SetMarginColor('white');
$graph2->SetMargin(2, 60, 2, 25);
$graph2->InitFrame();
$graph2->AddText($text);
if ($type == 1) {
$graph->Stroke($realpath . $prename . "1W_1.png");
$graph2->Stroke($realpath . $prename . "1W_2.png");
} elseif ($type == 2) {
//echo '111';
$graph->Stroke($realpath . $prename . "1M_1.png");
$graph2->Stroke($realpath . $prename . "1M_2.png");
} elseif ($type == 3) {
$graph->Stroke($realpath . $prename . "3M_2.png");
$graph2->Stroke($realpath . $prename . "3M_2.png");
} elseif ($type == 4) {
$graph->Stroke($realpath . $prename . "6M_2.png");
$graph2->Stroke($realpath . $prename . "6M_2.png");