Source for file Arrow.php
Documentation is available at Arrow.php
* <p>Title: Arrow class</p>
* <p>Description: Arrow Series.</p>
* <pre><font face="Courier" size="4">
* arrowSeries = new com.steema.teechart.styles.Arrow(myChart.getChart());
* arrowSeries.setArrowWidth(32);
* arrowSeries.setArrowHeight(32);
* arrowSeries.getXValues().setDateTime(false);
* arrowSeries.getYValues().setDateTime(false);
* arrowSeries.setColorEach(true);
* <p>Copyright (c) 2005-2007 by Steema Software SL. All Rights
* <p>Company: Steema Software SL</p>
public function Arrow($c= null) {
$this->point->setInflateMargins(false);
$this->getMarks()->getPen()->setVisible( false);
$this->getMarks()->setTransparent(true);
* Determines the vertical arrow head size in pixels.<br>
* It sets the distance from the base of the arrow head to the arrow tip
* in pixels. It can be used together with ArrowWidth to determine the
* overall size of the arrow head.
return $this->point->getVertSize();
* Sets the vertical arrow head size in pixels.<br>
$this->point->setVertSize($value);
* Determines the horizontal arrow head size in pixels. <br>
return $this->point->getHorizSize();
* Sets the horizontal arrow head size in pixels. <br>
$this->point->setHorizSize($value);
* The X0 values for Arrows. <br>
* Each Arrow has (X0,Y0) and (X1,Y1) coordinates. <br>
* StartXValues.DateTime property default value is true.
* Sets X0 values for Arrows. <br>
* The Y0 values for Arrows.<br>
* Each Arrow has (X0,Y0) and (X1,Y1) coordinates. <br>
* Sets Y0 values for Arrows.<br>
* The X1 values for Arrows.<br>
* Each Arrow has (X0,Y0) and (X1,Y1) coordinates. <br>
return $this->endXValues;
* Sets X1 values for Arrows.<br>
* The Y1 values for Arrows.<br>
* Each Arrow has (X0,Y0) and (X1,Y1) coordinates. <br><br>
return $this->endYValues;
* Sets Y1 values for Arrows.<br>
* Adds an Arrow with start and end coordinates.<br>
* Returns the position of the Arrow in the list.<br>
* Positions start at zero. <br><br>
* Each arrow is made of 2 points: <br>
* (X0,Y0) The starting arrow point. <br>
* (X1,Y1) The arrow head end point. <br>
* @param x0 double arrow start x coordinate
* @param y0 double arrow start y coordinate
* @param x1 double arrow end x coordinate
* @param y1 double arrow end y coordinate
public function _add($x0, $y0, $x1, $y1) {
return $this->addArrow($x0, $y0, $x1, $y1, "", $tmpColor->getEmpty());
* Adds an Arrow with start and end coordinates and label.<br>
* Returns the position of the Arrow in the list.<br>
* Positions start at zero. <br><br>
* Each arrow is made of 2 points: <br>
* (X0,Y0) The starting arrow point. <br>
* (X1,Y1) The arrow head end point. <br>
* Label (overload option) <br>
* @param x0 double arrow start x coordinate
* @param y0 double arrow start y coordinate
* @param x1 double arrow end x coordinate
* @param y1 double arrow end y coordinate
* @param text String label text
public function __add($x0, $y0, $x1, $y1, $text) {
return $this->addArrow($x0, $y0, $x1, $y1, $text, $tmpColor->getEmpty());
* Returns the position of the Arrow in the list.<br>
* Positions start at zero. <br><br>
* Each arrow is made of 2 points: <br>
* (X0,Y0) The starting arrow point. <br>
* (X1,Y1) The arrow head end point. <br>
* Color (overload option) <br>
* @param x0 double arrow start x coordinate
* @param y0 double arrow start y coordinate
* @param x1 double arrow end x coordinate
* @param y1 double arrow end y coordinate
* @param color Color arrow color
public function ___add($x0, $y0, $x1, $y1, $color) {
return $this->addArrow($x0, $y0, $x1, $y1, "", $color);
* Returns the position of the Arrow in the list.<br>
* Positions start at zero. <br><br>
* Each arrow is made of 2 points: <br>
* (X0,Y0) The starting arrow point. <br>
* (X1,Y1) The arrow head end point. <br>
* Label (overload option) <br>
* Color (overload option) <br>
* @param x0 double arrow start x coordinate
* @param y0 double arrow start y coordinate
* @param x1 double arrow end x coordinate
* @param y1 double arrow end y coordinate
* @param text String label text
* @param color Color arrow color
public function AddArrow($x0, $y0, $x1, $y1, $text, $color) {
$this->endXValues->tempValue = $x1;
$this->endYValues->tempValue = $y1;
return parent::add($x0, $y0, $text, $color);
for ( $t = 1; $t <= $numValues; $t++ ) {
$tmpX0 = $r->tmpX + $tmpDifX * $r->Random();
$tmpY0 = $r->MinY + $tmpDifY * $r->Random();
$this->_add($tmpX0, $tmpY0, $tmpX0 + $tmpDifX * $r->Random(),
$tmpY0 + $tmpDifY * $r->Random());
for ( $t = 0; $t < $this->getCount(); $t++ ) {
/*ArrowPoints*/ $arrow= $this->getArrowPoints($t);
if ($this->Graphics3D->pointInLineTolerance($p, $arrow->p0, $arrow->p1,
* The Maximum Value of the Series X Values List.
return max(parent::getMaxXValue(), $this->endXValues->getMaximum());
* The Minimum Value of the Series X Values List.
return min(parent::getMinXValue(), $this->endXValues->getMinimum());
* The Maximum Value of the Series Y Values List.
return max(parent::getMaxYValue(), $this->endYValues->getMaximum());
* The Minimum Value of the Series Y Values List.
return min(parent::getMinYValue(), $this->endYValues->getMinimum());
private function getArrowPoints($valueIndex)
* Called internally. Draws the "ValueIndex" point of the Series.<br>
/*ArrowPoints*/ $arrow= $this->getArrowPoints($valueIndex);
$g = $this->chart->getGraphics3D();
if ($this->chart->getAspect()->getView3D()) {
$this->getPointer()->prepareCanvas($g, $tmpColor);
$g->getPen()->setColor( $tmpColor);
$g->arrow($this->chart->getAspect()->getView3D(), $arrow->p0, $arrow->p1, $this->getPointer()->getHorizSize(),
|