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


PHP PHPlot::SetPlotAreaWorld方法代码示例

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


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

示例1: plotBarData

function plotBarData($dataArray, $title)
{
    $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));
    $data = $dataArray;
    $plot = new PHPlot(400, 300);
    $plot->SetIsInline(true);
    $plot->SetOutputFile($title . '.png');
    $plot->SetImageBorderType('plain');
    $plot->SetPlotType('bars');
    //$plot->SetPlotType('stackedbars');
    //$plot->SetPlotType('lines');
    $plot->SetDataType('text-data');
    //$plot->SetDataType('data-data');
    $plot->SetPlotAreaWorld(NULL, -10, NULL, 35);
    $plot->SetDataValues($data);
    $plot->SetDataColors(array('red', 'blue', 'green', 'yellow'));
    # Main plot title:
    $plot->SetTitle($title);
    # No 3-D shading of the bars:
    $plot->SetShading(0);
    # Make a legend for the 3 data sets plotted:
    $plot->SetLegend(array('min', 'avg', 'max'));
    //$plot->SetLegendPosition(0, 0, 'image', 0, 0, 35, 5);
    # Turn off X tick labels and ticks because they don't apply here:
    $plot->SetXTickLabelPos('none');
    $plot->SetXTickPos('none');
    $plot->DrawGraph();
}
开发者ID:SuichiesS,项目名称:homewatch,代码行数:28,代码来源:phplotbars.php

示例2: cos

#   Y2 = cos(x)
$end = M_PI * 2.0;
$delta = $end / 20.0;
$data = array();
for ($x = 0; $x <= $end; $x += $delta) {
    $data[] = array('', $x, sin($x), cos($x));
}
$plot = new PHPlot(800, 600);
$plot->SetImageBorderType('plain');
$plot->SetPlotType('lines');
$plot->SetDataType('data-data');
$plot->SetDataValues($data);
# Main plot title:
$plot->SetTitle('Line Plot, Sin and Cos');
# Make a legend for the 2 functions:
$plot->SetLegend(array('sin(t)', 'cos(t)'));
# Select a plot area and force ticks to nice values:
$plot->SetPlotAreaWorld(0, -1, 6.8, 1);
# Even though the data labels are empty, with numeric formatting they
# will be output as zeros unless we turn them off:
$plot->SetXDataLabelPos('none');
$plot->SetXTickIncrement(M_PI / 8.0);
$plot->SetXLabelType('data');
$plot->SetPrecisionX(3);
$plot->SetYTickIncrement(0.2);
$plot->SetYLabelType('data');
$plot->SetPrecisionY(1);
# Draw both grids:
$plot->SetDrawXGrid(True);
$plot->SetDrawYGrid(True);
$plot->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:lines2.php

示例3: array

}
$tp = array_merge(array('title' => "Miscellaneous Options\nColor Map, Line Spacing, Dashed Grid", 'suffix' => " (baseline)", 'colormap' => NULL, 'datacolors' => NULL, 'linespacing' => NULL, 'dashedgrid' => True), $tp);
require_once 'phplot.php';
#                          Land area in 10^6 sq km
#
$data = array(array('Monday', 10, 23, 7, 15), array('Tuesday', 25, 7, 12, 9), array('Wednesday', 8, 15, 18, 15), array('Thursday', 16, 9, 26, 16), array('Friday', 20, 25, 21, 14));
$plot = new PHPlot(800, 600);
$plot->SetPlotType('bars');
$plot->SetDataType('text-data');
$plot->SetDataValues($data);
# Options:
if (isset($tp['linespacing'])) {
    $plot->SetLineSpacing($tp['linespacing']);
}
if (isset($tp['colormap'])) {
    $plot->SetRGBArray($tp['colormap']);
}
if (isset($tp['datacolors'])) {
    $plot->SetDataColors($tp['datacolors']);
    $plot->SetErrorBarColors($tp['datacolors']);
}
$plot->SetDrawDashedGrid($tp['dashedgrid']);
$plot->SetTitle($tp['title'] . "\n" . $tp['suffix']);
$plot->SetLegend(array('Data Set 1', 'Data Set 2', 'Data Set 3', 'Data Set 4'));
$plot->SetXTickLabelPos('none');
$plot->SetXTickPos('none');
$plot->SetDrawXGrid(True);
$plot->SetDrawYGrid(True);
$plot->SetPlotAreaWorld(NULL, 0, NULL, 30);
$plot->SetNumYTicks(30);
$plot->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:misc-a.php

