当前位置: 首页>>代码示例>>PHP>>正文


PHP Axis::_intersectPoint方法代码示例

本文整理汇总了PHP中Axis::_intersectPoint方法的典型用法代码示例。如果您正苦于以下问题:PHP Axis::_intersectPoint方法的具体用法?PHP Axis::_intersectPoint怎么用?PHP Axis::_intersectPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Axis的用法示例。


在下文中一共展示了Axis::_intersectPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

 /**
  * Update coordinates
  *
  * @access private
  */
 function _updateCoords()
 {
     if (is_array($this->_elements)) {
         $keys = array_keys($this->_elements);
         foreach ($keys as $key) {
             $element =& $this->_elements[$key];
             if (is_a($element, 'Image_Graph_Plot')) {
                 if ((is_a($element, 'Image_Graph_Plot_Bar') || is_a($element, 'Image_Graph_Plot_Step') || is_a($element, 'Image_Graph_Plot_Dot') || is_a($element, 'Image_Graph_Plot_CandleStick') || is_a($element, 'Image_Graph_Plot_BoxWhisker') || is_a($element, 'Image_Graph_Plot_Impulse')) && $this->_axisX != null) {
                     $this->_axisX->_pushValues();
                 }
                 $this->_setExtrema($element);
             }
         }
         unset($keys);
     }
     $this->_calcEdges();
     $pctWidth = (int) ($this->width() * 0.05);
     $pctHeight = (int) ($this->height() * 0.05);
     $left = $this->_left + $this->_padding;
     $top = $this->_top + $this->_padding;
     $right = $this->_right - $this->_padding;
     $bottom = $this->_bottom - $this->_padding;
     // temporary place holder for axis point calculations
     $axisPoints['x'] = array($left, $top, $right, $bottom);
     $axisPoints['y'] = $axisPoints['x'];
     $axisPoints['y2'] = $axisPoints['x'];
     if ($this->_axisX !== null) {
         $intersectX = $this->_axisX->_getAxisIntersection();
         $sizeX = $this->_axisX->_size();
         $this->_axisX->_setCoords($left, $top, $right, $bottom);
         $this->_axisX->_updateCoords();
     }
     if ($this->_axisY !== null) {
         $intersectY = $this->_axisY->_getAxisIntersection();
         $sizeY = $this->_axisY->_size();
         $this->_axisY->_setCoords($left, $top, $right, $bottom);
         $this->_axisY->_updateCoords();
     }
     if ($this->_axisYSecondary !== null) {
         $intersectYsec = $this->_axisYSecondary->_getAxisIntersection();
         $sizeYsec = $this->_axisYSecondary->_size();
         $this->_axisYSecondary->_setCoords($left, $top, $right, $bottom);
         $this->_axisYSecondary->_updateCoords();
     }
     $axisCoordAdd = array('left' => 0, 'right' => 0, 'top' => 0, 'bottom' => 0);
     if ($this->_axisY != null) {
         if ($this->_axisX != null) {
             $pos = $this->_axisX->_intersectPoint($intersectY['value']);
         } else {
             $pos = $this->_horizontal ? $bottom : $left;
         }
         if ($this->_horizontal) {
             if ($pos + $sizeY > $bottom) {
                 $axisCoordAdd['bottom'] = $pos + $sizeY - $bottom;
                 // the y-axis position needs to be recalculated!
             } else {
                 // top & bottom may need to be adjusted when the x-axis has been
                 // calculated!
                 $this->_axisY->_setCoords($left, $pos, $right, $pos + $sizeY);
                 $this->_axisY->_updateCoords();
             }
         } else {
             if ($pos - $sizeY < $left) {
                 $axisCoordAdd['left'] = $left - ($pos - $sizeY);
                 // the y-axis position needs to be recalculated!
             } else {
                 // top & bottom may need to be adjusted when the x-axis has been
                 // calculated!
                 $this->_axisY->_setCoords($pos - $sizeY, $top, $pos, $bottom);
                 $this->_axisY->_updateCoords();
             }
         }
     }
     if ($this->_axisYSecondary != null) {
         if ($this->_axisX != null) {
             $pos = $this->_axisX->_intersectPoint($intersectYsec['value']);
         } else {
             $pos = $this->_horizontal ? $top : $right;
         }
         if ($this->_horizontal) {
             if ($pos - $sizeYsec < $top) {
                 $axisCoordAdd['top'] = $top - ($pos - $sizeYsec);
                 // the secondary y-axis position need to be recalculated
             } else {
                 // top & bottom may need to be adjusted when the x-axis has been
                 // calculated!
                 $this->_axisYSecondary->_setCoords($left, $pos - $sizeY, $right, $pos);
                 $this->_axisYSecondary->_updateCoords();
             }
         } else {
             if ($pos + $sizeYsec > $right) {
                 $axisCoordAdd['right'] = $pos + $sizeYsec - $right;
                 // the secondary y-axis position need to be recalculated
             } else {
                 // top & bottom may need to be adjusted when the x-axis has been
//.........这里部分代码省略.........
开发者ID:hbustun,项目名称:agilebill,代码行数:101,代码来源:Plotarea.php


注:本文中的Axis::_intersectPoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。