本文整理汇总了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) {
//.........这里部分代码省略.........