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


PHP Graph::SetBackgroundImage方法代码示例

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


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

示例1: array

use Amenadiel\JpGraph\Plot;
$month = array("Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec");
// Create some datapoints
$steps = 100;
for ($i = 0; $i < $steps; ++$i) {
    $databarx[] = sprintf("198%d %s", floor($i / 12), $month[$i % 12]);
    $datay[$i] = log(pow($i, $i / 10) + 1) * sin($i / 15) + 35;
    if ($i % 6 == 0 && $i < $steps - 6) {
        $databary[] = abs(25 * sin($i) + 5);
    } else {
        $databary[] = 0;
    }
}
// new Graph\Graph with a background image and drop shadow
$graph = new Graph\Graph(450, 300);
$graph->SetBackgroundImage("tiger_bkg.png", BGIMG_FILLFRAME);
$graph->SetShadow();
// Use text X-scale so we can text labels on the X-axis
$graph->SetScale("textlin");
// Y2-axis is linear
$graph->SetY2Scale("lin");
// Color the two Y-axis to make them easier to associate
// to the corresponding plot (we keep the axis black though)
$graph->yaxis->SetColor("black", "red");
$graph->y2axis->SetColor("black", "orange");
// Set title and subtitle
$graph->title->Set("Combined bar and line plot");
$graph->subtitle->Set("100 data points, X-Scale: 'text'");
// Use built in font (don't need TTF support)
$graph->title->SetFont(FF_FONT1, FS_BOLD);
// Make the margin around the plot a little bit bigger then default
开发者ID:amenadiel,项目名称:jpgraph,代码行数:31,代码来源:bartutex12.php

示例2: array

// content="text/plain; charset=utf-8"
require_once '../../vendor/autoload.php';
use Amenadiel\JpGraph\Graph;
use Amenadiel\JpGraph\Plot;
// Some data
$ydata = array(11, 3, 8, 12, 5, 1, 9, 13, 5, 7);
// Create the graph. These two calls are always required
$graph = new Graph\Graph(350, 250);
$graph->SetScale("textlin");
$graph->SetMargin(40, 40, 50, 50);
// Setup the grid and plotarea box
$graph->ygrid->SetLineStyle('dashed');
$graph->ygrid->setColor('darkgray');
$graph->SetBox(true);
// Steup graph titles
$graph->title->SetFont(FF_ARIAL, FS_BOLD, 12);
$graph->title->Set('Using background image');
$graph->subtitle->SetFont(FF_COURIER, FS_BOLD, 11);
$graph->subtitle->Set('"BGIMG_COPY"');
$graph->subtitle->SetColor('darkred');
// Add background with 25% mix
$graph->SetBackgroundImage('heat1.jpg', BGIMG_COPY);
$graph->SetBackgroundImageMix(25);
// Create the linear plot
$lineplot = new Plot\LinePlot($ydata);
$lineplot->SetColor("blue");
// Add the plot to the graph
$graph->Add($lineplot);
// Display the graph
$graph->Stroke();
开发者ID:amenadiel,项目名称:jpgraph,代码行数:30,代码来源:background_type_ex0.php

示例3: array

$datay1 = array(140, 110, 50, 60);
$datay2 = array(35, 90, 190, 190);
$datay3 = array(20, 60, 70, 140);
// Create the basic graph
$graph = new Graph\Graph(450, 250, 'auto');
$graph->SetScale("textlin");
$graph->img->SetMargin(40, 80, 30, 40);
// Adjust the position of the legend box
$graph->legend->Pos(0.02, 0.15);
// Adjust the color for theshadow of the legend
$graph->legend->SetShadow('darkgray@0.5');
$graph->legend->SetFillColor('lightblue@0.3');
// Get localised version of the month names
$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth());
// Set a nice summer (in Stockholm) image
$graph->SetBackgroundImage('stship.jpg', BGIMG_COPY);
// Set axis titles and fonts
$graph->xaxis->title->Set('Year 2002');
$graph->xaxis->title->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->title->SetColor('white');
$graph->xaxis->SetFont(FF_FONT1, FS_BOLD);
$graph->xaxis->SetColor('white');
$graph->yaxis->SetFont(FF_FONT1, FS_BOLD);
$graph->yaxis->SetColor('white');
//$graph->ygrid->Show(false);
$graph->ygrid->SetColor('white@0.5');
// Setup graph title
$graph->title->Set('Using alpha blending with a background');
// Some extra margin (from the top)
$graph->title->SetMargin(3);
$graph->title->SetFont(FF_ARIAL, FS_NORMAL, 12);
开发者ID:amenadiel,项目名称:jpgraph,代码行数:31,代码来源:alphabarex1.php


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