本文整理汇总了PHP中LinePlot::setPadding方法的典型用法代码示例。如果您正苦于以下问题:PHP LinePlot::setPadding方法的具体用法?PHP LinePlot::setPadding怎么用?PHP LinePlot::setPadding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinePlot
的用法示例。
在下文中一共展示了LinePlot::setPadding方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
public function create()
{
$legend = $this->getArg('legend');
$y = $this->getArg('y');
if ($y === NULL) {
awImage::drawError("Class LightLinePattern: Argument 'y' must not be NULL.");
}
$plot = new LinePlot($y);
$plot->setSize(0.7, 1);
$plot->setCenter(0.35, 0.5);
$plot->setPadding(35, 15, 35, 30);
$plot->setColor(new Orange());
$plot->setFillColor(new LightOrange(80));
$plot->grid->setType(Line::DASHED);
$plot->mark->setType(Mark::CIRCLE);
$plot->mark->setFill(new MidRed());
$plot->mark->setSize(6);
$plot->legend->setPosition(1, 0.5);
$plot->legend->setAlign(Legend::LEFT);
$plot->legend->shadow->smooth(TRUE);
if ($legend !== NULL) {
$plot->legend->add($plot, $legend, Legend::MARK);
}
return $plot;
}
示例2: Graph
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once "../../LinePlot.class.php";
$graph = new Graph(300, 200);
$graph->setAntiAliasing(TRUE);
$x = array(-4, -5, -2, -8, -3, 1, 4, 9, 5, 6, 2);
$plot = new LinePlot($x);
$plot->setStyle(LINE_DASHED);
$plot->setSpace(4, 4, 10, 0);
$plot->setPadding(25, 15, 10, 18);
$plot->setBackgroundGradient(new LinearGradient(new Color(230, 230, 230), new Color(255, 255, 255), 90));
$plot->setFilledArea(7, 9, new Red(25));
$plot->setFilledArea(1, 4, new Yellow(25));
$plot->setColor(new Color(0, 0, 150, 20));
$plot->grid->setColor(new VeryLightGray());
$plot->mark->setType(MARK_SQUARE);
$plot->mark->setSize(4);
$plot->mark->setFill(new VeryDarkGreen(30));
$plot->mark->border->show();
$plot->mark->border->setColor(new DarkBlue(60));
$plot->xAxis->label->hide(TRUE);
$plot->xAxis->setNumberByTick('minor', 'major', 3);
$plot->yAxis->setLabelNumber(8);
$plot->legend->add($plot, "My line");
$plot->legend->setPosition(0.9, 0.77);
示例3: Graph
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once "../../LinePlot.class.php";
$graph = new Graph(150, 100);
$graph->setAntiAliasing(TRUE);
$x = array(1, 2, 5, 0.5, 3, 8, 7, 6, 2, -4);
$plot = new LinePlot($x);
$plot->grid->setNobackground();
$plot->setPadding(20, 8, 8, 20);
$plot->setXAxisZero(FALSE);
// Set a background gradient
$plot->setBackgroundGradient(new LinearGradient(new Color(210, 210, 210), new Color(255, 255, 255), 0));
// Set semi-transparent background gradient
$plot->setFillGradient(new LinearGradient(new Color(230, 150, 150, 20), new Color(230, 230, 180, 50), 90));
$plot->xAxis->label->hideFirst(TRUE);
$plot->xAxis->label->hideLast(TRUE);
$plot->xAxis->setNumberByTick('minor', 'major', 2);
$graph->add($plot);
$graph->draw();
示例4: Artichow_Line
/**
* Формирование графика.
*
* Функция формирует, а затем записывает в файл ($File) изображение графика по
* переданным пользователем данным($Lines). Данная функция может рисовать как одиночные,
* так и многолинейные графики.Исходными данными является массив, элементы которого также
* является массивами исходных данных для соответствующих графиков (данная структура
* сохраняется и для одиночных графиков!). Цвет каждой линии передается в массиве
* $Colors, ключи которого совпадают с ключами массива исходных данных. Цвет задается
* шестнадцатиричным кодом цвета (например, 0x000000 для черного цвета).
*
* @param string <заголовок диаграммы>
* @param string <полный путь с именем файла-результата>
* @param array <исходные данные>
* @param array <подписи к оси Ox>
* @param array <цвета линий>
*/
function Artichow_Line($Name, $File, $Lines, $Labels, $Colors)
{
#-----------------------------------------------------------------------------
$Graph = new Graph(1000, 300);
$Graph->setDriver('gd');
$Graph->setAntiAliasing(TRUE);
#-----------------------------------------------------------------------------
$Graph->title->set($Name);
$Graph->title->setFont(new Tuffy(15));
$Graph->title->move(0, -5);
#-----------------------------------------------------------------------------
if (Count($Lines) > 1) {
#---------------------------------------------------------------------------
$Group = new PlotGroup();
$Group->setPadding(40, 40);
$Group->setBackgroundColor(new Color(240, 240, 240));
}
#-----------------------------------------------------------------------------
$IsSetLabel = FALSE;
#-----------------------------------------------------------------------------
foreach ($Lines as $LineID => $Line) {
#---------------------------------------------------------------------------
$Plot = new LinePlot($Line);
$Color = Color_RGB_Explode($Colors[$LineID]);
$Plot->setColor(new Color($Color['R'], $Color['G'], $Color['B']));
$Plot->setThickness(1);
$Plot->setBackgroundGradient(new LinearGradient(new Color(240, 240, 240), new Color(255, 255, 255), 0));
$Plot->setFillGradient(new LinearGradient(new LightOrange(10), new VeryLightOrange(90), 90));
$Plot->setPadding(50, 50, 50, 50);
#---------------------------------------------------------------------------
$Plot->mark->setType(Mark::CIRCLE);
$Plot->mark->setSize(5);
#---------------------------------------------------------------------------
$Plot->label->set($Line);
$Plot->label->move(0, -15);
$Plot->label->setBackgroundGradient(new LinearGradient(new Color(250, 250, 250, 10), new Color(255, 200, 200, 30), 0));
$Plot->label->border->setColor(new Color(20, 20, 20, 20));
$Plot->label->setPadding(2, 2, 2, 2);
#---------------------------------------------------------------------------
if (Count($Lines) < 2) {
#-------------------------------------------------------------------------
$Plot->xAxis->setLabelText($Labels);
$Plot->yAxis->setLabelPrecision(1);
} else {
#-------------------------------------------------------------------------
if (!$IsSetLabel) {
#-----------------------------------------------------------------------
$Plot->setXAxis(Plot::BOTTOM);
$IsSetLabel = TRUE;
}
}
#---------------------------------------------------------------------------
if (Count($Lines) > 1) {
$Group->add($Plot);
}
#---------------------------------------------------------------------------
if (Count($Lines) > 1) {
#-------------------------------------------------------------------------
$Graph->add($Group);
#-------------------------------------------------------------------------
$Group->axis->bottom->setTickStyle(0);
$Group->axis->bottom->setLabelText($Labels);
} else {
$Graph->add($Plot);
}
}
#-----------------------------------------------------------------------------
$Graph->draw($File);
#-----------------------------------------------------------------------------
return TRUE;
}
示例5: list
$plot->label->move(5, -7);
if (!empty($_REQUEST["xtitle"]) or !empty($_REQUEST["ytitle"])) {
$group->setPadding(35, 15, 27, 27);
if (!empty($_REQUEST["xtitle"])) {
$group->axis->bottom->title->set($_REQUEST["xtitle"]);
}
if (!empty($_REQUEST["ytitle"])) {
$group->axis->left->title->set($_REQUEST["ytitle"]);
}
$group->axis->bottom->title->move(4, -6);
$group->axis->bottom->setTitleAlignment(LABEL_RIGHT);
$group->axis->left->title->move(-2, -4);
$group->axis->left->setTitleAlignment(LABEL_TOP);
}
$plot->setSpace(4, 4, 10, 0);
$plot->setPadding(40, 15, 10, 40);
$plot->yAxis->title->move(-4, 0);
$plot->yAxis->setTitleAlignment(LABEL_TOP);
$group->add($plot);
$group->axis->bottom->setLabelText($keys_new);
$group->axis->bottom->hideTicks(TRUE);
if (count($data2) > 0) {
if ($type == "linesteps") {
list($data_new, $data_label, $keys_new) = build_line_steps($width, $data2, $keys);
} else {
$data_new = $data2;
$data_label = $data2;
}
$plot = new LinePlot($data_new);
$plot->label->set($data_label);
$plot->label->move(5, -7);
示例6: Graph
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once "../../LinePlot.class.php";
$graph = new Graph(150, 100);
$x = array();
for ($i = 0; $i < 8; $i++) {
$x[] = cos($i / 3 * M_PI) + mt_rand(-10, 10) / 40;
}
$plot = new LinePlot($x);
$plot->setPadding(22, 5, 25, 8);
// Hide grid
$plot->grid->setType(LINE_DASHED);
// Change background color
$plot->setBackgroundColor(new Color(240, 240, 240, 50));
// Set Y on both left and rights sides
$plot->setYAxis(PLOT_BOTH);
// Change line properties
$plot->setColor(new Color(0, 0, 0));
$plot->setFillColor(new Color(240, 190, 130, 50));
// Chenge ticks and labels interval
$plot->xAxis->setTickInterval(2);
$plot->xAxis->label->hide(TRUE);
$plot->xAxis->setNumberByTick('minor', 'major', 1);
// Hide first and last values on X axis
$plot->xAxis->label->hideFirst(TRUE);
示例7: Graph
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once "../../LinePlot.class.php";
$graph = new Graph(150, 100);
$graph->setAntiAliasing(TRUE);
$x = array();
for ($i = 0; $i < 10; $i++) {
$x[] = mt_rand(1, 99) / 10;
}
$plot = new LinePlot($x);
$plot->setBackgroundColor(new Color(240, 240, 240));
$plot->setPadding(30, 8, 8, 20);
$plot->setColor(new Color(60, 60, 150));
$plot->setFillGradient(new LinearGradient(new Color(120, 175, 80, 47), new Color(231, 172, 113, 30), 0));
$plot->grid->setType(LINE_DASHED);
$plot->yAxis->setLabelNumber(2);
$plot->yAxis->setLabelPrecision(1);
$plot->xAxis->setLabelInterval(2);
$plot->xAxis->setNumberByTick('minor', 'major', 2);
$graph->add($plot);
$graph->draw();
示例8: Graph
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once "../../LinePlot.class.php";
$graph = new Graph(150, 100);
$graph->setAntiAliasing(TRUE);
$x = array(1, 2, 5, 4, 2, 3);
$plot = new LinePlot($x);
// Change component padding
$plot->setPadding(10, 12, 12, 7);
// Set a background gradient
$plot->setBackgroundGradient(new LinearGradient(new Color(230, 230, 230), new Color(255, 255, 255), 0));
// Change line background color
$plot->setFillGradient(new LinearGradient(new Color(200, 240, 215, 30), new Color(150, 190, 165, 30), 0));
// Hide grid
$plot->grid->hide(TRUE);
$plot->grid->setNobackground();
$plot->yAxis->label->hide(TRUE);
$plot->xAxis->label->hide(TRUE);
$plot->label->set($x);
$plot->label->setBackgroundColor(new Color(240, 240, 240, 10));
$plot->label->border->setColor(new Color(255, 0, 0, 15));
$plot->label->setPadding(3, 2, 0, 0);
$plot->label->setFont(new Font1());
$graph->add($plot);
示例9: Color
// fond du cadre du titre
$plot->title->setBackgroundColor(new Color(255, 255, 255, 25));
// bord du cadre du titre
$plot->title->border->show();
// espacement du texte dans le cadre du titre
$plot->title->setPadding(3, 3, 3, 3);
// positionement du cadre titre
$plot->title->move(0, 20);
// LE GRAPHIQUE
// Change la couleur de fond de la grille
$plot->grid->setBackgroundColor(new Color(255, 255, 255, 30));
// décalement du 0 et de la fin
$plot->setSpace(4, 4, 10, 0);
// padding du graphique
$plot->setPadding(50, 15, 10, 60);
// couleur de dégradé du fond du graphique
$plot->setBackgroundGradient(
new LinearGradient(
new Color(210, 210, 210),
new Color(255, 255, 255),
0
)
);
// couleur de la ligne
$plot->setColor(new Color(0, 0, 150, 20));
// couleur de dégradé sous la ligne
$plot->setFillGradient(
new LinearGradient(
new Color(150, 150, 210),
new Color(245, 245, 245),
示例10: color
require_once "../../LinePlot.class.php";
function color($a = NULL)
{
if ($a === NULL) {
$a = 0;
}
return new Color(mt_rand(20, 180), mt_rand(20, 180), mt_rand(20, 180), $a);
}
$graph = new Graph(400, 400);
$graph->setTiming(TRUE);
$x = array();
for ($i = 0; $i < 10; $i++) {
$x[] = mt_rand(-20, 100);
}
$plot = new LinePlot($x);
$plot->setPadding(NULL, 40, NULL, NULL);
$plot->setBackgroundColor(color(80));
$plot->setYAxis(PLOT_BOTH);
$plot->setColor(color());
if (mt_rand(0, 2) > 0) {
$plot->setFillGradient(new LinearGradient(color(40), color(60), mt_rand(0, 1) * 90));
} else {
$plot->setFillColor(color(64));
}
$plot->yAxis->setLabelNumber(mt_rand(0, 10));
$plot->yAxis->setLabelPrecision(1);
$plot->yAxis->title->set("Axis des Y : Quarante-deux");
$plot->xAxis->setTickInterval(2);
$plot->xAxis->setLabelInterval(2);
$plot->xAxis->label->hideFirst(TRUE);
$plot->xAxis->label->hideLast(TRUE);
示例11: Graph
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once "../../LinePlot.class.php";
$graph = new Graph(150, 100);
$graph->setAntiAliasing(TRUE);
$x = array(0, 2, 5, 2, 3, 8);
$plot = new LinePlot($x);
$plot->setXAxisZero(FALSE);
$plot->grid->setNobackground();
$plot->setSpace(6, 6, 10, 10);
$plot->setPadding(30, 6, 8, 18);
// Set a background gradient
$plot->setBackgroundGradient(new LinearGradient(new Color(210, 210, 210), new Color(255, 255, 255), 0));
// Change line color
$plot->setColor(new Color(0, 0, 150, 20));
// Set line background gradient
$plot->setFillGradient(new LinearGradient(new Color(150, 150, 210), new Color(230, 230, 255), 0));
// Change mark type
$plot->mark->setType(MARK_CIRCLE);
$plot->mark->border->show();
$plot->mark->setSize(6);
$plot->yAxis->setLabelPrecision(1);
$plot->yAxis->label->setFont(new Font1());
$plot->xAxis->label->setFont(new Font1());
$graph->add($plot);
$graph->draw();
示例12: Graph
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once "../../LinePlot.class.php";
$graph = new Graph(300, 175);
$graph->setAntiAliasing(TRUE);
$x = array(4, 3, 1, 0, -2, 1, 3, 2, 3, 5, 4, 1);
$plot = new LinePlot($x);
$plot->setXAxisZero(FALSE);
$plot->grid->hide(TRUE);
$plot->title->set("Using dashed line and legend");
$plot->title->setFont(new TuffyItalic(9));
$plot->title->setBackgroundColor(new Color(255, 255, 255, 50));
$plot->title->setPadding(3, 3, 3, 3);
$plot->title->move(0, 20);
$plot->setSpace(6, 6, 10, 10);
$plot->setPadding(30, 10, 15, 25);
$plot->setBackgroundColor(new Color(245, 245, 245));
$plot->setStyle(LINE_DASHED);
$plot->setColor(new Color(0, 150, 0, 20));
$plot->setFillGradient(new LinearGradient(new Color(220, 220, 150, 40), new Color(255, 255, 210, 30), 0));
$graph->shadow->setSize(4);
$graph->shadow->setPosition(SHADOW_LEFT_BOTTOM);
$graph->shadow->smooth(TRUE);
$plot->legend->add($plot, "Apples");
$plot->legend->shadow->setSize(0);
$plot->legend->setAlign(LEGEND_CENTER, LEGEND_TOP);
$plot->legend->setPosition(0.75, 0.6);
$plot->legend->setTextFont(new Tuffy(8));
$graph->add($plot);
$graph->draw();
示例13: Graph
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once "../LinePlot.class.php";
$graph = new Graph(375, 200);
// Set title
$graph->title->set('Star marks');
$graph->title->setFont(new Tuffy(12));
$graph->title->setColor(new DarkRed());
$plot = new LinePlot(array(5, 3, 4, 7, 6, 5, 8, 4, 7));
// Change plot size and position
$plot->setSize(0.76, 1);
$plot->setCenter(0.38, 0.5);
$plot->setPadding(30, 15, 38, 25);
$plot->setColor(new Orange());
$plot->setFillColor(new LightOrange(80));
// Change grid style
$plot->grid->setType(LINE_DASHED);
// Add customized marks
$plot->mark->setType(MARK_STAR);
$plot->mark->setFill(new MidRed());
$plot->mark->setSize(6);
// Change legend
$plot->legend->setPosition(1, 0.5);
$plot->legend->setAlign(LEGEND_LEFT);
$plot->legend->shadow->smooth(TRUE);
$plot->legend->add($plot, 'My line', LEGEND_MARK);
$graph->add($plot);
$graph->draw();
示例14: Graph
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once "../LinePlot.class.php";
$graph = new Graph(400, 300);
$graph->setAntiAliasing(TRUE);
$x = array(1, 2, 5, 0.5, 3, 8, 7, 6, 2, -4);
$plot = new LinePlot($x);
// Change component padding
$plot->setPadding(10, NULL, NULL, NULL);
// Change component space
$plot->setSpace(5, 5, 5, 5);
// Set a background color
$plot->setBackgroundColor(new Color(230, 230, 230));
// Change grid background color
$plot->grid->setBackgroundColor(new Color(235, 235, 180, 60));
// Hide grid
$plot->grid->hide(TRUE);
// Hide labels on Y axis
$plot->yAxis->label->hide(TRUE);
$plot->xAxis->label->setInterval(2);
$plot->label->set($x);
$plot->label->setFormat('%.1f');
$plot->label->setBackgroundColor(new Color(240, 240, 240, 15));
$plot->label->border->setColor(new Color(255, 0, 0, 15));
示例15: Graph
<?php
/*
* This work is hereby released into the Public Domain.
* To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once "../../LinePlot.class.php";
$graph = new Graph(500, 100);
$graph->setAntiAliasing(TRUE);
$graph->border->hide();
$x = array();
for ($i = 0; $i < 20; $i++) {
$x[] = mt_rand(4, 12);
}
$plot = new LinePlot($x);
$plot->setSpace(0, 0, 50, 0);
$plot->setPadding(3, 3, 3, 3);
$plot->setBackgroundGradient(new LinearGradient(new Color(230, 230, 230), new Color(255, 255, 255), 0));
$plot->setColor(new Color(0, 0, 180, 20));
$plot->setFillGradient(new LinearGradient(new Color(220, 220, 230, 25), new Color(240, 240, 255, 25), 90));
$plot->xAxis->hide(TRUE);
$plot->yAxis->hide(TRUE);
$graph->add($plot);
$graph->draw();