Source for file Bar.php
Documentation is available at Bar.php
* Description: The Bar Series component outputs all points as vertical
* @copyright Copyright (c) 1995-2008 by Steema Software SL. All Rights Reserved. <info@steema.com>
* @link http://www.steema.com
function __get( $property ) {
$method = "get{$property}";
function __set ( $property,$value ) {
$method = "set{$property}";
return $this->$method($value);
public function Bar($c = null)
* Determines the percent of total Bar width used.<br>
* Setting BarWidthPercent = 100 makes joined Bars.<br>
* You can control how many Bars appear at the same time by using
* Page.MaxPointsPerPage.<br>
* Sets the percent of total Bar width used.<br>
* @see #getBarWidthPercent
return $this->chart->getGraphics3D()->getFontHeight();
if(($point->x >= $tmpX) && ($point->x <= ($tmpX + $this->iBarSize)))
$tmpResult = GraphicsGD::pointInTriangle($point, $tmpX,
$tmpResult = GraphicsGD::pointInTriangle($point, $tmpX,
$tmpResult = GraphicsGD::pointInEllipse($point,
$tmpResult = ($point->y >= $tmpY) && ($point->y <= $endY);
parent::calcHorizMargins($margins);
parent::calcVerticalMargins($margins);
* Called internally. Draws the "ValueIndex" point of the Series.
parent::drawValue($valueIndex);
$tmpColor = new Color(0, 0, 0, 0, true);
$r->width = $this->calcXPos($valueIndex + 1) - $r->x;
if(!$this->getPen()->getVisible())
if($r->getBottom() > $r->y)
if($r->getBottom() > $r->y)
$this->drawBar($valueIndex, $r->y, $r->getBottom());
$this->drawBar($valueIndex, $r->getBottom(), $r->y);
public function drawBar($barIndex, $startPos, $endPos)
$g = $this->chart->getGraphics3D();
if($this->chart->getAspect()->getView3D())
$g->cube($r->x, $startPos, $r->getRight(), $endPos, $this->getStartZ(),
$g->pyramid(true, $r->x, $startPos, $r->getRight(), $endPos, $this->getStartZ(),
$g->pyramid(true, $r->x, $endPos, $r->getRight(), $startPos, $this->getStartZ(),
$g->arrow(true, new TeePoint($tmpMidX, $endPos),
$g->arrow(true, new TeePoint($tmpMidX, $startPos),
if($tmp == BarStyle::$RECTGRADIENT)
$g->cube($r->x, $startPos, $r->getRight(), $endPos, $this->getStartZ(),
if($g->getSupportsFullRotation() ||
$this->chart->getAspect()->getOrthogonal())
$this->doGradient3D($barIndex,
$g->calc3DPoint($r->x, $startPos, $this->getStartZ()),
$g->calc3DPoint($r->getRight(), $endPos, $this->getStartZ()));
$p = array(new TeePoint($r->x, $endPos),
$p = array(new TeePoint($r->x, $startPos),
new TeePoint($r->getRight(), $startPos));
$g->arrow(true, new TeePoint($tmpMidX, $endPos),
$g->arrow(true, new TeePoint($tmpMidX, $startPos),
if($tmp == BarStyle::$RECTGRADIENT)
$this->doBarGradient($barIndex,
new Rectangle($r->x, $startPos, $r->getRight() - $r->x,
* The Screen X pixel coordinate of the ValueIndex Series
* The horizontal Bar position is the "real" X pos + the BarWidth by our
$result = parent::calcXPos($valueIndex);
$result += MathUtils::round($this->iBarSize *
* The Screen Y pixel coordinate of the ValueIndex Series value.
$result = parent::calcYPos($valueIndex);
$tmpValue = $this->vyValues->value[$valueIndex] +
$result = ($tmp != 0) ? $this->calcYPosValue($tmpValue * 100.0 / $tmp) : 0;
protected function drawMark($valueIndex, $s, $p)
$tmpDistance = $this->getMarks()->getCallout()->getDistance();
$difH = $this->getMarks()->getCallout()->getLength() + $tmpDistance;
if($p->arrowFrom->getY() > $this->getOriginPos($valueIndex))
$difH = - $difH - $p->height;
$p->arrowFrom->setY($p->arrowFrom->getY() + $tmpDistance);
$p->arrowFrom->setY($p->arrowFrom->getY() - $tmpDistance);
$p->leftTop->setX($p->leftTop->getX() + $difW);
$p->leftTop->setY($p->leftTop->getY() - $difH);
$p->arrowTo->setX($p->arrowTo->getX() + $difW);
$p->arrowTo->setY($p->arrowTo->getY() - $difH);
$p->arrowFrom->setX($p->arrowFrom->getX() + $difW);
parent::drawMark($valueIndex, $s, $p);
* The corresponding screen pixels coordinate of the leftmost
* The Maximum Value of the Series X Values List.
* The Minimum Value of the Series X Values List.
return $this->getChart()->getSeriesIndexOf($this);
return parent::getMinXValue();
* The Maximum Value of the Series Y Values List.
* The Minimum Value of the Series Y Values List.
|