本文整理汇总了PHP中Chart::setGridLines方法的典型用法代码示例。如果您正苦于以下问题:PHP Chart::setGridLines方法的具体用法?PHP Chart::setGridLines怎么用?PHP Chart::setGridLines使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chart
的用法示例。
在下文中一共展示了Chart::setGridLines方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Chart
<?php
require '../lib/Chart.php';
require '../lib/markers/ChartShapeMarker.php';
$chart = new Chart('lc', 800, 154);
$chart->setAutoscale(Chart::AUTOSCALE_VALUES);
$chart->setGridLines(0, 50, 3, 2);
$chart->setMargin(5);
$values = array(34, 18, 21, 70, 53, 39, 39, 30, 13, 15, 4, 8, 5, 8, 4, 8, 44, 16, 16, 3, 10, 7, 5, 20, 20, 28, 44, null);
$line = new ChartData($values);
$line->setColor('000000');
$line->setThickness(3);
$line->setFill('eeeeee');
$chart->addData($line);
$m = new ChartShapeMarker(ChartShapeMarker::CIRCLE);
$m->setData($line);
$m->setColor('000000');
$m->setSize(7);
$m->setBorder(2);
$chart->addMarker($m);
$values = array_fill(0, sizeof($values) - 2, null);
$values[] = 44;
$values[] = 34;
$line2 = new ChartData($values);
$line2->setColor('000000');
$line2->setThickness(3);
$line2->setDash(4, 2);
$line2->setFill('eeeeee');
$chart->addData($line2);
$m = new ChartShapeMarker(ChartShapeMarker::CIRCLE);
$m->setData($line2);
示例2: array
<?php
require '../lib/Chart.php';
require '../lib/markers/ChartTextMarker.php';
require '../lib/markers/ChartShapeMarker.php';
$values = array(array(), array(), array());
$n = 10;
for ($i = 0; $i <= $n; $i += 1) {
$v = rand($i, $i * 10);
$values[0][] = $v;
$values[1][] = $v - $i;
$values[2][] = rand(100 - ($i + 10), 100 - 10 * $i);
}
$chart = new Chart('lc', 600, 300);
$chart->setGridLines(10, 10);
$chart->setLegendPosition('r');
//~ $chart->setMargin(50);
$chart->setLegendSize(150, 20);
$chart->setFill('ffffcc');
$chart->setGradientFill(45, array('cccccc', 'ffffff', 'cccccc'), Chart::CHART_AREA);
$chart->setTitle('Us versus the others.');
$chart->setTitleColor('999999')->setTitleSize(20);
$line = new ChartData($values[0]);
$line->setLegend('Us');
$chart->addData($line);
$marker = new ChartShapeMarker(ChartShapeMarker::X);
$marker->setData($line);
$marker->setColor('6699cc');
$chart->addMarker($marker);
$marker = new ChartTextMarker(ChartTextMarker::VALUE);
$marker->setData($line);
示例3: array
<?php
require '../lib/Chart.php';
$sin = array();
$cos = array();
for ($i = 0; $i <= 360; $i += 10) {
$sin[] = round(sin($i * M_PI / 180), 2);
$cos[] = round(cos($i * M_PI / 180), 2);
}
$chart = new Chart('lc', 500, 200);
$chart->setGridLines(25, 50, 1, 1);
$chart->setMargin(30, 50);
$chart->setLegendSize(100, 10);
$chart->setFill('333333');
$chart->setFill('444444', Chart::CHART_AREA);
$chart->setTitle('Sinus & Cosinus');
$chart->setTitleColor('FFFFFF');
$chart->setTitleSize(18);
$sin = new ChartData($sin);
$sin->setLegend('Sinus');
$sin->setThickness(2);
$sin->setColor('D1F2A5');
$chart->addData($sin);
$cos = new ChartData($cos);
$cos->setLegend('Cosinus');
$cos->setThickness(2);
$cos->setColor('F56991');
$chart->addData($cos);
$y_axis = new ChartAxis('y');
$y_axis->setDrawLine(false);
$y_axis->setRange(-1, 1);