示例4: mktime

# To get a repeatable test with 'random' data:
mt_srand(1);
# Need a base date/time: Can't just use 0 due to UTC/local differences:
$base_time = mktime(0, 0, 0, 1, 1, 2000);
# Twenty minutes:
$interval = 20 * 60;
# Random data at intervals:
$data = array();
$t = $base_time;
for ($i = 1; $i <= 12; $i++) {
    $data[] = array('', $t, mt_rand(0, 100));
    $t += $interval;
}
$p = new PHPlot(600, 400);
$p->SetTitle('Meaningless Data with Time X Tick Labels');
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetXLabelType('time');
$p->SetXTimeFormat('%H:%M');
$p->SetXTitle('Elapsed Time (hours:minutes)');
# Turn off X data labels, use tick labels only:
$p->SetXDataLabelPos('none');
$p->SetXTickLabelPos('plotdown');
# Even though tick values are given, it makes up its own unless:
$p->SetXTickIncrement($interval);
$p->SetDrawXGrid(True);
# Set the Y min and max, since the data is 0:100
$p->SetPlotAreaWorld(NULL, 0, NULL, 100);
$p->SetYTitle('Meaningless Value');
$p->SetPlotType('lines');
$p->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:time-tick-label.php

示例5: array

<?php

# Typical bars with labels, for manual.
require_once 'phplot.php';
$data = array(array('First', 10), array('Second', 20), array('Third', 30));
$p = new PHPlot(400, 300);
$p->SetDataType('text-data-yx');
$p->SetDataValues($data);
$p->SetPlotType('bars');
$p->SetTitle('Horizontal Bar Plot With Labels');
$p->SetXTitle('Dependent Variable');
$p->SetYTitle('Independent Variable');
$p->SetYDataLabelPos('plotleft');
$p->SetYTickPos('none');
$p->SetXDataLabelPos('plotin');
$p->SetPlotAreaWorld(0, NULL, 40, NULL);
$p->SetXTickIncrement(5);
$p->SetImageBorderType('plain');
$p->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:19,代码来源:labels-horizbar.php

示例6: array

$tp = array_merge(array('title' => 'Lines', 'suffix' => ' (1 line, default styles)', 'nlines' => 1, 'LWidths' => NULL, 'LStyles' => NULL, 'DStyle' => NULL), $tp);
require_once 'phplot.php';
$np = $tp['nlines'];
$data = array();
for ($i = 1; $i <= 20; $i++) {
    $row = array('', $i);
    for ($j = 1; $j <= $np; $j++) {
        $row[] = $i + $j;
    }
    $data[] = $row;
}
$p = new PHPlot(800, 600);
$p->SetTitle($tp['title'] . $tp['suffix']);
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetPlotAreaWorld(0, 0, 21, 40);
$p->SetXTickIncrement(1);
$p->SetYTickIncrement(5);
# Options:
if (isset($tp['LWidths'])) {
    $p->SetLineWidths($tp['LWidths']);
}
if (isset($tp['DStyle'])) {
    $p->SetDefaultDashedStyle($tp['DStyle']);
}
if (isset($tp['LStyles'])) {
    $p->SetLineStyles($tp['LStyles']);
}
$p->SetDrawXGrid(False);
$p->SetDrawYGrid(False);
$p->SetPlotType('lines');
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:lines-n.php

示例7: array

