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


PHP Plot::setYAxisTimeFormat方法代码示例

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


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

示例1: foreach

				`typeid`="' . Configuration::General()->competitionType() . '"
				AND `distance`="' . $distance . '"
			ORDER BY
				`time` ASC')->fetchAll();
        Cache::set('prognosePlotDistanceData' . $distance, $ResultsData, '600');
    }
    foreach ($ResultsData as $dat) {
        if (!isset($WKplugin) || !$WKplugin->isFunCompetition($dat['id'])) {
            $Results[$dat['time'] . '000'] = $dat['s'] * 1000;
        }
    }
} else {
    $DataFailed = true;
}
$Plot = new Plot("formverlauf_" . str_replace('.', '_', $distance), 800, 450);
$Plot->Data[] = array('label' => __('Prognosis'), 'color' => '#880000', 'data' => $Prognosis, 'lines' => array('show' => true), 'points' => array('show' => false));
$Plot->Data[] = array('label' => __('Result'), 'color' => '#000000', 'data' => $Results, 'lines' => array('show' => false), 'points' => array('show' => true), 'curvedLines' => array('apply' => false));
$Plot->setZeroPointsToNull();
$Plot->setMarginForGrid(5);
$Plot->setXAxisAsTime();
$Plot->addYAxis(1, 'left');
if (!empty($Prognosis) && max($Prognosis) > 1000 * 3600) {
    $Plot->setYAxisTimeFormat('%H:%M:%S');
} else {
    $Plot->setYAxisTimeFormat('%M:%S');
}
$Plot->setTitle(__('Prognosis trend') . ' ' . Distance::format($distance));
if ($DataFailed || empty($Data)) {
    $Plot->raiseError(__('No data available.'));
}
$Plot->outputJavaScript();
开发者ID:guancio,项目名称:Runalyze,代码行数:31,代码来源:Plot.Form.php

示例2: foreach

$timeFormat = '%M:%S';
$competitions = $this->RaceContainer->races($distance);
//$competitions = DB::getInstance()->query('SELECT id,time,s FROM `'.PREFIX.'training` WHERE `typeid`='.Configuration::General()->competitionType().' AND `distance`="'.$distance.'" ORDER BY `time` ASC')->fetchAll();
if (!empty($competitions)) {
    foreach ($competitions as $competition) {
        if (!$this->isFunCompetition($competition['id'])) {
            $Dates[] = $competition['time'];
            $Results[$competition['time'] . '000'] = $competition['s'] * 1000;
            // Attention: timestamp(0) => 1:00:00
        }
    }
    if (!empty($Results) && max($Results) > 3600 * 1000) {
        $timeFormat = '%H:%M:%S';
    }
}
$Plot = new Plot("bestzeit" . $distance * 1000, 480, 190);
$Plot->Data[] = array('label' => $label, 'data' => $Results);
//$Plot->Data[] = array('label' => $trend, 'data' => $Results, 'color' => '#C61D17', 'lines' => array('show' => true), 'curvedLines' => array('apply' => true, 'fit' => true));
//$Plot->Data[] = array('label' => $label, 'data' => $Results, 'color' => '#C61D17', 'points' => array('show' => true), 'curvedLines' => array('apply' => false));
$Plot->setMarginForGrid(5);
$Plot->setXAxisAsTime();
if (count($Results) == 1) {
    $Plot->setXAxisTimeFormat('%d.%m.%y');
}
$Plot->addYAxis(1, 'left');
$Plot->setYAxisAsTime(1);
$Plot->setYAxisTimeFormat($timeFormat, 1);
$Plot->smoothing(false);
$Plot->lineWithPoints();
$Plot->setTitle($titleCenter);
$Plot->outputJavaScript();
开发者ID:n0rthface,项目名称:Runalyze,代码行数:31,代码来源:Plot.Bestzeit.php


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