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


PHP PHPlot::SetXDataLabelType方法代码示例

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


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

示例1: marks

$plot->SetImageBorderType('plain');
// For presentation in the manual
$plot->SetTitle('Hourly Data Example Plot');
$plot->SetDataType('data-data');
$plot->SetDataValues($data);
$plot->SetPlotType('lines');
# Make the X tick marks (and therefore X grid lines) 24 hours apart:
$plot->SetXTickIncrement(60 * 60 * 24);
$plot->SetDrawXGrid(True);
# Anchor the X tick marks at midnight. This makes the X grid lines act as
# separators between days of the week, regardless of the starting hour.
# (Except this messes up around daylight saving time changes.)
$plot->SetXTickAnchor($tick_anchor);
# We want both X axis data labels and X tick labels displayed. They will
# be positioned in a way that prevents them from overwriting.
$plot->SetXDataLabelPos('plotdown');
$plot->SetXTickLabelPos('plotdown');
# Increase the left and right margins to leave room for weekday labels.
$plot->SetMarginsPixels(50, 50);
# Tick labels will be formatted as date/times, showing the date:
$plot->SetXLabelType('time', '%Y-%m-%d');
# ... but then we must reset the data label formatting to no formatting.
$plot->SetXDataLabelType('');
# Show tick labels (with dates) at 90 degrees, to fit between the data labels.
$plot->SetXLabelAngle(90);
# ... but then we must reset the data labels to 0 degrees.
$plot->SetXDataLabelAngle(0);
# Force the Y range to 0:100.
$plot->SetPlotAreaWorld(NULL, 0, NULL, 100);
# Now draw the graph:
$plot->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:ex-xtickanchor.php

示例2: 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();
开发者ID:jcmwc,项目名称:fleet,代码行数:29,代码来源:test.php

示例3: PHPlot

            $result .= ",{$col}";
        }
    }
    return "{$result}[{$passthru}]";
}
$plot = new PHPlot(800, 600);
$plot->SetDataType($data_type);
$plot->SetDataValues(make_data_array($plot_type, $data_type, $nx, $ny, $max));
$plot->SetPlotType($plot_type);
$plot->SetTitle($title);
$plot->SetXTitle('X Axis Title Here');
$plot->SetYTitle('Y Axis Title Here');
# Use the same custom formatting function for both label types:
#   Vertical plots:   X axis data labels, Y data value labels
#   Horizontal plots: X data value labels, Y axis data labels
$plot->SetXDataLabelType('custom', 'fmtdl', 'X');
$plot->SetYDataLabelType('custom', 'fmtdl', 'Y');
# Turn off ticks on independent axis, and turn on data value labels. This
# depends on the plot type and data type (horizontal or vertical):
$label_pos = $plot_type == 'stackedbars' ? 'plotstack' : 'plotin';
if ($data_type == 'text-data-yx' || $data_type == 'data-data-yx') {
    // Horizontal plot: configure X data value labels
    $plot->SetYTickPos('none');
    $plot->SetXDataLabelPos($label_pos);
    $plot->SetPlotAreaWorld(0, 0, NULL, $nx);
    $plot->SetXTickIncrement(1);
} else {
    // Vertical plot: configure Y data value labels
    $plot->SetXTickPos('none');
    $plot->SetYDataLabelPos($label_pos);
    $plot->SetPlotAreaWorld(0, 0, $nx, NULL);
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:dlexformat.php

示例4:

$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']);
}
$plot->DrawGraph();
// Plot #2:
$plot->SetPlotAreaPixels(NULL, 345, NULL, 570);
if (isset($fmt[2]['x'])) {
    $plot->SetXLabelType('printf', $fmt[2]['x']);
}
if (isset($fmt[2]['y'])) {
    $plot->SetYLabelType('printf', $fmt[2]['y']);
}
if (isset($fmt[2]['xd'])) {
    $plot->SetXDataLabelType('printf', $fmt[2]['xd']);
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:multidefault-labelfmt1.php

示例5: elseif

    $data = $data1;
} elseif ($tp['datasign'] < 0) {
    $data = $data2;
} else {
    $data = array_merge($data1, $data2);
}
$p = new PHPlot(800, 800);
$p->SetTitle($tp['title'] . $tp['suffix']);
$p->SetXTitle('This is the X Axis Title');
$p->SetYTitle('This is the Y Axis Title');
$p->SetDataValues($data);
$p->SetDataType('text-data-yx');
$p->SetPlotType('bars');
$p->SetXDataLabelPos('plotin');
if (isset($tp['shade'])) {
    $p->SetShading($tp['shade']);
}
if ($tp['ttf']) {
    $p->SetFontTTF('x_label', $phplot_test_ttfdir . $phplot_test_ttfonts['sans'], 10);
}
if ($tp['yaxis0']) {
    $p->SetYAxisPosition(0);
}
if (isset($tp['labelangle'])) {
    $p->SetXDataLabelAngle($tp['labelangle']);
}
if ($tp['labelformat']) {
    $p->SetXDataLabelType('data', 1, '', '%');
}
$p->SetYTickPos('none');
$p->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:horzbar-label.php

示例6:

# Use this TrueType font and make labels bigger:
$p->SetDefaultTTFont($phplot_test_ttfdir . $phplot_test_ttfonts['sans']);
$p->SetFont('x_label', '', 10);
$p->SetFont('y_label', '', 10);
# Options: X
if (isset($tp['x_angle'])) {
    $p->SetXLabelAngle($tp['x_angle']);
}
if (isset($tp['xd_angle'])) {
    $p->SetXDataLabelAngle($tp['xd_angle']);
}
if (isset($tp['x_type'])) {
    $p->SetXLabelType($tp['x_type'], $tp['x_type_arg']);
}
if (isset($tp['xd_type'])) {
    $p->SetXDataLabelType($tp['xd_type'], $tp['xd_type_arg']);
}
if (isset($tp['xt_pos'])) {
    $p->SetXTickLabelPos($tp['xt_pos']);
}
if (isset($tp['xd_pos'])) {
    $p->SetXDataLabelPos($tp['xd_pos']);
}
# Options: Y
if (isset($tp['y_angle'])) {
    $p->SetYLabelAngle($tp['y_angle']);
}
if (isset($tp['yd_angle'])) {
    $p->SetYDataLabelAngle($tp['yd_angle']);
}
if (isset($tp['y_type'])) {
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:labelvars.php


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