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


PHP Axis::_point方法代码示例

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


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

示例1:

 /**
  * Get the point from the x-axis
  * @param array $value The value array
  * @param int $min The minimum pixel position possible
  * @param int $max The maximum pixel position possible
  * @return int The pixel position from the axis
  * @access private
  */
 function _axisPointY($value, $min, $max)
 {
     if (!isset($value['Y'])) {
         return false;
     }
     if ($value['Y'] === '#min_pos#' || $value['Y'] === '#max_nex#') {
         // return the minimum (bottom) position or if negative then zero
         // or the maxmum (top) position or if positive then zero
         if (isset($value['AXIS_Y']) && $value['AXIS_Y'] == IMAGE_GRAPH_AXIS_Y_SECONDARY && $this->_axisYSecondary !== null) {
             $axisY =& $this->_axisYSecondary;
         } else {
             $axisY =& $this->_axisY;
         }
         if ($value['Y'] === '#min_pos#') {
             return $axisY->_point(max(0, $axisY->_getMinimum()));
         } else {
             return $axisY->_point(min(0, $axisY->_getMaximum()));
         }
     }
     if ($value['Y'] === '#min#') {
         return $min;
     }
     if ($value['Y'] === '#max#') {
         return $max;
     }
     if (isset($value['AXIS_Y']) && $value['AXIS_Y'] == IMAGE_GRAPH_AXIS_Y_SECONDARY) {
         if ($this->_axisYSecondary !== null) {
             return $this->_axisYSecondary->_point($value['Y']);
         }
     } else {
         if ($this->_axisY !== null) {
             return $this->_axisY->_point($value['Y']);
         }
     }
     return false;
 }
开发者ID:hbustun,项目名称:agilebill,代码行数:44,代码来源:Plotarea.php

示例2: situation

    /**
     * Update coordinates
     * @access private
     */
    function _updateCoords()
    {
        $this->_debug("Calculating and setting edges");
        $this->_calcEdges();

        $pctWidth = (int) ($this->width() * 0.05);
        $pctHeight = (int) ($this->height() * 0.05);
       
        $this->_debug("Adjusting axis");
        if (($this->_axisX != null) and ($this->_axisY != null)) {
            if (($this->_axisX->_minimum >= 0) and ($this->_axisY->_minimum >= 0)) {
                $this->_debug("Fairly standard situation (MinX>= 0, MinY>= 0), starting X axis");
                $this->_axisX->_setCoords(
                    $this->_left + $this->_axisY->_size() + $this->_padding, 
                    $this->_bottom - $this->_axisX->_size() - $this->_padding, 
                    $this->_right - $this->_padding, 
                    $this->_bottom - $this->_padding
                );                   
                $this->_debug("Done x axis, starting y axis");
                $this->_axisY->_setCoords(
                    $this->_left + $this->_padding, 
                    $this->_top + $this->_padding, 
                    $this->_left + $this->_axisY->_size() + $this->_padding, 
                    $this->_bottom - $this->_axisX->_size() - $this->_padding);
                $this->_debug("Done y axis");
            }
            elseif ($this->_axisX->_minimum >= 0) {
                $this->_axisY->_setCoords(
                    $this->_left, 
                    $this->_top, 
                    $this->_left + $this->_axisY->_size(), 
                    $this->_bottom
                );
                $this->_axisX->_setCoords(
                    $this->_axisY->_right, 
                    $this->_axisY->_point(0), 
                    $this->_right, 
                    $this->_axisY->_point(0) + $this->_axisX->_size()
                );
            }
            elseif ($this->_axisY->_minimum >= 0) {
                $this->_axisX->_setCoords(
                    $this->_left, 
                    $this->_bottom - $this->_axisX->_size(), 
                    $this->_right, 
                    $this->_bottom
                );
                $this->_axisY->_setCoords(
                    $this->_axisX->_point(0) - $this->_axisY->_size(), 
                    $this->_top, 
                    $this->_axisX->_point(0), 
                    $this->_axisX->_top
                );
            } else {
                $this->_axisY->_setCoords(
                    $this->_left + $this->_padding, 
                    $this->_top + $this->_padding, 
                    $this->_right - $this->_padding, 
                    $this->_bottom - $this->_padding
                );
                $this->_axisX->_setCoords(
                    $this->_left + $this->_padding, 
                    $this->_axisY->_point(0), 
                    $this->_right - $this->_padding, 
                    $this->_axisY->_point(0) + $this->_axisX->_size()
                );
                $this->_axisY->_setCoords(
                    $this->_axisX->_point(0) - $this->_axisY->_size(), 
                    $this->_top + $this->_padding, 
                    $this->_axisX->_point(0), 
                    $this->_bottom - $this->_padding);
            }

            //$this->_axisX->shrink($indent, $indent, $indent, $indent);
            //$this->_axisY->shrink($indent, $indent, $indent, $indent);

            $this->_plotLeft = $this->_axisX->_left;
            $this->_plotTop = $this->_axisY->_top;
            $this->_plotRight = $this->_axisX->_right;
            $this->_plotBottom = $this->_axisY->_bottom;
        } else {
            $this->_plotLeft = $this->_left;
            $this->_plotTop = $this->_top;
            $this->_plotRight = $this->_right;
            $this->_plotBottom = $this->_bottom;
        }

        $this->_debug("Updating child elements");
        Image_Graph_Element::_updateCoords();
    }
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:94,代码来源:Plotarea.php


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