本文整理汇总了PHP中Plot::setTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Plot::setTitle方法的具体用法?PHP Plot::setTitle怎么用?PHP Plot::setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plot
的用法示例。
在下文中一共展示了Plot::setTitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
示例2:
$Plot->setXAxisAsTime();
if (!$All && !$lastHalf && !$lastYear) {
$Plot->setXAxisLimitedTo($Year);
}
$Plot->addYAxis(1, 'left');
$Plot->setYTicks(1, 1);
if (Configuration::Trimp()->showInPercent()) {
$Plot->addYUnit(1, '%');
$Plot->setYLimits(1, 0, 100);
}
$Plot->addYAxis(2, 'right');
$Plot->setYTicks(2, 1, 1);
$Plot->addYAxis(3, 'right');
$Plot->setYLimits(3, 0, $maxTrimp * 2);
$Plot->showAsBars(3, 1, 2);
$Plot->showAsPoints(4);
$Plot->smoothing(false);
if (($lastHalf || $lastYear) && !$DataFailed) {
$Plot->addMarkingArea('x', Plot::dayOfYearToJStime($StartYear, $HighestIndex - 30 - $AddDays + $StartDayInYear + 1), $index, 'rgba(255,255,255,0.3)');
//'rgba(200,200,200,0.5)');
}
$Plot->setGridAboveData();
if ($All) {
$Plot->setTitle(__('Shape for all years'));
} else {
$Plot->setTitle(__('Shape') . ' ' . $Year);
}
if ($DataFailed) {
$Plot->raiseError(__('No data available.'));
}
$Plot->outputJavaScript();
示例3: 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();