コード例 #1
0
ファイル: Pie.php プロジェクト: rrsc/freemed
 /**
  * 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)
 {
     $point = parent::_getMarkerData($point, $nextPoint, $prevPoint, $totals);
     $y = $totals['CURRENT_Y'];
     if ($this->_angleDirection < 0) {
         $y = $totals['ALL_SUM_Y'] - $y;
     }
     $point['ANGLE'] = 360 * (($y + $point['Y'] / 2) / $totals['ALL_SUM_Y']) + $this->_startingAngle;
     $totals['CURRENT_Y'] += $point['Y'];
     $point['ANG_X'] = cos(deg2rad($point['ANGLE']));
     $point['ANG_Y'] = sin(deg2rad($point['ANGLE']));
     $point['AX'] = -10 * $point['ANG_X'];
     $point['AY'] = -10 * $point['ANG_Y'];
     if (isset($totals['ALL_SUM_Y']) && $totals['ALL_SUM_Y'] != 0) {
         $point['PCT_MIN_Y'] = $point['PCT_MAX_Y'] = 100 * $point['Y'] / $totals['ALL_SUM_Y'];
     }
     $point['LENGTH'] = 10;
     //$radius;
     $x = $point['X'];
     $explodeRadius = 0;
     if (is_array($this->_explode) && isset($this->_explode[$x])) {
         $explodeRadius = $this->_explode[$x];
     } elseif (is_numeric($this->_explode)) {
         $explodeRadius = $this->_explode;
     }
     $point['MARKER_X'] = $totals['CENTER_X'] + ($totals['RADIUS'] + $explodeRadius) * $point['ANG_X'];
     $point['MARKER_Y'] = $totals['CENTER_Y'] + ($totals['RADIUS'] + $explodeRadius) * $point['ANG_Y'];
     return $point;
 }
コード例 #2
0
ファイル: Odo.php プロジェクト: villos/tree_admin
 /**
  * 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)
 {
     $point = parent::_getMarkerData($point, $nextPoint, $prevPoint, $totals);
     $point['ANGLE'] = $this->_value2angle($point['Y']);
     $point['ANG_X'] = cos(deg2rad($point['ANGLE']));
     $point['ANG_Y'] = sin(deg2rad($point['ANGLE']));
     $point['AX'] = -$point['ANG_X'];
     $point['AY'] = -$point['ANG_Y'];
     $point['LENGTH'] = 2.5;
     //$radius;
     $point['MARKER_X'] = $totals['CENTER_X'] + $totals['ODO_RADIUS'] * $point['ANG_X'];
     $point['MARKER_Y'] = $totals['CENTER_Y'] + $totals['ODO_RADIUS'] * $point['ANG_Y'];
     return $point;
 }