# this script. The parameters are shown in the defaults array below:
if (!isset($tp)) {
    $tp = array();
}
$tp = array_merge(array('title' => 'Long X labels', 'suffix' => "", 'MaxLen' => 35, 'angle' => 90, 'TTF' => False, 'FontSize' => NULL, 'FontName' => 'sans'), $tp);
require_once 'phplot.php';
$data = array();
for ($len = 5; $len <= $tp['MaxLen']; $len += 5) {
    $data[] = array(str_repeat('Label', $len / 5), $len);
}
$p = new PHPlot(800, 600);
$p->SetTitle($tp['title'] . $tp['suffix']);
$p->SetDataType('text-data');
$p->SetDataValues($data);
# Fix Y ticks
$p->SetPlotAreaWorld(NULL, 0, NULL, NULL);
$p->SetYTickIncrement(5);
# Font:
if ($tp['TTF']) {
    # Using TrueType fonts: Set path and default font.
    $p->SetTTFPath($phplot_test_ttfdir);
    $font = $phplot_test_ttfonts[$tp['FontName']];
    $p->SetDefaultTTFont($font);
    # Now select label font with size (if supplied):
    if (empty($tp['FontSize'])) {
        $p->SetFont('x_label', $font);
    } else {
        $p->SetFont('x_label', $font, $tp['FontSize']);
    }
} else {
    # Using GD fonts:
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:long-labels.php

示例8:

//Must be called before SetDataValues
$graph->SetNewPlotAreaPixels(90, 40, 540, 190);
$graph->SetDataValues($example_data);
$graph->SetXGridLabelType("time");
$graph->SetXDataLabelAngle(90);
$graph->SetXLabel("");
$graph->SetYLabel("Price");
$graph->SetVertTickIncrement(20);
$graph->SetHorizTickIncrement(2679000);
$graph->SetXTimeFormat("%b %y");
$graph->SetPlotType("lines");
$graph->SetErrorBarShape("line");
$graph->SetPointShape("halfline");
$graph->SetYScaleType("log");
$graph->SetLineWidth(1);
$graph->SetPlotAreaWorld(883634400, 1, 915095000, 140);
$graph->DrawGraph();
//Now do the second chart on the image
unset($example_data);
$graph->SetPrintImage(1);
//Now draw the image
$graph->SetYScaleType("linear");
include "./data_date.php";
$graph->SetDataType("data-data");
//Must be called before SetDataValues
$graph->SetDataValues($example_data);
$graph->SetNewPlotAreaPixels(90, 260, 540, 350);
$graph->SetDataValues($example_data);
$graph->SetXGridLabelType("time");
$graph->SetXDataLabelAngle(90);
$graph->SetXLabel("");
开发者ID:vojtajina,项目名称:sitellite,代码行数:31,代码来源:example8.php

示例9: array

    $tp = array();
}
$tp = array_merge(array('c' => 10, 't' => 1, 'ar' => FALSE), $tp);
require_once 'phplot.php';
# Extract all test parameters as local variables:
extract($tp);
$title = "Log/Log Axis Test\nPlotting: XY = {$c}\n" . "Tick step: " . (empty($t) ? "Auto" : $t) . ", " . "Range: " . ($ar ? "Auto" : "Manually set");
# Plot X*Y=C
$data = array();
for ($x = 1; $x <= $c; $x++) {
    $data[] = array('', $x, $c / $x);
}
$p = new PHPlot(800, 600);
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetTitle($title);
$p->SetXScaleType('log');
$p->SetYScaleType('log');
if (empty($t)) {
    $p->SetXTickIncrement($t);
    $p->SetYTickIncrement($t);
}
if (!$ar) {
    $p->SetPlotAreaWorld(0, 1, $c + 1, $c + 1);
}
$p->SetXTickAnchor(0);
$p->SetYTickAnchor(0);
$p->SetDrawXGrid(True);
$p->SetDrawYGrid(True);
$p->SetPlotType('lines');
$p->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:range-log.php

示例10: array

