本文整理汇总了PHP中ScatterPlot::setSpace方法的典型用法代码示例。如果您正苦于以下问题:PHP ScatterPlot::setSpace方法的具体用法?PHP ScatterPlot::setSpace怎么用?PHP ScatterPlot::setSpace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScatterPlot
的用法示例。
在下文中一共展示了ScatterPlot::setSpace方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Graph
<?php
require_once "../ScatterPlot.class.php";
$graph = new Graph(400, 400);
$graph->shadow->setSize(5);
$graph->title->set('ScatterPlot with values');
$y = array(4, 3, 2, 5, 8, 1, 3, 6, 4, 5);
$x = array(1, 2, 5, 4, 3, 6, 2, 4, 5, 1);
$plot = new ScatterPlot($y, $x);
$plot->setSpace(6, 6, 6, 0);
$plot->setPadding(NULL, NULL, 40, 20);
// Set dashed lines on the grid
$plot->grid->setType(LINE_DASHED);
$plot->mark->setSize(30);
$plot->mark->setFill(new DarkOrange(20));
$plot->label->set($y);
$plot->label->setColor(new White());
$graph->add($plot);
$graph->draw();
示例2: Graph
<?php
require_once "../../ScatterPlot.class.php";
$graph = new Graph(300, 200);
$graph->title->set('Impulses');
$graph->shadow->setSize(4);
$y = array();
for ($i = 0; $i < 40; $i++) {
$y[] = cos($i / 15 * 2 * M_PI) / (0.8 + $i / 15) * 4;
}
$plot = new ScatterPlot($y);
$plot->setPadding(25, 15, 35, 15);
$plot->setBackgroundColor(new Color(230, 230, 255));
$plot->setSpace(2, 2);
// Set impulses
$plot->setImpulse(new DarkBlue());
$plot->grid->hideVertical();
$plot->grid->setType(LINE_DASHED);
// Hide ticks
$plot->xAxis->hideTicks();
$plot->xAxis->label->hide();
$plot->mark->setType(MARK_SQUARE);
$plot->mark->setSize(4);
$graph->add($plot);
$graph->draw();
示例3: Graph
<?php
require_once "../ScatterPlot.class.php";
$graph = new Graph(400, 400);
$graph->shadow->setSize(5);
$y = array();
for ($i = 0; $i < 60; $i++) {
$y[] = cos($i / 30 * 2 * M_PI);
}
$plot = new ScatterPlot($y);
$plot->setSpace(6, 6);
// Set impulses
$plot->setImpulse(new DarkGreen());
$plot->grid->hideVertical();
// Hide axis labels and ticks
$plot->xAxis->label->hide();
$plot->xAxis->hideTicks();
$plot->mark->setType(MARK_SQUARE);
$plot->mark->setSize(4);
$graph->add($plot);
$graph->draw();
示例4: Graph
<?php
require_once "../ScatterPlot.class.php";
$graph = new Graph(400, 400);
$center = 5;
$x = array();
$y = array();
for ($i = 0; $i <= 30; $i++) {
$rad = $i / 30 * 2 * M_PI;
$x[] = $center + cos($rad) * $center;
$y[] = $center + sin($rad) * $center;
}
$plot = new ScatterPlot($y, $x);
$plot->setBackgroundColor(new VeryLightGray());
$plot->setPadding(30, 30, 30, 30);
$plot->setSpace(5, 5, 5, 5);
$plot->link(TRUE, new DarkGreen());
$plot->mark->setFill(new DarkOrange());
$plot->mark->setType(MARK_SQUARE, 4);
$plot->setXAxis(PLOT_BOTH);
$plot->setXAxisZero(FALSE);
$plot->setYAxis(PLOT_BOTH);
$plot->legend->add($plot, 'A circle', LEGEND_MARK);
$plot->legend->setPosition(0.5, 0.5);
$plot->legend->setAlign(LEGEND_CENTER, LEGEND_MIDDLE);
$graph->add($plot);
$graph->draw();
示例5: Graph
<?php
require_once "../ScatterPlot.class.php";
$graph = new Graph(400, 400);
$graph->title->set('Impulses');
$graph->title->move(0, 30);
$graph->shadow->setSize(5);
$y = array();
for ($i = 0; $i < 60; $i++) {
$y[] = cos($i / 30 * 2 * M_PI) / (1.5 + $i / 15);
}
$plot = new ScatterPlot($y);
$plot->setBackgroundColor(new VeryLightOrange());
$plot->setSpace(5);
// Set impulses
$plot->setImpulse(new DarkBlue());
$plot->grid->hideVertical();
// Hide ticks
$plot->xAxis->hideTicks();
// Change labels interval
$plot->xAxis->label->setInterval(5);
$plot->mark->setType(MARK_SQUARE);
$plot->mark->setSize(4);
$graph->add($plot);
$graph->draw();