Source for file Axes.php
Documentation is available at Axes.php
* Description: Accesses list of all TChart Axes. Includes Custom and Depth
* @copyright Copyright (c) 1995-2010 by Steema Software SL. All Rights Reserved. <info@steema.com>
* @link http://www.steema.com
private static $STANDARD_AXES = 5;
private $drawBehind = true;
function __get( $property ) {
$method = "get{$property}";
function __set ( $property,$value ) {
$method = "set{$property}";
return $this->$method($value);
public function Axes($c= null) {
$this->left = new Axis(null, null, $this->chart);
$this->left->getTitle()->setInitialAngle(90);
$this->right = new Axis(false, true, $this->chart);
$this->right->setZPosition(100);
$this->right->getGrid()->setZPosition(100);
$this->right->getTitle()->setInitialAngle(270);
$this->top = new Axis(true, true, $this->chart);
$this->top->setZPosition(100);
$this->top->getGrid()->setZPosition(100);
$this->bottom = new Axis(true, false, $this->chart);
return new Axis(null, null, $chart);
$names[3 + $t] = "Custom " + $t;
} else if ($a == $this->top) {
} else if ($a == $this->right) {
} else if ($a == $this->bottom) {
} else if ($a == $this->depth) {
return $this->custom->indexOf($a) + self::$STANDARD_AXES;
return $this->custom->getAxis($index - self::$STANDARD_AXES);
* Returns the number of axes.
* @return int Number of axes
* Draws axes behind or in front of Series.<br>
* Enables/disables the painting of the Axes before the Series.<br>
* When false, the Axes will appear over the Chart Series.<br>
return $this->drawBehind;
* Draws axes behind the Series when true.
public function doZoom($x0, $y0, $x1, $y1) {
$this->getTop()->calcPosPoint($x0), $this->getTop()->calcPosPoint($x1),
$this->getLeft()->calcPosPoint($y1), $this->getLeft()->calcPosPoint($y0),
return ($a == null) ? new Axis(null, null, $this->chart) : $a;
* Accesses the Custom axes List.
* Calls adjustMaxMin method of all axes and custom axes
$this->left->adjustMaxMin();
$this->top->adjustMaxMin();
$this->right->adjustMaxMin();
$this->bottom->adjustMaxMin();
$this->depth->adjustMaxMin();
$this->custom->getAxis($t)->adjustMaxMin();
$this->left->internalCalcPositions();
$this->top->internalCalcPositions();
$this->right->internalCalcPositions();
$this->bottom->internalCalcPositions();
$this->depth->internalCalcPositions();
$this->depthTop->internalCalcPositions();
$this->custom->getAxis($t)->internalCalcPositions();
* Determines the Labels and formatting attributes of Left Chart side.<br>
* It also controls where Series points will be placed. <br>
* Every TChart class has five Axes: Left, Top, Right, Bottom and z depth.
* Determines the Labels and formatting attributes of Top Chart side.<br>
* It also controls where Series points will be placed.<br>
* Every TChart class has five Axes: Left, Top, Right, Bottom and z depth.
* The Top is pre-defined to be: <br>
public function setTop($value) {
* Determines the Labels and formatting attributes of Right Chart side.<br>
* It also controls where Series points will be placed.<br>
* Every TChart class has five Axes: Left, Top, Right, Bottom and z depth.
* Determines the Labels and formatting attributes of Bottom Chart side.<br>
* It also controls where Series points will be placed.<br>
* Every TChart class has five Axes: Left, Top, Right, Bottom and z depth.
* Accesses characteristics of the Depth Axis, or z axis as it is also
* Every TChart º has five Axes: Left, Top, Right, Bottom and z depth.
if ($this->depth == null) {
* Shows or hides the five Chart Axes at once.<br>
* Each Axis will be drawn depending also on their Visible property.<br>
* Determines whether all five Chart Axes are visible or not.
$this->left->setChart($this->chart);
$this->top->setChart($this->chart);
$this->right->setChart($this->chart);
$this->bottom->setChart($this->chart);
public function draw($g) {
$g= $this->chart->getGraphics3D();
$parent = $this->chart->getParent();
$parent->doBeforeDrawAxes();
$old_name = TChart::$controlName;
if ($this->chart->isAxisVisible($this->left)) {
TChart::$controlName = $old_name . 'Axis_Left_';
if ($this->chart->isAxisVisible($this->right)) {
TChart::$controlName = $old_name . 'Axis_Right_';
$this->right->draw(true);
if ($this->chart->isAxisVisible($this->top)) {
TChart::$controlName = $old_name . 'Axis_Top_';
if ($this->chart->isAxisVisible($this->bottom)) {
TChart::$controlName = $old_name . 'Axis_Bottom_';
$this->bottom->draw(true);
TChart::$controlName = $old_name . 'Axis_Depth_';
$this->depth->draw(true);
TChart::$controlName = $old_name . 'Axis_DepthTop_';
TChart::$controlName = $old_name;
for ($t = 0; $t < sizeof($this->custom); $t++ ) {
$a = $this->custom->getAxis($t);
|