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


PHP Axis::_setAxisPadding方法代码示例

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


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

示例1: setAxisPadding

 /**
  * Set the axis padding for a specified position.
  * 
  * The axis padding is padding "inside" the plotarea (i.e. to put some space
  * between the axis line and the actual plot).
  * 
  * This can be specified in a number of ways:
  * 
  * 1) Specify an associated array with 'left', 'top', 'right' and 'bottom'
  * indices with values for the paddings. Leave out 2nd parameter.
  * 
  * 2) Specify an overall padding as the first parameter
  * 
  * 3) Specify the padding and position with position values as mentioned
  * above
  * 
  * Normally you'd only consider applying axis padding to a category x-axis.
  * 
  * @param mixed $value The value/padding
  * @param mixed $position The "position" of the padding
  */
 function setAxisPadding($value, $position = false)
 {
     if ($position === false) {
         if (is_array($value)) {
             if ($this->_horizontal) {
                 if (isset($value['top']) && $this->_axisX !== null) {
                     $this->_axisX->_setAxisPadding('low', $value['top']);
                 }
                 if (isset($value['bottom']) && $this->_axisX !== null) {
                     $this->_axisX->_setAxisPadding('high', $value['bottom']);
                 }
                 if (isset($value['left']) && $this->_axisY !== null) {
                     $this->_axisY->_setAxisPadding('low', $value['left']);
                 }
                 if (isset($value['right']) && $this->_axisY !== null) {
                     $this->_axisY->_setAxisPadding('high', $value['right']);
                 }
                 if (isset($value['left']) && $this->_axisYSecondary !== null) {
                     $this->_axisYSecondary->_setAxisPadding('low', $value['left']);
                 }
                 if (isset($value['right']) && $this->_axisYSecondary !== null) {
                     $this->_axisYSecondary->_setAxisPadding('high', $value['right']);
                 }
             } else {
                 if (isset($value['left']) && $this->_axisX !== null) {
                     $this->_axisX->_setAxisPadding('low', $value['left']);
                 }
                 if (isset($value['right']) && $this->_axisX !== null) {
                     $this->_axisX->_setAxisPadding('high', $value['right']);
                 }
                 if (isset($value['bottom']) && $this->_axisY !== null) {
                     $this->_axisY->_setAxisPadding('low', $value['bottom']);
                 }
                 if (isset($value['top']) && $this->_axisY !== null) {
                     $this->_axisY->_setAxisPadding('high', $value['top']);
                 }
                 if (isset($value['bottom']) && $this->_axisYSecondary !== null) {
                     $this->_axisYSecondary->_setAxisPadding('low', $value['bottom']);
                 }
                 if (isset($value['top']) && $this->_axisYSecondary !== null) {
                     $this->_axisYSecondary->_setAxisPadding('high', $value['top']);
                 }
             }
         } else {
             if ($this->_axisX !== null) {
                 $this->_axisX->_setAxisPadding('low', $value);
                 $this->_axisX->_setAxisPadding('high', $value);
             }
             if ($this->_axisY !== null) {
                 $this->_axisY->_setAxisPadding('low', $value);
                 $this->_axisY->_setAxisPadding('high', $value);
             }
             if ($this->_axisYSecondary !== null) {
                 $this->_axisYSecondary->_setAxisPadding('low', $value);
                 $this->_axisYSecondary->_setAxisPadding('high', $value);
             }
         }
     } else {
         switch ($position) {
             case 'left':
                 if ($this->_horizontal) {
                     if ($this->_axisY !== null) {
                         $this->_axisY->_setAxisPadding('low', $value);
                     }
                     if ($this->_axisYSecondary !== null) {
                         $this->_axisYSecondary->_setAxisPadding('low', $value);
                     }
                 } else {
                     if ($this->_axisX !== null) {
                         $this->_axisX->_setAxisPadding('low', $value);
                     }
                 }
                 break;
             case 'right':
                 if ($this->_horizontal) {
                     if ($this->_axisY !== null) {
                         $this->_axisY->_setAxisPadding('high', $value);
                     }
                     if ($this->_axisYSecondary !== null) {
//.........这里部分代码省略.........
开发者ID:hbustun,项目名称:agilebill,代码行数:101,代码来源:Plotarea.php


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