本文整理匯總了PHP中Plot::lineWithPoints方法的典型用法代碼示例。如果您正苦於以下問題:PHP Plot::lineWithPoints方法的具體用法?PHP Plot::lineWithPoints怎麽用?PHP Plot::lineWithPoints使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Plot
的用法示例。
在下文中一共展示了Plot::lineWithPoints方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Plot
}
$Query = '
SELECT
YEAR(FROM_UNIXTIME(`time`)) as `y`,
MONTH(FROM_UNIXTIME(`time`)) as `m`,
AVG(`temperature`) as `temp`
FROM `' . PREFIX . 'training`
WHERE
!ISNULL(`temperature`)
GROUP BY `y`, `m`
ORDER BY `y` ASC, `m` ASC';
$Data = DB::getInstance()->query($Query)->fetchAll();
foreach ($Data as $dat) {
$Temperatures[$dat['y']][$dat['m'] - 1] = (int) $dat['temp'];
}
$Plot = new Plot("average", 780, 240);
for ($y = START_YEAR, $n = date('Y'); $y <= $n; $y++) {
if (min($Temperatures[$y]) != null || max($Temperatures[$y]) != null) {
$Plot->Data[] = array('label' => $y, 'data' => $Temperatures[$y]);
}
}
$Plot->setMarginForGrid(5);
$Plot->setXLabels($Months);
$Plot->addYAxis(1, 'left');
$Plot->addYUnit(1, '°C', 1);
$Plot->setYTicks(1, 5, 0);
$Plot->addThreshold('y', 0);
$Plot->addMarkingArea('y', -99, 0);
$Plot->lineWithPoints();
$Plot->smoothing(false);
$Plot->outputJavaScript();