Source for file HorizBar.php
Documentation is available at HorizBar.php
* Description: Horizontal Bar Series
* @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);
// TODO $tmpGradientDirection = new GradientDirection();
// TODO $this->getGradient()->setDirection($tmpGradientDirection->HORIZONTAL);
return Language::getString("GalleryHorizBar");
* Defines the percent of bar Height, from 0 to 100.<br>
* Defines the percent of bar Height, from 0 to 100.<br>
return $this->getMarks()->textWidth($valueIndex);
private function otherClicked($p, $tmpX, $endX, $tmpY) {
return GraphicsGD::pointInEllipse($p, new Rectangle($tmpX, $tmpY, $endX,
return ($p->x >= $tmpX) && ($p->x <= $endX);
private function inTriangle($x1, $x2, $tmpY, $p) {
//$this->Point[] $this->triP = new TeePoint[3];
$g = $this->chart->getGraphics3D();
if ($this->chart->getAspect()->getView3D()) {
$this->triP[0] = $g->calc3DPoint($x1, $tmpY, $this->getStartZ());
$this->triP[1] = $g->calc3DPoint($x2, $tmpY + ($this->iBarSize / 2), $this->getMiddleZ());
if ((!$this->chart->getAspect()->getView3D()) &&
(($point->y < $tmpY) || ($point->y > ($tmpY + $this->iBarSize)))) {
if ($tmpStyle == BarStyle::$INVPYRAMID) {
return $this->inTriangle($endX, $tmpX, $tmpY, $point);
return $this->inTriangle($tmpX, $endX, $tmpY, $point);
if ($this->chart->getAspect()->getView3D()) {
$p = $this->chart->getGraphics3D()->calculate2DPosition($x, $y,
if (($point->y >= $tmpY) && ($point->y <= ($tmpY + $this->iBarSize))) {
return $this->otherClicked($point, $tmpX, $endX, $tmpY);
return $this->otherClicked($point, $tmpX, $endX, $tmpY);
parent::calcHorizMargins($margins);
parent::calcVerticalMargins($margins);
* Called internally. Draws the "ValueIndex" point of the Series.
parent::drawValue($valueIndex);
$r->height = $this->calcYPos($valueIndex - 1) - $r->y;
$r->height = $this->iBarSize + 1; // 5.02
$r->width = $this->calcXPos($valueIndex) - $r->x;
if (!$this->getPen()->getVisible()) {
if ($r->getRight() > $r->x) {
if ($r->getRight() > $r->x) {
$this->drawBar($valueIndex, $r->x, $r->getRight());
$this->drawBar($valueIndex, $r->getRight(), $r->x);
protected function drawMark($valueIndex, $s, $position) {
$difW = $this->getMarks()->getCallout()->getLength() +
$this->getMarks()->getCallout()->getDistance();
$tmp = ($position->arrowFrom->getX() < $this->getOriginPos($valueIndex));
$difW = - $difW - $position->width;
$position->leftTop->setX($position->leftTop->getX() + $difW + ($position->width / 2));
$position->leftTop->setY($position->leftTop->getY() + $difH + ($position->height / 2));
$position->arrowTo->setX($position->arrowTo->getX() + $difW);
$position->arrowTo->setY($position->arrowTo->getY() + $difH);
$position->arrowFrom->setY($position->arrowFrom->getY() + $difH);
$position->arrowFrom->setX($position->arrowFrom->getX() - $this->getMarks()->getCallout()->getDistance());
$position->arrowFrom->setX($position->arrowFrom->getX() + $this->getMarks()->getCallout()->getDistance());
parent::drawMark($valueIndex, $s, $position);
* The pixel Screen Horizontal coordinate of the ValueIndex Series
* This coordinate is calculated using the Series associated Horizontal
return parent::calcXPos($valueIndex);
$tmpValue = $this->vxValues->value[$valueIndex] +
return ($tmp != 0) ? $this->calcXPosValue($tmpValue * 100.0 / $tmp) : 0;
* The vertical Bar position is the "real" Y pos plus the Barwidth by our
* This coordinate is calculated using the Series associated Vertical Axis.
$result = parent::calcYPos($valueIndex);
$result += MathUtils::round($this->iBarSize *
private function drawBar($barIndex, $startPos, $endPos) {
$g = $this->chart->getGraphics3D();
$tmpMidY = ($r->y + $r->getBottom()) / 2;
if ($this->chart->getAspect()->getView3D()) {
$g->cube($startPos, $r->y, $endPos, $r->getBottom(), $this->getStartZ(), $this->getEndZ(),
$g->pyramid(false, $startPos, $r->y, $endPos, $r->getBottom(), $this->getStartZ(),
$g->pyramid(false, $endPos, $r->y, $startPos, $r->getBottom(), $this->getStartZ(),
$g->arrow(true, new TeePoint($startPos, $tmpMidY),
$g->cube($startPos, $r->y, $endPos, $r->getBottom(), $this->getStartZ(), $this->getEndZ(),
if ($g->getSupportsFullRotation() ||
$this->chart->getAspect()->getOrthogonal()) {
$g->calc3DPoint($startPos, $r->y, $this->getStartZ()),
$g->calc3DPoint($endPos, $r->getBottom(), $this->getStartZ()));
/*$this->Point[]*/ $this->pCone[0] = new TeePoint($startPos, $r->y);
$this->pCone[1] = new TeePoint($endPos, $tmpMidY);
$this->pCone[2] = new TeePoint($startPos, $r->getBottom());
$g->polygon($this->pCone);
/*$this->Point[]*/ $this->pInv[0] = new TeePoint($endPos, $r->y);
$this->pInv[0] = new TeePoint($startPos, $tmpMidY);
$this->pInv[0] = new TeePoint($endPos, $r->getBottom());
$g->polygon($this->pInv);
$g->arrow(true, new TeePoint($startPos, $tmpMidY),
new Rectangle($startPos, $r->y, $endPos - $startPos,
$result = $this->mandatory->value[$valueIndex] >= 0; /* 5.01 */
* The Maximum Value of the Series X Values List.
* The Minimum Value of the Series X Values List.
* The Minimum Value of the Series Y Values Lists.<br>
* As some Series have more than one Y Values List, this Minimum Value is
* the "Minimum of Minimums" of all Series Y Values lists. <br>
return $this->getChart()->getSeriesIndexOf($this);
return parent::getMinYValue();
* The Maximum Value of the Series Y Values List.
|