本文整理汇总了PHP中LinePlot::setXAxisZero方法的典型用法代码示例。如果您正苦于以下问题:PHP LinePlot::setXAxisZero方法的具体用法?PHP LinePlot::setXAxisZero怎么用?PHP LinePlot::setXAxisZero使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinePlot
的用法示例。
在下文中一共展示了LinePlot::setXAxisZero方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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();
示例2: color
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
*/
require_once "../../LinePlot.class.php";
function color($a = NULL)
{
if ($a === NULL) {
$a = mt_rand(20, 80);
}
return new Color(mt_rand(20, 180), mt_rand(20, 180), mt_rand(20, 180), $a);
}
$graph = new Graph(400, 400, "Abel", time() + 5);
$graph->setTiming(TRUE);
$graph->setAntiAliasing(TRUE);
$x = array();
for ($i = 0; $i < 10; $i++) {
$x[] = mt_rand(0, 100);
}
$plot = new LinePlot($x);
$plot->setThickness(1);
$plot->setColor(color());
$plot->setFillGradient(new LinearGradient(color(), color(), 0));
$plot->grid->setType(LINE_DASHED);
$plot->setYMin(mt_rand(-20, 0));
$plot->yAxis->setLabelNumber(mt_rand(0, 10));
$plot->yAxis->setLabelPrecision(1);
$plot->xAxis->label->hideFirst(TRUE);
$plot->xAxis->setNumberByTick('minor', 'major', 2);
$plot->setXAxisZero((bool) mt_rand(0, 1));
$graph->add($plot);
$graph->draw();
示例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";
// Use cache
$graph = new Graph(400, 400, "Example-006", time() + 5);
$graph->setTiming(TRUE);
$graph->setAntiAliasing(TRUE);
$x = array();
for ($i = 0; $i < 10; $i++) {
$x[] = mt_rand(0, 100);
}
$plot = new LinePlot($x);
$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->setYMin(-5);
$plot->yAxis->setLabelNumber(8);
$plot->yAxis->setLabelPrecision(1);
$plot->xAxis->setNumberByTick('minor', 'major', 3);
$plot->setXAxisZero(TRUE);
$graph->add($plot);
$graph->draw();