本文整理汇总了PHP中PHPlot::SetXDataLabelPos方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPlot::SetXDataLabelPos方法的具体用法?PHP PHPlot::SetXDataLabelPos怎么用?PHP PHPlot::SetXDataLabelPos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPlot
的用法示例。
在下文中一共展示了PHPlot::SetXDataLabelPos方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2:
break;
case 'y':
$graph->SetDrawXGrid(FALSE);
$graph->SetDrawYGrid(TRUE);
break;
case 'both':
$graph->SetDrawXGrid(TRUE);
$graph->SetDrawYGrid(TRUE);
break;
case 'none':
$graph->SetDrawXGrid(FALSE);
$graph->SetDrawYGrid(FALSE);
}
$graph->SetXTickLabelPos($which_xtick_label_pos);
$graph->SetYTickLabelPos($which_ytick_label_pos);
$graph->SetXDataLabelPos($which_xdata_label_pos);
$graph->SetYDataLabelPos($which_ydata_label_pos);
// Please remember that angles other than 90 are taken as 0 when working fith fixed fonts.
$graph->SetXLabelAngle($which_xlabel_angle);
$graph->SetYLabelAngle($which_ylabel_angle);
//$graph->SetLineStyles(array("dashed","dashed","solid","solid"));
$graph->SetPointShape($which_point);
$graph->SetPointSize($which_point_size);
$graph->SetDrawBrokenLines($which_broken);
// Some forms in format_chart.php don't set this variable, suppress errors.
@$graph->SetErrorBarShape($which_error_type);
$graph->SetXAxisPosition($which_xap);
$graph->SetYAxisPosition($which_yap);
$graph->SetPlotBorderType($which_btype);
if ($maxy_in) {
if ($which_data_type = "text-data") {
示例3: array
# 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('');
# Reset Y to no formatting using no argument:
示例4: guifi_stats_chart07
//.........这里部分代码省略.........
}
$datemin = mktime(0, 0, 0, $month, 1, $year);
if (isset($_GET['zone'])) {
$zone_id = $_GET['zone'];
if ($zone_id == "0") {
$zone_id = "0";
}
//"3671";
} else {
$zone_id = "0";
}
$avalue = array();
$adata = array();
for ($i = 0; $i < 10; $i++) {
$adata[] = array(0, 0);
}
$vsql = "select sum(if(timestamp_created >= " . $datemin . ",1,0)) as num, count(*) as total, zone_id\n from {guifi_location}\n where status_flag='Working' ";
if ($zone_id != "0") {
$achilds = guifi_zone_childs($zone_id);
$v = "";
foreach ($achilds as $key => $child) {
if ($v == "") {
$v .= "zone_id=" . $child;
} else {
$v .= " or zone_id=" . $child;
}
}
$vsql .= "AND (" . $v . ") ";
}
$vsql .= "GROUP BY zone_id ";
$result = db_query($vsql);
while ($record = db_fetch_object($result)) {
if ($record->total >= 20) {
$vn = $record->num / $record->total * 100;
$vmin = 0;
for ($i = 1; $i < 10; $i++) {
if ($adata[$vmin][1] > $adata[$i][1]) {
$vmin = $i;
}
}
if ($vn > $adata[$vmin][1]) {
$adata[$vmin][0] = $record->zone_id;
$adata[$vmin][1] = $vn;
}
}
}
for ($i = 0; $i < 10; $i++) {
if ($adata[$i][1] != 0) {
$avalue[$adata[$i][0]] = $adata[$i][1];
}
}
arsort($avalue);
foreach ($avalue as $key => $value) {
if ($value != 0) {
$data[] = array(substr(guifi_get_zone_name($key), 0, 20) . " �", $value);
}
}
$shapes = array('none');
$plot = new PHPlot($gwidth, $gheight);
$plot->SetPlotAreaWorld(0, 0, NULL, NULL);
$plot->SetFileFormat('png');
$plot->SetDataType("text-data");
$plot->SetDataValues($data);
$plot->SetPlotType("bars");
$plot->SetXTickIncrement(1);
$plot->SetSkipBottomTick(TRUE);
$plot->SetSkipLeftTick(TRUE);
$plot->SetTickLength(0);
//$plot->SetXTickPos('none');
$plot->SetYDataLabelPos('plotin');
$plot->SetYLabelType('data', 0);
$plot->SetTickColor('grey');
$plot->SetTTFPath($gDirTTFfonts);
$plot->SetFontTTF('title', 'Vera.ttf', 12);
$plot->SetFontTTF('x_label', 'Vera.ttf', 8);
if (isset($_GET['title'])) {
$plot->SetTitle("guifi.net \n" . t($_GET['title']));
} else {
if ($zone_id == "0") {
$plot->SetTitle("guifi.net \n" . t('Largest annual increase'));
} else {
$plot->SetTitle("guifi.net " . t('zone') . ": " . guifi_get_zone_name($zone_id) . "\n" . t('Largest annual increase'));
}
}
//$plot->SetXTitle(t('Zones'));
$plot->SetYTitle(t('% increase'));
$plot->SetXDataLabelPos('plotdown');
//$plot->SetXLabelAngle(45);
$plot->SetXDataLabelAngle(75);
$plot->SetGridColor('red');
$plot->SetPlotBorderType('left');
$plot->SetDataColors(array('orange'));
$plot->SetTextColor('DimGrey');
$plot->SetTitleColor('DimGrey');
$plot->SetLightGridColor('grey');
$plot->SetBackgroundColor('white');
$plot->SetTransparentColor('white');
$plot->SetIsInline(TRUE);
$plot->DrawGraph();
}
示例5: unserialize
| along with this program; if not, write to the Free Software |
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
+-----------------------------------------------------------------------------+
*/
/**
* ShowChart
*
* @author Helmuth Antholzer <helmuth.antholzer@maguma.com>
* @version $Id: showchart.php 15367 2007-11-22 10:46:29Z rkuester $
*/
include_once '../../Modules/SurveyQuestionPool/phplot/phplot.php';
$data = unserialize(base64_decode($_GET['data']));
$legend = unserialize(base64_decode($_GET['legend']));
$title = base64_decode($_GET['title']);
if ($legend == NULL) {
$legend = array();
}
if ($data == NULL) {
$data = array(array(0, ''));
}
$chart_type = $_GET['chart_type'];
$graph = new PHPlot(600, 350);
$graph->SetShading(0);
$graph->SetPlotType($chart_type);
$graph->SetDataType('text-data');
$graph->SetTitle($title . "\n\r\n\r");
$graph->SetXDataLabelPos('plotdown');
$graph->setLegend($legend);
$graph->SetDataValues($data);
$graph->DrawGraph();
$graph->PrintImage();
示例6: elseif
$p->SetFont('y_title', '', 12);
$p->SetFont('x_label', '', 12);
$p->SetFont('y_label', '', 12);
$p->SetFont('generic', '', 14);
} elseif ($tp['use_gdf']) {
$p->SetFont('legend', '4');
$p->SetFont('title', '5');
$p->SetFont('x_title', '3');
$p->SetFont('y_title', '3');
$p->SetFont('x_label', '2');
$p->SetFont('y_label', '2');
$p->SetFont('generic', '2');
}
# All axis, all labels, both sides
$p->SetTitle($tp['title'] . $tp['suffix']);
$p->SetLegend(array('Legend 1', 'Legend 2', 'Legend 3'));
$p->SetXTitle('X Axis Title Here', 'both');
$p->SetYTitle('Y Axis Title Here', 'both');
$p->SetXTickLabelPos('none');
$p->SetXTickPos('none');
$p->SetXDataLabelPos('both');
$p->SetYTickLabelPos('both');
$p->SetYTickPos('both');
$p->SetYDataLabelPos('plotin');
if (isset($tp['x_label_angle'])) {
$p->SetXLabelAngle($tp['x_label_angle']);
}
if (isset($tp['y_label_angle'])) {
$p->SetYLabelAngle($tp['y_label_angle']);
}
$p->DrawGraph();
示例7: elseif
} elseif (!$implied_x && $error_bars) {
# Explicit X, error bars
$data = array(array('A', 0, 0, 1, 0, 0, 0, 0), array('B', 1, 1, 1, 1, 2, 1, 1), array('H', 7, 7, 1, 1, 14, 1, 1), array('D', 3, 3, 1, 0, 6, 0, 0), array('F', 5, 5, 1, 1, 10, 1, 0), array('C', 2, 2, 0, 1, 4, 1, 1), array('G', 6, 6, 1, 1, 12, 0, 1), array('E', 4, 4, 0, 0, 8, 1, 1));
} else {
fwrite(STDERR, "Error: Unknown data type or not decoded: {$data}-type\n");
exit(1);
}
$p = new PHPlot(800, 800);
$p->SetTitle("Testing PHPlot ({$plot_type}, {$data_type})");
$p->SetDataType($data_type);
$p->SetDataValues($data);
$p->SetPlotType($plot_type);
if ($horizontal) {
$p->SetXTitle('X Axis - Dependent variable');
$p->SetYTitle('Y Axis - Independent variable');
$p->SetXDataLabelPos('plotin');
// Tick labels left, Axis Data labels right, so both can be seen.
$p->SetYTickLabelPos('plotleft');
$p->SetYDataLabelPos('plotright');
} else {
$p->SetXTitle('X Axis - Independent variable');
$p->SetYTitle('Y Axis - Dependent variable');
$p->SetYDataLabelPos('plotin');
// Tick labels below, Axis Data labels above, so both can be seen.
$p->SetXTickLabelPos('plotdown');
$p->SetXDataLabelPos('plotup');
}
# Customizations for error plots:
if ($error_bars) {
# With error plots, the default 90 degree position for data value labels
# will overlay the error bar, so move them to 45 degrees:
示例8: array
}
$data[] = $row;
}
} else {
// Regular plot that works with text-data data type:
$data_type = 'text-data';
for ($pt = 0; $pt < $n_x; $pt++) {
$row = array(strftime('%b', mktime(12, 12, 12, $pt + 1, 1, 2000)));
for ($r = 0; $r < $groups; $r++) {
$row[] = mt_rand(0, $max_y);
}
$data[] = $row;
}
}
$plot = new PHPlot();
$plot->SetTitle($title . $suffix);
$plot->SetDataType($data_type);
$plot->SetDataValues($data);
$plot->SetPlotType($plottype);
$plot->SetPlotAreaWorld(0, 0, $n_x, $max_y);
# Position data labels:
$plot->SetXDataLabelPos($labelpos);
# Turn data label lines on or off:
$plot->SetDrawXDataLabelLines($labellines);
# Turn off Tick labels and X Tick marks - they aren't used.
$plot->SetXTickLabelPos('none');
$plot->SetXTickPos('none');
# Don't draw grids, so we can see the data lines.
$plot->SetDrawXGrid(False);
$plot->SetDrawYGrid(False);
$plot->DrawGraph();
示例9: array
$tp = array_merge(array('title' => 'Tick Mark Variations', 'suffix' => ' - Baseline', 'skiptick' => NULL, 'xticklen' => NULL, 'yticklen' => NULL, 'xtickcross' => NULL, 'ytickcross' => NULL, 'xdatalabel' => 'none', 'xticklabel' => 'plotdown', 'xtick' => NULL, 'yticklabel' => 'plotleft'), $tp);
require_once 'phplot.php';
# Notes: You can't have both X tick and data labels on, because if
# you turn one on PHPlot turns the other off.
# 'xtick' need only be set if you want it different from 'xticklabel', for
# example to have X tick marks and data labels.
$data = array(array('AAA', 0, 0), array('BBB', 1, 8), array('CCC', 2, 3), array('DDD', 3, 7), array('EEE', 4, 5));
$p = new PHPlot(400, 300);
$p->SetTitle($tp['title'] . $tp['suffix']);
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetPlotAreaWorld(0, 0, 4, 10);
$p->SetXTickIncrement(1);
$p->SetYTickIncrement(1);
$p->SetPlotBorderType('full');
$p->SetXDataLabelPos($tp['xdatalabel']);
$p->SetXTickLabelPos($tp['xticklabel']);
if (isset($tp['xtick'])) {
$p->SetXTickPos($tp['xtick']);
} else {
$p->SetXTickPos($tp['xticklabel']);
}
$p->SetYTickLabelPos($tp['yticklabel']);
$p->SetYTickPos($tp['yticklabel']);
$p->SetXTitle('X TITLE');
$p->SetYTitle('Y TITLE');
# Tick skip tests:
if (isset($tp['skiptick'])) {
$s = $tp['skiptick'];
$n = strlen($s);
for ($i = 0; $i < $n; $i++) {
示例10: array
# <=12 13-17 17-28 30-39 40-54 >=55
$data = array(array('Cherry', 1, 1, 2, 2, 4, 3, 3, 4, 3, 5, 5, 6, 6), array('Apple', 2, 1, 9, 2, 7, 3, 4, 4, 7, 5, 3, 6, 7), array('Pear', 3, '', 2, 2, 2, 3, 3, 4, 4, 5, 3, 6, 2), array('Grape', 4, 1, 8, 2, 5, 3, 5, 4, 6, 5, 3, 6, 4), array('Kiwi', 5, '', 0, 2, 3, 3, 4, 4, 4, 5, 5, 6, 2), array('Banana', 6, 1, 5, 2, 4, 3, 6, 4, 3, 5, 3, 6, 4));
$plot = new PHPlot(600, 600);
$plot->SetTitle("Flavor Preference By Age Group");
$plot->SetDataType('data-data-xyz');
$plot->SetDataValues($data);
$plot->SetPlotType('bubbles');
$plot->SetDataColors('yellow');
// Use same color for all data sets
$plot->SetDrawPlotAreaBackground(True);
$plot->SetPlotBgColor('plum');
$plot->SetLightGridColor('red');
// Change grid color to make it visible
$plot->SetImageBorderType('plain');
$plot->SetPlotBorderType('full');
$plot->SetXTickIncrement(1);
// For grid line spacing
$plot->SetYTickIncrement(1);
$plot->SetPlotAreaWorld(0, 0, 6.5, 6.5);
# Establish the handler for the Y label text:
$plot->SetYLabelType('custom', 'get_label', $y_labels);
$plot->SetXTickPos('both');
// Tick marks on both sides
$plot->SetYTickPos('both');
// Tick marks on top and bottom too
$plot->SetXDataLabelPos('both');
// X axis data labels top and bottom
$plot->SetYTickLabelPos('both');
// Y axis labels left and right
$plot->SetDrawXGrid(True);
$plot->DrawGraph();
示例11:
$graph->SetNewPlotAreaPixels(90, 40, 540, 190);
$graph->SetDataValues($example_data);
$graph->SetXLabelType("time");
$graph->SetXLabelAngle(90);
$graph->SetXTitle("");
$graph->SetYTitle("Price");
$graph->SetYTickIncrement(20);
$graph->SetXTickIncrement(2679000);
$graph->SetXTimeFormat("%b %y");
$graph->SetPlotType("lines");
$graph->SetErrorBarShape("line");
$graph->SetPointShape("halfline");
$graph->SetYScaleType("log");
$graph->SetLineWidths(array(1));
$graph->SetPlotAreaWorld(883634400, 1, 915095000, 140);
$graph->SetXDataLabelPos('none');
$graph->DrawGraph();
//Now do the second chart on the image
unset($example_data);
$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->SetXLabelType("time");
$graph->SetXLabelAngle(90);
$graph->SetXTitle("");
$graph->SetYTitle("Volume");
$graph->SetYTickIncrement(30);
示例12: array
break;
case 3:
$fmt = array(1 => array('x' => '/%s/', 'xd' => '|%s|', 'y' => '<%s>', 'yd' => '"%s"'), 2 => array('x' => '[%s]', 'y' => '{%s}'));
$subtitle = "Upper plot: /X/ |XD| <Y> \"YD\"\n" . "Lower plot: [X] {Y}";
break;
}
// Common setup:
$plot = new PHPlot(460, 600);
$plot->SetPrintImage(False);
$plot->SetTitle("Multiple Plots, X,Y label format\n{$subtitle}");
$plot->SetPlotType('linepoints');
$plot->SetDataValues($data);
$plot->SetDataType('data-data');
$plot->SetYDataLabelPos('plotin');
// Enable both X tick and X data labels, but with data labels above.
$plot->SetXDataLabelPos('plotup');
$plot->SetXTickLabelPos('plotdown');
$plot->SetPlotBorderType('full');
// Plot #1:
$plot->SetPlotAreaPixels(NULL, 80, NULL, 305);
if (isset($fmt[1]['x'])) {
$plot->SetXLabelType('printf', $fmt[1]['x']);
}
if (isset($fmt[1]['y'])) {
$plot->SetYLabelType('printf', $fmt[1]['y']);
}
if (isset($fmt[1]['xd'])) {
$plot->SetXDataLabelType('printf', $fmt[1]['xd']);
}
if (isset($fmt[1]['yd'])) {
$plot->SetYDataLabelType('printf', $fmt[1]['yd']);
示例13: array
array_unshift($data, array('Base', -1, 20));
$x0 = -2;
}
$x_title = 'X Axis Title';
$y_title = 'Y Axis Title';
$p = new PHPlot(800, 600);
# Uncomment this and the require above for tracing:
#$p->SetCallback('debug_scale', 'debug_handler');
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetPlotBorderType('full');
$p->SetPlotAreaWorld($x0, $y0, $x1, $y1);
if ($tp['do_title']) {
$p->SetTitle($tp['title'] . $tp['suffix']);
}
$p->SetXDataLabelPos('none');
$p->SetXTitle($x_title, $tp['x_title_pos']);
$p->SetYTitle($y_title, $tp['y_title_pos']);
$p->SetXTickIncrement(1);
$p->SetYTickIncrement(10);
if (isset($tp['xdatalabel'])) {
$p->SetXTickLabelPos('none');
$p->SetXDataLabelPos($tp['xdatalabel']);
} else {
$p->SetXTickLabelPos($tp['xticklabel']);
}
if (isset($tp['xtick'])) {
$p->SetXTickPos($tp['xtick']);
} else {
$p->SetXTickPos($tp['xticklabel']);
}
示例14: array
<?php
# PHPlot Example - Horizontal linepoints plot with Y Data Label Lines
require_once 'phplot.php';
$data = array(array("SEA\nLEVEL", 0, ''), array('100m', 1, 10), array('200m', 2, 22), array('300m', 3, 30), array('400m', 4, 46), array('500m', 5, 53), array('600m', 6, 65), array('700m', 7, 70), array('800m', 8, 50), array('900m', 9, 35));
$plot = new PHPlot(800, 600);
$plot->SetImageBorderType('plain');
// Improves presentation in the manual
$plot->SetTitle('Wind Speed at Altitude');
$plot->SetDataType('data-data-yx');
$plot->SetDataValues($data);
$plot->SetPlotType('linepoints');
$plot->SetPlotAreaWorld(0, 0, 100, 10);
$plot->SetDrawYDataLabelLines(True);
$plot->SetXTitle('Wind Speed');
$plot->SetYTitle('Altitude');
$plot->SetYTickLabelPos('none');
$plot->SetYTickPos('none');
$plot->SetXDataLabelPos('plotin');
$plot->SetDrawXGrid(False);
$plot->SetDrawYGrid(False);
$plot->DrawGraph();
示例15: array
<?php
# PHPlot Example - Horizontal Stacked Bars
require_once 'phplot.php';
$column_names = array('Beef', 'Fish', 'Pork', 'Chicken', 'Butter', 'Cheese', 'Ice Cream');
// | | | | | | |
$data = array(array('1910', 48.5, 11.2, 38.2, 11.0, 18.4, 3.9, 1.9), array('1930', 33.7, 10.2, 41.1, 11.1, 17.6, 4.7, 9.699999999999999), array('1950', 44.6, 11.9, 43.0, 14.3, 10.9, 7.7, 17.4), array('1970', 79.59999999999999, 11.7, 48.1, 27.4, 5.4, 11.4, 17.8), array('1990', 63.9, 14.9, 46.4, 42.4, 4.0, 24.6, 15.8));
$plot = new PHPlot(800, 500);
$plot->SetImageBorderType('plain');
// Improves presentation in the manual
$plot->SetTitle("U.S. Annual Per-Capita Consumption\n" . "of Selected Meat and Dairy Products");
$plot->SetLegend($column_names);
# Move the legend to the lower right of the plot area:
$plot->SetLegendPixels(700, 300);
$plot->SetDataValues($data);
$plot->SetDataType('text-data-yx');
$plot->SetPlotType('stackedbars');
$plot->SetXTitle('Pounds Consumed Per Capita');
# Show data value labels:
$plot->SetXDataLabelPos('plotstack');
# Rotate data value labels to 90 degrees:
$plot->SetXDataLabelAngle(90);
# Format the data value labels with 1 decimal place:
$plot->SetXDataLabelType('data', 1);
# Specify a whole number for the X tick interval:
$plot->SetXTickIncrement(20);
# Disable the Y tick marks:
$plot->SetYTickPos('none');
$plot->DrawGraph();