本文整理汇总了PHP中ScatterPlot::link方法的典型用法代码示例。如果您正苦于以下问题:PHP ScatterPlot::link方法的具体用法?PHP ScatterPlot::link怎么用?PHP ScatterPlot::link使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScatterPlot
的用法示例。
在下文中一共展示了ScatterPlot::link方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Graph
<?php
require_once "../../ScatterPlot.class.php";
$graph = new Graph(300, 280);
$graph->title->set('Linked ScatterPlot');
$graph->title->setFont(new TuffyItalic(14));
$graph->shadow->setSize(4);
$y = array(1, 10, 7, 8, 5, 4, 2, 4);
$x = array(0.5, 0.5, 1.5, 4, 3, 5, 2, 2);
$plot = new ScatterPlot($y, $x);
$plot->setBackgroundColor(new Color(235, 235, 235));
$plot->mark->setSize(15);
$plot->mark->setFill(new RadialGradient(new LightGreen(), new DarkGreen()));
$plot->link(TRUE);
$plot->setColor(new DarkGreen());
$plot->setSpace(6, 6, 6, 0);
$plot->setPadding(25, NULL, 40, 20);
$graph->add($plot);
$graph->draw();
示例2: array
$plot->mark->setSize(make_num('prv_mark', 10));
$plot->mark->setFill(make_color('prv_markcolor', 'F0F0F0'));
$plot->setThickness(make_num('prv_thick', 5));
$plot->setYAxis(PLOT_LEFT);
$plot->setYMin($min);
$plot->setYMax($max);
$grp->add($plot);
}
if ($val_ytd) {
$xkeys = array();
foreach ($val_ytd as $k => $v) {
$xkeys[$k] = $k + 0.5;
}
//for ($i=0;isset($val_ytd[$i]);$i++) $xkeys[$i]=$i+.5;
$plot = new ScatterPlot(array_values($val_ytd), array_values($xkeys));
$plot->link(TRUE, make_color('ytd_color', '40FFFF'));
$plot->mark->setSize(make_num('ytd_mark', 10));
$plot->mark->setFill(make_color('ytd_markcolor', 'F0F0F0'));
$plot->setThickness(make_num('ytd_thick', 5));
$plot->setYAxis(PLOT_LEFT);
$plot->setYMin($min);
$plot->setYMax($max);
$grp->add($plot);
}
$grp->axis->bottom->setLabelText(array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'));
$grp->axis->left->label->setCallbackFunction('FmtAmount');
set_font($grp->axis->bottom->label, 'x_font');
set_font($grp->axis->left->label, 'y_font');
set_font($grp->axis->right->label, 'y_font');
$graph->border->hide();
$grp->setBackgroundColor(make_color('bg_color', 'FFFFFF'));
示例3: getCircle
$group->setSpace(5, 5, 5, 5);
$group->legend->setPosition(0.82, 0.1);
$group->legend->setAlign(LEGEND_CENTER, LEGEND_MIDDLE);
function getCircle($size)
{
$center = 0;
$x = array();
$y = array();
for ($i = 0; $i <= 20; $i++) {
$rad = $i / 20 * 2 * M_PI;
$x[] = $center + cos($rad) * $size;
$y[] = $center + sin($rad) * $size;
}
return array($x, $y);
}
list($x, $y) = getCircle(3);
$plot = new ScatterPlot($y, $x);
$plot->link(TRUE, new DarkBlue());
$plot->mark->setFill(new DarkPink());
$plot->mark->setType(MARK_CIRCLE, 6);
$group->legend->add($plot, 'Circle #1', LEGEND_MARK);
$group->add($plot);
list($x, $y) = getCircle(5);
$plot = new ScatterPlot($y, $x);
$plot->link(TRUE, new DarkGreen());
$plot->mark->setFill(new DarkOrange());
$plot->mark->setType(MARK_SQUARE, 4);
$group->legend->add($plot, 'Circle #2', LEGEND_MARK);
$group->add($plot);
$graph->add($group);
$graph->draw();
示例4: Graph
<?php
require_once "../ScatterPlot.class.php";
$graph = new Graph(400, 400);
$graph->title->set('Linked ScatterPlot');
$y = array(1, 10, 3, -4, 1, 4, 8, 7);
$x = array(0.5, 0.5, 3, 5, 2, 3, 4, 1.5);
$plot = new ScatterPlot($y, $x);
$plot->setBackgroundColor(new VeryLightGray());
$plot->setPadding(NULL, NULL, 40, 20);
$plot->link(TRUE, new DarkBlue());
$graph->add($plot);
$graph->draw();