Source for file ColorBand.php
Documentation is available at ColorBand.php
* Description: Color band tool, use it to display a coloured rectangle
* (band) at the specified axis and position
* @copyright (c) 1995-2008 by Steema Software SL. All Rights Reserved. <info@steema.com>
* @link http://www.steema.com
private $drawBehind = true;
function __get( $property ) {
$method = "get{$property}";
function __set ( $property,$value ) {
$method = "set{$property}";
return $this->$method($value);
$this->fLineEnd = $this->newColorLine();
$this->fLineStart = $this->newColorLine();
private function newColorLine() {
$result->setActive(false);
$result->setDragRepaint(true);
$result->setDraw3D(false);
$result->setDrawBehind(true);
private function setLines() {
$this->fLineEnd->setValue($this->getEnd());
$this->fLineStart->setValue($this->getStart());
if($this->fLineEnd->getActive()) {
$c = $this->fLineEnd->mouseEvent($e, $c);
if($this->fLineStart->getActive()) {
$c = $this->fLineStart->mouseEvent($e, $c);
$this->fLineEnd->setAxis($value);
$this->fLineStart->setAxis($value);
* Gets detailed descriptive text.
* Draws the Colorband behind the series values when true.<br>
return $this->drawBehind;
* Draws the Colorband behind the series values when true.<br>
$this->fLineEnd->setDrawBehind($value);
$this->fLineStart->setDrawBehind($value);
* The Start Axis value of colorband.
* Sets Start Axis value of colorband.
* The End Axis value of colorband.
* Sets End Axis value of colorband.
public function setEnd($value) {
* The Transparency of ColorBand as percentage.<br>
return $this->getBrush()->getTransparency();
* Sets the Transparency of ColorBand as percentage.<br>
$this->getBrush()->setTransparency($value);
* Sets Band colour gradient.
return $this->bBrush->getGradient();
return $this->bBrush->getColor();
$this->bBrush->setColor($value);
* Element Brush characteristics.
* Contains formatting properties for the automatic line used to drag the start value of the ColorBand tool at runtime.
return $this->fLineStart;
* Contains formatting properties for the automatic line used to drag the end value of the ColorBand tool at runtime.
* Gets or sets if the ColorBand tool allows mouse dragging of the edge corresponding to the end value.
* Gets or sets if the ColorBand tool allows mouse dragging of the edge corresponding to the start value.
* Pen used to draw the starting line of the color band tool.
* Pen used to draw the ending line of the color band tool.
private function paintBand() {
if ($this->iAxis != null) {
$tmpRect = $this->chart->getChartRect();
$r = new Rectangle($tmpRect->getX(),$tmpRect->getY(),$tmpRect->getWidth(),$tmpRect->getHeight());
if ($this->iAxis->getInverted()) {
$tmpDraw = ($tmp1 <= $this->iAxis->getMaximum()) && ($tmp0 >= $this->iAxis->getMinimum());
$tmpDraw = ($tmp0 <= $this->iAxis->getMaximum()) && ($tmp1 >= $this->iAxis->getMinimum());
if ($this->iAxis->getHorizontal()) {
$r->x = max($this->iAxis->iStartPos, $this->iAxis->calcPosValue($tmp0));
$r->width = min($this->iAxis->iEndPos, $this->iAxis->calcPosValue($tmp1)) -
if (!$this->getPen()->getVisible()) {
$r->y = max($this->iAxis->iStartPos, $this->iAxis->calcPosValue($tmp1));
$r->height = min($this->iAxis->iEndPos, $this->iAxis->calcPosValue($tmp0)) -
if (!$this->getPen()->getVisible()) {
$g = $this->chart->getGraphics3D();
if ( $this->getGradient()->getVisible() && $this->chart->getAspect()->getOrthogonal() ) {
$this->getGradient()->draw($g,$g->calcRect3D($this->tmpR,$this->chart->getAspect()->getWidth3D()));
if (($this->chart->getAspect()->getView3D()) && ($this->drawBehind)) {
$g->rectangle($r, $this->chart->getAspect()->getWidth3D());
if (((/*($e->getID()==$tmpChartDrawEvent->PAINTING) &&*/
($e->getDrawPart()== ChartDrawEvent::$SERIES)) && $this->drawBehind) ||
((/* TODO ($e->getID()==ChartDrawEvent::$PAINTED) &&*/
($e->getDrawPart()== ChartDrawEvent::$CHART)) && (!$this->drawBehind))) {
|