當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。