# Results in Y axis on left side at X=10, X axis at bottom Y=10
$data1 = array(array('', 10, 10), array('', 11, 11), array('', 12, 12));
# Data array for plot #2:
# X axis should in the middle at Y=0
# Y axis should be on left at X=-20
# But instead they stick from plot #1 at Y=10, X=10.
$data2 = array(array('', -20, -10), array('', -5, 2), array('', 30, 20));
// Common setup:
$plot = new PHPlot(460, 600);
$plot->SetTitle("Multiple Plots - axis position (case {$case})\n" . "X and Y axis positions stick from upper plot");
$plot->SetPlotType('points');
$plot->SetDataType('data-data');
$plot->SetPrintImage(False);
// Plot #1:
$plot->SetPlotAreaPixels(NULL, 60, NULL, 300);
$plot->SetPlotAreaWorld();
$plot->SetDataValues($data1);
$plot->DrawGraph();
// Plot #2:
$plot->SetPlotAreaPixels(NULL, 330, NULL, 570);
$plot->SetPlotAreaWorld();
$plot->SetDataValues($data2);
if ($case == 2) {
    $plot->SetXAxisPosition();
    // Reset to default
    $plot->SetYAxisPosition();
    // Reset to default
}
$plot->DrawGraph();
// Finish:
$plot->PrintImage();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:multidefault-axis1.php

示例11: Title

$plot->SetFontTTF('x_title', $font, 14);
$plot->SetFontTTF('y_title', $font, 10);
# Disable auto-output:
$plot->SetPrintImage(0);
$title = "Test {$n_plots} Plots with TTF Title (sequence {$title_sequence})";
$y1 = $title_space;
// Top of plot area
for ($i = 0; $i < $n_plots; $i++) {
    if ($i == $title_sequence) {
        $plot->SetTitle($title);
    }
    $y2 = $y1 + $height_of_each_plot;
    // Bottom of plot area
    # fwrite(STDERR, "Plot $i area: min=(80, $y1) : max=(740, $y2)\n");
    $plot->SetPlotAreaPixels(80, $y1, 740, $y2);
    $plot->SetDataType('text-data');
    $plot->SetDataValues($report[$i]);
    $plot->SetPlotAreaWorld(NULL, 0, NULL, $max_x);
    $plot->SetDataColors(array('blue'));
    $plot->SetXTickLabelPos('none');
    $plot->SetXDataLabelPos('plotdown');
    $plot->SetXTickPos('plotdown');
    $plot->SetYTickIncrement(1);
    $plot->SetXTitle("Chart {$i} X Values");
    $plot->SetYTitle("Chart {$i} Y Values");
    $plot->SetPlotType('bars');
    $plot->DrawGraph();
    $y1 = $y2 + $space_below_plots;
    // Start next plot below last plot
}
$plot->PrintImage();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:overtitle.php

示例12: array

<?php

# PHPlot Example: Point chart with error bars
require_once 'phplot.php';
$data = array(array('', 1, 23.5, 5, 5), array('', 2, 20.1, 3, 3), array('', 3, 19.1, 2, 2), array('', 4, 16.8, 3, 3), array('', 5, 18.4, 4, 6), array('', 6, 20.5, 3, 2), array('', 7, 23.2, 4, 4), array('', 8, 23.1, 5, 2), array('', 9, 24.5, 2, 2), array('', 10, 28.1, 2, 2));
$plot = new PHPlot(800, 600);
$plot->SetImageBorderType('plain');
$plot->SetPlotType('points');
$plot->SetDataType('data-data-error');
$plot->SetDataValues($data);
# Main plot title:
$plot->SetTitle('Points Plot With Error Bars');
# Set data range and tick increments to get nice even numbers:
$plot->SetPlotAreaWorld(0, 0, 11, 40);
$plot->SetXTickIncrement(1);
$plot->SetYTickIncrement(5);
# Draw both grids:
$plot->SetDrawXGrid(True);
$plot->SetDrawYGrid(True);
# Is default
# Set some options for error bars:
$plot->SetErrorBarShape('tee');
# Is default
$plot->SetErrorBarSize(10);
$plot->SetErrorBarLineWidth(2);
# Use a darker color for the plot:
$plot->SetDataColors('brown');
$plot->SetErrorBarColors('brown');
# Make the points bigger so we can see them:
$plot->SetPointSizes(10);
$plot->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:points1.php

示例13: PHPlot

<?php

