本文整理汇总了PHP中Plot::addMarkingArea方法的典型用法代码示例。如果您正苦于以下问题:PHP Plot::addMarkingArea方法的具体用法?PHP Plot::addMarkingArea怎么用?PHP Plot::addMarkingArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plot
的用法示例。
在下文中一共展示了Plot::addMarkingArea方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Plot
$Query = '
SELECT
time*1000 as time,
DAYOFYEAR(FROM_UNIXTIME(`time`)) as `d`,
AVG(`temperature`) as `temp`
FROM `' . PREFIX . 'training`
WHERE
!ISNULL(`temperature`) AND
`time` BETWEEN UNIX_TIMESTAMP(\'' . (int) $Year . '-01-01\') AND UNIX_TIMESTAMP(\'' . ((int) $Year + 1) . '-01-01\')-1
GROUP BY `d`
ORDER BY `d` ASC';
$Data = DB::getInstance()->query($Query)->fetchAll();
foreach ($Data as $dat) {
$Temperatures[$dat['time']] = $Temperature->format((int) $dat['temp'], false);
}
$Plot = new Plot("year" . $Year, 780, 240);
$Plot->Data[] = array('label' => __('Temperatures') . ' ' . $Year, 'data' => $Temperatures);
$Plot->setMarginForGrid(5);
$Plot->setXAxisAsTime();
$Plot->setXAxisLimitedTo($Year);
$Plot->addYAxis(1, 'left');
$Plot->addYUnit(1, $Temperature->unit(), 0);
$Plot->setYTicks(1, 5, 0);
$Plot->addThreshold('y', 0);
$Plot->addMarkingArea('y', -99, 0);
$Plot->showPoints(2);
$Plot->smoothing(false);
if (empty($Data)) {
$Plot->raiseError(__('No data available.'));
}
$Plot->outputJavaScript();
示例2: array
if ($Plugin->Configuration()->value('use_weight')) {
$Plot->Data[] = array('label' => __('Weight'), 'color' => '#008', 'data' => $Weights);
}
if ($Plugin->Configuration()->value('use_pulse')) {
$Plot->Data[] = array('label' => __('Resting HR'), 'color' => '#800', 'data' => $HRrests, 'yaxis' => 2);
}
$Plot->setMarginForGrid(5);
$Plot->setXLabels($Labels);
$Plot->setXAxisTimeFormat('%m/%y');
$Plot->setXAxisMaxToToday();
$Plot->Options['xaxis']['labelWidth'] = 50;
//$Plot->Options['xaxis']['tickLength'] = 3;
$Plot->Options['series']['curvedLines']['fit'] = true;
$Plot->addYAxis(1, 'left');
$Plot->addYUnit(1, 'kg', 1);
$Plot->setYTicks(1, 2, 0);
$Plot->addYAxis(2, 'right', false);
$Plot->addYUnit(2, 'bpm', 0);
$Plot->setYTicks(2, 1, 0);
if ($Wunschgewicht > 1) {
$Plot->addThreshold('y1', $Wunschgewicht);
$Plot->addMarkingArea('y1', $Wunschgewicht, 0);
}
if (empty($Data)) {
$Plot->raiseError(__('No data available.'));
} elseif (min(min($Weights), min($HRrests)) == 0 || count($Weights) <= 1) {
$Plot->setZeroPointsToNull();
$Plot->lineWithPoints();
$Plot->Options['series']['curvedLines']['apply'] = false;
}
$Plot->outputJavaScript(true);
示例3:
$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();
示例4: time
$Plot->setYTicks(1, 1);
if ($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);
if ($perfmodel == 'banister') {
$Plot->showAsBars(4, 1, 2);
$Plot->showAsPoints(5);
} else {
$Plot->showAsBars(3, 1, 2);
$Plot->showAsPoints(4);
}
$Plot->smoothing(false);
if (($lastHalf || $lastYear) && !$DataFailed) {
$Plot->addMarkingArea('x', time() . '000', $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();