本文整理汇总了PHP中PHPlot::SetTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPlot::SetTitle方法的具体用法?PHP PHPlot::SetTitle怎么用?PHP PHPlot::SetTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPlot
的用法示例。
在下文中一共展示了PHPlot::SetTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: graficoBarra
function graficoBarra($data, $archivo = "", $meta_data = array('titulo' => 'Sin Título', 'tituloX' => 'Eje X', 'tituloY' => 'Eje Y', 'color' => 'SkyBlue', 'width' => 800, 'height' => 600, 'angle' => 45), $legend = array("Datos"))
{
# Objeto que crea el gráfico y su tama?o
$plot = new PHPlot($meta_data['width'], $meta_data['height']);
$plot->SetImageBorderType('plain');
# Setea el archivo donde se guarda la imagen generada y no permite la visualización inmediata
$plot->SetPrintImage(false);
$plot->SetFileFormat("jpg");
$plot->SetOutputFile($archivo);
$plot->SetIsInline(true);
# Envio de datos
$plot->SetDataValues($data);
# Tipo de gráfico y datos
$plot->SetDataType("text-data");
$plot->SetPlotType("bars");
# Setiando el True type font
//$plot->SetTTFPath(TTFPath);
//$plot->SetUseTTF(TRUE);
$plot->SetAxisFontSize(2);
$plot->SetVertTickIncrement(7);
//$plot->SetXTickLength(7);
//$plot->SetDataColors($meta_data['color']);
$plot->SetDataColors(array($meta_data['color'], 'red', 'white'));
$plot->SetLegendPixels(1, 1);
$plot->SetLegend($legend);
# Etiquetas del eje Y:
$plot->SetYTitle($meta_data['tituloY']);
$plot->SetYDataLabelPos('plotin');
# Título principal del gráfico:
$plot->SetTitle($meta_data['titulo']);
# Etiquetas eje X:
$plot->SetXTitle($meta_data['tituloX']);
if (isset($meta_data['angle'])) {
$plot->SetXLabelAngle($meta_data['angle']);
} else {
$plot->SetXLabelAngle(45);
}
$plot->SetXTickLabelPos('none');
$plot->SetXTickPos('none');
# Método que dibuja el gráfico
$plot->DrawGraph();
$plot->PrintImage();
}
示例2: plotGraph
function plotGraph($data)
{
//Define the object
$plot = new PHPlot();
$example_data = $data;
$plot->SetDataValues($example_data);
$plot->SetDataType('data-data');
//Set titles
$plot->SetTitle("temp and humi");
$plot->SetXTitle('time');
$plot->SetYTitle('Y Data');
$legend = array('temp', 'humi');
$plot->SetLegend($legend);
$plot->SetXDataLabelAngle(90);
//$plot->SetXGridLabelType("time");
$plot->SetXTickLabelPos('xaxis');
$plot->SetXTickPos('plotdown');
$plot->SetXLabelType('time', '%H:%M');
$plot->TuneXAutoTicks(10, 'date');
// $plot->SetXTickIncrement(.5);
//$plot->SetXTickIncrement(60 * 24);
$plot->SetPlotType('lines');
//$plot->SetPlotAreaWorld(strtotime('00:00'), null, strtotime('23:59'), null);
$plot->SetDrawXGrid(true);
//Draw it
$plot->DrawGraph();
}
示例3: renderLot
public function renderLot()
{
$grafico = new PHPlot(800, 600);
$grafico->SetFileFormat("jpg");
$grafico->SetIsInline(True);
#Indicamos o títul do gráfico e o título dos dados no eixo X e Y do mesmo
$grafico->SetTitle($this->data->titulo);
$grafico->SetXTitle($this->data->eixoX);
$grafico->SetYTitle($this->data->eixoY);
#passamos o tipo de gráfico escolhido
if (!$this->data->tipoLot) {
$this->data->tipoLot = 'bars';
}
$grafico->SetPlotType($this->data->tipoLot);
switch ($this->data->tipoLot) {
case 'pie':
$grafico->SetPieLabelType('index', 'custom', 'mycallback');
$grafico->SetDataType('text-data-single');
break;
case 'stackedbars':
$grafico->SetDataType('text-data-yx');
break;
case 'bubbles':
$grafico->SetDataType('data-data-xyz');
break;
}
$grafico->SetLegend($column_names);
#Definimos os dados do gráfico
switch ($this->data->tipoLot) {
case 'pie':
$dados = array(array($this->data->x1, $this->data->y11), array($this->data->x2, $this->data->y21), array($this->data->x3, $this->data->y31), array($this->data->x4, $this->data->y41));
break;
default:
$dados = array(array($this->data->x1, $this->data->y11, $this->data->y12, $this->data->y13), array($this->data->x2, $this->data->y21, $this->data->y22, $this->data->y23), array($this->data->x3, $this->data->y31, $this->data->y32, $this->data->y33), array($this->data->x4, $this->data->y41, $this->data->y42, $this->data->y43));
break;
}
$grafico->SetDataValues($dados);
#Salvamos o gráfico
$caminho = \Manager::getFilesPath();
$fileName = uniqid() . '.jpg';
$grafico->SetOutputFile($caminho . '/' . $fileName);
$grafico->SetIsInline(True);
$grafico->DrawGraph();
#obtemos o endereco do grafico
$this->data->locate = \Manager::getDownloadURL('files', basename($fileName), true);
}
示例4: doGet
public function doGet(WebAppRequest $req, WebAppResponse $res)
{
// Bootstraps Innomatic
require_once 'innomatic/core/InnomaticContainer.php';
$innomatic = InnomaticContainer::instance('innomaticcontainer');
// Sets Innomatic base URL
$baseUrl = '';
$webAppPath = $req->getUrlPath();
if (!is_null($webAppPath) && $webAppPath != '/') {
$baseUrl = $req->generateControllerPath($webAppPath, true);
}
$innomatic->setBaseUrl($baseUrl);
$innomatic->setInterface(InnomaticContainer::INTERFACE_WEB);
$home = WebAppContainer::instance('webappcontainer')->getCurrentWebApp()->getHome();
$innomatic->bootstrap($home, $home . 'core/conf/innomatic.ini');
$id = basename($req->getParameter('id'));
//$id = basename($_GET['id']);
$args = unserialize(file_get_contents(InnomaticContainer::instance('innomaticcontainer')->getHome() . 'core/temp/phplot/' . $id));
require_once 'phplot/PHPlot.php';
$graph = new PHPlot($args['width'], $args['height']);
$graph->SetIsInline('1');
//$graph->SetDataColors( array("blue",'white'),array("black") );
//$graph->$line_style = array('dashed','dashed','solid','dashed','dashed','solid');
// Base
$graph->SetDataValues($args['data']);
$graph->SetPlotType($args['plottype']);
// Appearance
$graph->SetPointShape($args['pointshape']);
$graph->SetPointSize($args['pointsize']);
$graph->SetTitle($args['title']);
// Color
$graph->SetBackgroundColor($args['backgroundcolor']);
$graph->SetGridColor($args['gridcolor']);
if (count($args['legend'])) {
$graph->SetLegend($args['legend']);
}
$graph->SetLineWidth($args['linewidth']);
$graph->SetTextColor($args['textcolor']);
$graph->SetDataColors(array(array(145, 165, 207), array(114, 167, 112), array(71, 85, 159), array(175, 83, 50), array(247, 148, 53), array(240, 231, 125), array(154, 204, 203), array(201, 164, 196)), 'black');
//$graph->data_color = array( array(145,165,207), array(114,167,112), array(71,85,159), array(175,83,50), array(247,148,53), array(240,231,125), array(154,204,203), array(201,164,196) );
//array('blue','green','yellow','red','orange');
$graph->DrawGraph();
unlink(InnomaticContainer::instance('innomaticcontainer')->getHome() . 'core/temp/phplot/' . $id);
}
示例5: testBars
function testBars()
{
# PHPlot Example: Bar chart, 3 data sets, unshaded
$data = array(array('Jan', 40, 2, 4), array('Feb', 30, 3, 4), array('Mar', 20, 4, 4), array('Apr', 10, 5, 4), array('May', 3, 6, 4), array('Jun', 7, 7, 4), array('Jul', 10, 8, 4), array('Aug', 15, 9, 4), array('Sep', 20, 5, 4), array('Oct', 18, 4, 4), array('Nov', 16, 7, 4), array('Dec', 14, 3, 4));
$plot = new PHPlot(800, 600);
$plot->SetIsInline(true);
$plot->SetImageBorderType('plain');
$plot->SetPlotType('bars');
$plot->SetDataType('text-data');
$plot->SetDataValues($data);
# Main plot title:
$plot->SetTitle('Unshaded Bar Chart with 3 Data Sets');
# No 3-D shading of the bars:
$plot->SetShading(0);
# Make a legend for the 3 data sets plotted:
$plot->SetLegend(array('Engineering', 'Manufacturing', 'Administration'));
# Turn off X tick labels and ticks because they don't apply here:
$plot->SetXTickLabelPos('none');
$plot->SetXTickPos('none');
$plot->DrawGraph();
}
示例6: make_plot
function make_plot($plot_type, $data_type, $nx, $ny)
{
$plot = new PHPlot(1280, 1024);
$plot->SetPrintImage(False);
$plot->SetFailureImage(False);
$plot->SetDataType($data_type);
$plot->SetDataValues(make_data_array($plot_type, $data_type, $nx, $ny, 100));
$plot->SetPlotType($plot_type);
$plot->SetTitle("Serialize/Unserialize Tests\n{$plot_type} - {$data_type}");
$plot->SetXTickIncrement(5);
$plot->SetYTickIncrement(10);
$plot->SetPlotBorderType('full');
$plot->SetDrawXGrid(True);
$plot->SetDrawYGrid(True);
$plot->SetXTitle('X Axis Title');
$plot->SetYTitle('Y Axis Title');
# Select data labels or tick labels based on data type:
if ($data_type == 'data-data') {
$plot->SetXDataLabelPos('none');
$plot->SetXTickLabelPos('plotdown');
$plot->SetXTickPos('plotdown');
} elseif ($data_type == 'text-data') {
$plot->SetXDataLabelPos('plotdown');
$plot->SetXTickLabelPos('none');
$plot->SetXTickPos('none');
} elseif ($data_type == 'data-data-yx') {
$plot->SetYDataLabelPos('none');
$plot->SetYTickLabelPos('plotleft');
$plot->SetYTickPos('plotleft');
} elseif ($data_type == 'text-data-yx') {
$plot->SetYDataLabelPos('plotleft');
$plot->SetYTickLabelPos('none');
$plot->SetYTickPos('none');
}
return $plot;
}
示例7: strtoupper
# Reload data colors and apply alpha to all:
if (isset($tp['alpha'])) {
$p->SetDataColors(NULL, NULL, $tp['alpha']);
$title[] = "Alpha=" . $tp['alpha'];
}
$p->SetFileFormat($tp['output']);
$title[] = strtoupper($tp['output']) . ' Output';
if ($tp['antialias']) {
$title[] = "Antialiased";
}
if ($tp['noalphablend']) {
$title[] = "No alpha blending";
}
if (isset($tp['gamma'])) {
$title[] = "Gamma=" . $tp['gamma'];
}
if ($tp['savealpha']) {
$title[] = "Save alpha";
}
$p->SetTitle(implode(', ', $title));
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetLineWidths(3);
$p->SetLineStyles('solid');
$p->SetPlotType('lines');
$p->SetXTickIncrement(1);
$p->SetYTickIncrement(1);
$p->SetDrawDashedGrid(False);
// Or it doesn't show with anti-aliasing
$p->SetDrawXGrid(True);
$p->DrawGraph();
示例8: sin
$sdt = sin($dtheta);
$x = $r;
$y = 0.0;
for ($grp = 1; $grp <= $tp['ngroups']; $grp++) {
$row = array("={$grp}=");
for ($bar = 1; $bar <= $tp['nbars']; $bar++) {
$row[] = floor($x + 0.5);
$tx = $x * $cdt - $y * $sdt;
$y = $x * $sdt + $y * $cdt;
$x = $tx;
}
$data[] = $row;
}
}
$p = new PHPlot(800, 600);
$p->SetTitle($tp['title'] . $tp['suffix']);
$p->SetDataType('text-data');
$p->SetDataValues($data);
# Options:
# Note: <=5.0rc3 used x_label font. This was corrected.
if (isset($tp['fontsize'])) {
$p->SetFont('y_label', $tp['fontsize']);
}
if (isset($tp['shading'])) {
$p->SetShading($tp['shading']);
}
# Note: This didn't work <= 5.0rc3
if (isset($tp['yprec'])) {
$p->SetPrecisionY($tp['yprec']);
}
$p->SetXTickLabelPos('none');
示例9: Max
$result = mysql_query("SELECT Max(player_money_total_amount) max,min(player_money_total_amount) min FROM meridian103.player_money_total;");
while ($row = mysql_fetch_assoc($result)) {
$max = $row['max'];
$min = $row['min'];
}
$min -= 1000000;
mysql_free_result($result);
*/
$result = mysql_query("SELECT player_money_total_amount amount, player_money_total_time time from meridian103.player_money_total where date(player_money_total_time) = date(now()) order by player_money_total_time ASC;");
while ($row = mysql_fetch_assoc($result)) {
$data[] = array($row['time'], $row['amount']);
}
mysql_free_result($result);
mysql_close($link);
//Define the object
$plot = new PHPlot();
$plot->SetTitle("Server 103 Total Shillings over Time - Period 1 Day");
$plot->SetFontGD('y_label', 5);
$plot->SetFontGD('x_label', 5);
//$plot->SetPlotAreaWorld(NULL,$min,NULL,$max);
$plot->SetXLabelAngle(90);
$plot->SetYDataLabelPos('plotin');
$plot->SetDrawYDataLabelLines('false');
//$plot->SetFontGD('y_title', 5);
//$plot->SetFontGD('x_title', 5);
$plot->SetDataValues($data);
//Turn off X axis ticks and labels because they get in the way:
$plot->SetXTickLabelPos('none');
$plot->SetXTickPos('none');
//Draw it
$plot->DrawGraph();
示例10: PHPlot
<?php
/* $Id: inline_image.php,v 1.2 2004-05-04 15:23:45 alex Exp $ */
if (!isset($_GET['which_title'])) {
echo <<<EOF
<pre>
*************************************************
* This file is meant to be called only from the *
* <a href="test_setup.php">test page</a> *
* It will fail if called by itself. *
*************************************************
</pre>
EOF;
exit;
}
// From PHP 4.?, register_globals is off, take it into account (MBD)
include '../phplot.php';
$graph = new PHPlot();
include './data.php';
$graph->SetTitle("{$_GET['which_title']}");
$graph->SetDataValues($example_data);
$graph->SetIsInline('1');
$graph->SetFileFormat("{$_GET['which_format']}");
$graph->DrawGraph();
示例11: mktime
require_once 'phplot.php';
# H M S m d y
$base_time = mktime(0, 0, 12, 6, 30, 2004);
$interval = 60 * 60;
$data = array();
# This is a quadratic from 0,0 to 50,20 to 100,0:
for ($i = 0; $i <= 100; $i++) {
if ($i % 24 == 0) {
$t = $base_time + $i * $interval;
} else {
$t = '';
}
$data[] = array($t, $i, $i * (0.8 - 0.008 * $i));
}
$p = new PHPlot(800, 600);
$p->SetTitle('Date X labels - 8 hour ticks, 24 hour labels');
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetPlotAreaWorld(0, 0, 100, 20);
$p->SetXLabelType('time');
# For example:
# %Y-%m-%d 2004-12-31
# %b %Y Dec 2004
# %b %d, %Y Dec 31, 2004
# %d %b 31 Dec
$p->SetXTimeFormat('%m/%d %H:%M');
# Turn off X tick labels, use our data labels only:
$p->SetXTickLabelPos('none');
# But we can use the tick marks themselves if we make them line up right.
$p->SetXTickIncrement(8);
$p->SetDrawXGrid(True);
示例12: array
<?php
session_start();
require_once 'phplot.php';
echo $_GET[countKeywords];
$data = array(array('新增文件', intval($_GET[countnew])), array('删除文件', intval($_GET[countdel])), array('修改文件', intval($_GET[countmodify])));
$plot = new PHPlot(350, 280);
$plot->SetTTFPath('./public');
$plot->SetDefaultTTFont('SIMHEI.TTF');
$plot->SetUseTTF(True);
$plot->SetImageBorderType('plain');
$plot->SetPlotType('bars');
$plot->SetDataType('text-data');
$plot->SetPlotBorderType('full');
$plot->SetBackgroundColor('#ffffcc');
$plot->SetDrawPlotAreaBackground(True);
$plot->SetPlotBgColor('#ffffff');
$plot->SetDataValues($data);
$plot->SetTitle("新增文件数:{$_GET['countnew']} 删除文件数:{$_GET['countdel']} 修改文件数:{$_GET['countmodify']}");
$plot->SetTitleColor('#D9773A');
foreach ($data as $row) {
$plot->Setshading(10);
}
$plot->SetDataBorderColors('black');
$plot->DrawGraph();
示例13: array
<?php
# $Id$
# PHPlot Example: Pie/text-data-single
require_once 'phplot.php';
# The data labels aren't used directly by PHPlot. They are here for our
# reference, and we copy them to the legend below.
$data = array(array('Australia', 7849), array('Dem Rep Congo', 299), array('Canada', 5447), array('Columbia', 944), array('Ghana', 541), array('China', 3215), array('Philippines', 791), array('South Africa', 19454), array('Mexico', 311), array('United States', 9458), array('USSR', 9710));
$plot = new PHPlot(800, 600);
$plot->SetImageBorderType('plain');
$plot->SetPlotType('pie');
$plot->SetDataType('text-data-single');
$plot->SetDataValues($data);
# Set enough different colors;
$plot->SetDataColors(array('red', 'green', 'blue', 'yellow', 'cyan', 'magenta', 'brown', 'lavender', 'pink', 'gray', 'orange'));
# Main plot title:
$plot->SetTitle("World Gold Production, 1990\n(1000s of Troy Ounces)");
# Build a legend from our data array.
# Each call to SetLegend makes one line as "label: value".
foreach ($data as $row) {
$plot->SetLegend(implode(': ', $row));
}
$plot->DrawGraph();
示例14: array
# PHPlot / contrib / color_range : Example
# $Id$
# This is a bar chart with a color gradient for the bars in each group.
require_once 'phplot.php';
require_once 'color_range.php';
$bars_per_group = 10;
$x_values = 4;
mt_srand(1);
$data = array();
for ($i = 0; $i < $x_values; $i++) {
$row = array($i);
for ($j = 0; $j < $bars_per_group; $j++) {
$row[] = mt_rand(0, 100);
}
$data[] = $row;
}
$p = new PHPlot(800, 600);
$p->SetTitle('Example - Bar Chart with gradient colors');
$p->SetDataType('text-data');
$p->SetDataValues($data);
$p->SetPlotAreaWorld(0, 0, $x_values, 100);
# This isn't necessary, as we do know how many data sets (bars_per_group):
$n_data = count_data_sets($data, 'text-data');
# Make a gradient color map:
$colors = color_range($p->SetRGBColor('SkyBlue'), $p->SetRGBColor('DarkGreen'), $n_data);
$p->SetDataColors($colors);
$p->SetXTickLabelPos('none');
$p->SetXTickPos('none');
$p->SetPlotType('bars');
$p->DrawGraph();
示例15: Copyright
Copyright (c) 2002 osCommerce
Released under the GNU General Public License
*/
include 'includes/classes/phplot.php';
$year = $HTTP_GET_VARS['year'] ? $HTTP_GET_VARS['year'] : date('Y');
$stats = array();
for ($i = 1; $i < 13; $i++) {
$stats[] = array(strftime('%b', mktime(0, 0, 0, $i)), '0', '0');
}
$banner_stats_query = tep_db_query("select month(banners_history_date) as banner_month, sum(banners_shown) as value, sum(banners_clicked) as dvalue from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . $banner_id . "' and year(banners_history_date) = '" . $year . "' group by banner_month");
while ($banner_stats = tep_db_fetch_array($banner_stats_query)) {
$stats[$banner_stats['banner_month'] - 1] = array(strftime('%b', mktime(0, 0, 0, $banner_stats['banner_month'])), $banner_stats['value'] ? $banner_stats['value'] : '0', $banner_stats['dvalue'] ? $banner_stats['dvalue'] : '0');
}
$graph = new PHPlot(600, 350, 'images/graphs/banner_monthly-' . $banner_id . '.' . $banner_extension);
$graph->SetFileFormat($banner_extension);
$graph->SetIsInline(1);
$graph->SetPrintImage(0);
$graph->SetSkipBottomTick(1);
$graph->SetDrawYGrid(1);
$graph->SetPrecisionY(0);
$graph->SetPlotType('lines');
$graph->SetPlotBorderType('left');
$graph->SetTitleFontSize('4');
$graph->SetTitle(sprintf(TEXT_BANNERS_MONTHLY_STATISTICS, $banner['banners_title'], $year));
$graph->SetBackgroundColor('white');
$graph->SetVertTickPosition('plotleft');
$graph->SetDataValues($stats);
$graph->SetDataColors(array('blue', 'red'), array('blue', 'red'));
$graph->DrawGraph();
$graph->PrintImage();