require 'phplot/phplot.php';
require 'mem_image.php';
$graph = new PHPlot(500, 300);
$graph->SetDataType('data-data');
//Specify some data
$data = array(array('', 2000, 750), array('', 2010, 1700), array('', 2015, 2000), array('', 2020, 1800), array('', 2025, 1300), array('', 2030, 400));
$graph->SetDataValues($data);
//Specify plotting area details
$graph->SetPlotType('lines');
$graph->SetTitleFontSize('2');
$graph->SetTitle('Social Security trust fund asset estimates, in $ billions');
$graph->SetMarginsPixels(null, null, 40, null);
$graph->SetPlotAreaWorld(2000, 0, 2035, 2000);
$graph->SetPlotBgColor('white');
$graph->SetPlotBorderType('left');
$graph->SetBackgroundColor('white');
$graph->SetDataColors(array('red'), array('black'));
//Define the X axis
$graph->SetXLabel('Year');
$graph->SetXTickIncrement(5);
//Define the Y axis
$graph->SetYTickIncrement(500);
$graph->SetPrecisionY(0);
$graph->SetLightGridColor('blue');
//Disable image output
$graph->SetPrintImage(false);
//Draw the graph
$graph->DrawGraph();
$pdf = new PDF_MemImage();
开发者ID:rusli-nasir,项目名称:ERP_Accounting_Indonesia,代码行数:31,代码来源:PDF_plot.php

示例14: array

# resetting attributes.
# Reference: Bug report 2839457
require_once 'phplot.php';
$data = array(array('', -1000, 1000), array('', -500, 23456), array('', 0, 800), array('', 500, 234100), array('', 1000, 1234567), array('', 1500, 100000), array('', 2000, 1901000), array('', 2500, 999999));
$title = "Test Attribute Resets:\n";
if (empty($test_resets)) {
    $title .= 'Baseline - red border, formatted labels';
} else {
    $title .= 'Reset to no border, no label formatting';
}
$plot = new PHPlot(400, 400);
$plot->SetTitle($title);
$plot->SetPlotType('lines');
$plot->SetDataType('data-data');
$plot->SetDataValues($data);
$plot->SetPlotAreaWorld(-1000, 0);
$plot->SetXDataLabelPos('none');
$plot->SetXTickIncrement(500);
$plot->SetXLabelType('data', 0, '', 'M');
$plot->SetYTickIncrement(200000);
$plot->SetYLabelType('data', 2);
$plot->SetImageBorderType('raised');
$plot->SetImageBorderColor('red');
$plot->SetDrawXGrid(False);
$plot->SetDrawYGrid(False);
# Set $test_resets=True and include this file to test resets:
if (!empty($test_resets)) {
    # Reset to no border:
    $plot->SetImageBorderType('none');
    # Reset X to no formatting using empty string:
    $plot->SetXLabelType('');
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:resets0.php

示例15: array

}
# The variable $plot_type can be set in another script as well.
if (empty($plot_type)) {
    $plot_type = 'linepoints';
}
# Use data labels to display only the points we want,
# but specify the same values for X to get the correct
# spacing.
$data = array(array('1990', 1990, 41308, 21015, 62634), array('1995', 1995, 44310, 13883, 61529), array('2000', 2000, 46772, 9000, 59421), array('2004', 2004, 46887, 7738, 57754), array('2006', 2006, 45441, 6888, 53179), array('2008', 2008, 42757, 5840, 49115));
$legend_text = array('Morning Papers', 'Evening Papers', 'Sunday Papers');
$plot = new PHPlot(800, 600);
$plot->SetImageBorderType('plain');
// Improves presentation in the manual
$plot->SetTitle("US Daily Newspaper Circulation\n" . $plot_type . ' plot with SetLegendUseShapes(' . ($use_shapes ? 'True' : 'False') . ')');
$plot->SetPlotType($plot_type);
$plot->SetDataType('data-data');
$plot->SetDataValues($data);
$plot->SetPlotAreaWorld(1988, 0, 2010, 80000);
$plot->SetYTickIncrement(10000);
$plot->SetLegend($legend_text);
$plot->SetXTickPos('none');
$plot->SetDrawXDataLabelLines(True);
$plot->SetLegendUseShapes($use_shapes);
// Use color boxes or shapes
$plot->SetPointSizes(12);
// Make points bigger for visibility
$plot->SetLineStyles('solid');
// Make all lines solid
$plot->SetLineWidths(2);
// Make all lines thicker
$plot->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:legendshape.php


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