当前位置: 首页>>代码示例>>PHP>>正文


PHP Graph::SetTheme方法代码示例

本文整理汇总了PHP中Amenadiel\JpGraph\Graph\Graph::SetTheme方法的典型用法代码示例。如果您正苦于以下问题:PHP Graph::SetTheme方法的具体用法?PHP Graph::SetTheme怎么用?PHP Graph::SetTheme使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Amenadiel\JpGraph\Graph\Graph的用法示例。


在下文中一共展示了Graph::SetTheme方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

<?php

// content="text/plain; charset=utf-8"
require_once '../../vendor/autoload.php';
use Amenadiel\JpGraph\Graph;
use Amenadiel\JpGraph\Plot;
$data1y = array(47, 80, 40, 116);
$data2y = array(61, 30, 82, 105);
$data3y = array(115, 50, 70, 93);
// Create the graph. These two calls are always required
$graph = new Graph\Graph(350, 200, 'auto');
$graph->SetScale("textlin");
$theme_class = new UniversalTheme();
$graph->SetTheme($theme_class);
$graph->yaxis->SetTickPositions(array(0, 30, 60, 90, 120, 150), array(15, 45, 75, 105, 135));
$graph->SetBox(false);
$graph->ygrid->SetFill(false);
$graph->xaxis->SetTickLabels(array('A', 'B', 'C', 'D'));
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false, false);
// Create the bar plots
$b1plot = new Plot\BarPlot($data1y);
$b2plot = new Plot\BarPlot($data2y);
$b3plot = new Plot\BarPlot($data3y);
// Create the grouped bar plot
$gbplot = new Plot\GroupBarPlot(array($b1plot, $b2plot, $b3plot));
// ...and add it to the graPH
$graph->Add($gbplot);
$b1plot->SetColor("white");
$b1plot->SetFillColor("#cc1111");
$b2plot->SetColor("white");
开发者ID:amenadiel,项目名称:jpgraph,代码行数:31,代码来源:new_bar1.php

示例2: isset

<?php

require_once '../vendor/autoload.php';
use Amenadiel\JpGraph\Graph;
use Amenadiel\JpGraph\Plot;
use Amenadiel\JpGraph\Themes;
$theme = isset($_GET['theme']) ? $_GET['theme'] : null;
$data = array(0 => array(0 => 79, 1 => -25, 2 => -7, 3 => 85, 4 => -26, 5 => -32), 1 => array(0 => 76, 1 => 51, 2 => 86, 3 => 12, 4 => -7, 5 => 94), 2 => array(0 => 49, 1 => 38, 2 => 7, 3 => -40, 4 => 9, 5 => -7), 3 => array(0 => 69, 1 => 96, 2 => 49, 3 => 7, 4 => 92, 5 => -38), 4 => array(0 => 68, 1 => 16, 2 => 82, 3 => -49, 4 => 50, 5 => 7), 5 => array(0 => -37, 1 => 28, 2 => 32, 3 => 6, 4 => 13, 5 => 57), 6 => array(0 => 24, 1 => -11, 2 => 7, 3 => 10, 4 => 51, 5 => 51), 7 => array(0 => 3, 1 => -1, 2 => -12, 3 => 61, 4 => 10, 5 => 47), 8 => array(0 => -47, 1 => -21, 2 => 43, 3 => 53, 4 => 36, 5 => 34));
// Create the graph. These two calls are always required
$graph = new Graph\Graph(400, 300);
$graph->SetScale("textlin");
if ($theme) {
    $graph->SetTheme(new $theme());
}
$theme_class = new Themes\AquaTheme();
$graph->SetTheme($theme_class);
$plot = array();
// Create the bar plots
for ($i = 0; $i < 4; $i++) {
    $plot[$i] = new Plot\BarPlot($data[$i]);
    $plot[$i]->SetLegend('plot' . ($i + 1));
}
//$acc1 = new Plot\AccBarPlot(array($plot[0], $plot[1]));
//$acc1->value->Show();
Kint::enabled(true);
ddd($plot);
$gbplot = new Plot\GroupBarPlot(array($plot[2], $plot[1]));
for ($i = 4; $i < 8; $i++) {
    $plot[$i] = new Plot\LinePlot($data[$i]);
    $plot[$i]->SetLegend('plot' . $i);
    $plot[$i]->value->Show();
开发者ID:amenadiel,项目名称:jpgraph,代码行数:31,代码来源:aqua_example.php


注:本文中的Amenadiel\JpGraph\Graph\Graph::SetTheme方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。