本文整理匯總了PHP中Dataset::_averageY方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dataset::_averageY方法的具體用法?PHP Dataset::_averageY怎麽用?PHP Dataset::_averageY使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Dataset
的用法示例。
在下文中一共展示了Dataset::_averageY方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: elseif
/**
* Calculate marker point data
* @param Array Point The point to calculate data for
* @param Array NextPoint The next point
* @param Array PrevPoint The previous point
* @param Array Totals The pre-calculated totals, if needed
* @return Array An array containing marker point data
* @access private
*/
function _getMarkerData($point, $nextPoint, $prevPoint, & $totals)
{
if (!$prevPoint) {
$point['AX'] = -5;
$point['AY'] = 5;
$point['PPX'] = 0;
$point['PPY'] = 0;
$point['NPX'] = $nextPoint['X'];
$point['NPY'] = $nextPoint['Y'];
}
elseif (!$nextPoint) {
$point['AX'] = 5;
$point['AY'] = 5;
$point['PPX'] = $prevPoint['X'];
$point['PPY'] = $prevPoint['Y'];
$point['NPX'] = 0;
$point['NPY'] = 0;
} else {
$point['AX'] = $this->_parent->_pointY($prevPoint) - $this->_parent->_pointY($nextPoint);
$point['AY'] = $this->_parent->_pointX($nextPoint) - $this->_parent->_pointX($prevPoint);
$point['PPX'] = $prevPoint['X'];
$point['PPY'] = $prevPoint['Y'];
$point['NPX'] = $nextPoint['X'];
$point['NPY'] = $nextPoint['Y'];
}
$point['APX'] = $point['X'];
$point['APY'] = $point['Y'];
$point['LENGTH'] = sqrt($point['AX'] * $point['AX'] + $point['AY'] * $point['AY']);
if ((isset($point['LENGTH'])) and ($point['LENGTH'] != 0)) {
$point['ANGLE'] = asin($point['AY'] / $point['LENGTH']);
}
if ((isset($point['AX'])) and ($point['AX'] > 0)) {
$point['ANGLE'] = pi() - $point['ANGLE'];
}
if ($this->_dataset->minimumX() != 0) {
$point['PCT_MIN_X'] = 100 * $point['X'] / $this->_dataset->minimumX();
}
if ($this->_dataset->maximumX() != 0) {
$point['PCT_MAX_X'] = 100 * $point['X'] / $this->_dataset->maximumX();
}
if ($this->_dataset->minimumY() != 0) {
$point['PCT_MIN_Y'] = 100 * $point['Y'] / $this->_dataset->minimumY();
}
if ($this->_dataset->maximumY() != 0) {
$point['PCT_MAX_Y'] = 100 * $point['Y'] / $this->_dataset->maximumY();
}
$point['AVERAGE_Y'] = $this->_dataset->_averageY();
$point['MARKER_X'] = $this->_parent->_pointX($point);
$point['MARKER_Y'] = $this->_parent->_pointY($point);
return $point;
}