本文整理汇总了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;
}