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


PHP PHPlot::SetXTimeFormat方法代码示例

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


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

示例1: PHPlot

include "./data_date2.php";
include "../phplot.php";
$graph = new PHPlot(600, 400);
$graph->SetPrintImage(0);
//Don't draw the image yet
$graph->SetDataType("data-data-error");
//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
开发者ID:vojtajina,项目名称:sitellite,代码行数:31,代码来源:example8.php

示例2: 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

示例3: PHPlot

    $prevDOfMonth = $DayOfMonth;
}
if ($debug) {
    print_r($allDays);
}
if ($debug) {
    print "I" . $maxValue . "I";
}
include "../include/phplot/phplot.php";
$graph = new PHPlot(600, 300);
$graph->SetDataType("text-data");
$graph->SetDataValues($allDays);
$graph->SetYTickIncrement();
$graph->y_tick_increment = ceil(@$graph->y_tick_increment);
$graph->SetXLabelType("time");
$graph->SetXTimeFormat("%b %d");
if ($incoming == '2') {
    $graph->SetLegend(array("Outgoing"));
    $graph->SetDataColors(array('green'));
} elseif ($incoming == '3') {
    $graph->SetLegend(array("Incoming"));
    $graph->SetDataColors(array('orange'));
} else {
    $graph->SetLegend(array("All", "Outgoing", "Incoming"));
}
$graph->SetYTitle("Quantity of calls");
$graph->SetPlotType("bars");
$graph->SetXLabelAngle(90);
// Turn off X tick labels and ticks because they don't apply here:
$graph->SetXTickLabelPos('none');
$graph->SetXTickPos('none');
开发者ID:BackupTheBerlios,项目名称:atslog-svn,代码行数:31,代码来源:diagram_bars.php

示例4: mktime

<?php

# $Id$
# Testing phplot - Date X axis labels, with data-data
require_once 'phplot.php';
#                   H  M  S  m  d   y
$base_time = mktime(0, 0, 12, 6, 30, 2001);
$one_day = 60 * 60 * 24;
$data = array(array(0, 0, 2), array(0, 0, 4), array(0, 0, 2), array(0, 0, 4), array(0, 0, 2), array(0, 0, 4));
# Store time values as both label and X value:
for ($i = 0; $i < 6; $i++) {
    $data[$i][0] = $data[$i][1] = $base_time + $i * $one_day;
}
$p = new PHPlot(600, 400);
$p->SetTitle('lines, date-data with date X labels');
$p->SetDataType('data-data');
$p->SetDataValues($data);
$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('%Y-%m-%d');
# Turn off X tick labels, use our data labels only:
$p->SetXTickLabelPos('none');
# Then we have to turn off the ticks too, because they aren't placed right:
$p->SetXTickPos('none');
$p->SetDrawXGrid(True);
$p->SetPlotType('lines');
$p->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:date2.php

示例5: mktime

<?php

# $Id$
# Testing phplot - Date X axis labels
require_once 'phplot.php';
#                   H  M  S  m  d   y
$base_time = mktime(0, 0, 0, 6, 30, 2001);
$one_day = 60 * 60 * 24;
$data = array(array(0, 2), array(0, 4), array(0, 6), array(0, 8), array(0, 7), array(0, 5));
for ($i = 0; $i < 6; $i++) {
    $data[$i][0] = $base_time + $i * $one_day;
}
$p = new PHPlot(600, 400);
$p->SetTitle('bars, text-data with date X labels');
$p->SetDataType('text-data');
$p->SetDataValues($data);
$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('%d %b');
# Turn off X tick labels, use our data labels only:
$p->SetXTickLabelPos('none');
# Then we have to turn off the ticks too, because they aren't placed right:
$p->SetXTickPos('none');
$p->SetDrawXGrid(True);
$p->SetPlotType('bars');
$p->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:30,代码来源:date1.php

示例6: mktime

$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);
$p->SetPlotType('lines');
$p->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:date3.php


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