Source for file GridBand.php
Documentation is available at GridBand.php
* Description: Grid Band tool, use it to display a coloured rectangles
* (bands) at the grid lines of the specified axis and position
* @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);
$tmpColor = new Color(0, 0, 0);
* Gets detailed descriptive text.
* The Brush characteristics of the first GridBand tool Band.
if($this->band1->getSolid())
$this->band1->setStyle(HatchStyle::$BACKWARDDIAGONAL);//to avoid Form serialisation issues
$this->chart->invalidate();//CDI because firing BeforeDrawSeriesEventArgs?
* The Brush characteristics of the second GridBand tool Band.
if($this->band2->getSolid())
$this->band2->setStyle(HatchStyle::$BACKWARDDIAGONAL);//to avoid Form serialisation issues
$this->chart->invalidate();//CDI because firing BeforeDrawSeriesEventArgs?
private function drawBand($tmpPos1, $tmpPos2)
$chartRect = $this->chart->getChartRect();
$g = $this->chart->getGraphics3D();
$g->setBrush($this->tmpBand);
$g->getPen()->setVisible(false);
if($this->iAxis->getHorizontal())
$chartRect->getBottom()- 2);
if($this->chart->getAspect()->getView3D())
$this->chart->getGraphics3D()->rectangleWithZ($tmpR, $this->chart->getAspect()->getWidth3D());
$this->chart->getGraphics3D()->rectangle($tmpR);
if(/* TODO ($e->getID()==$tmpChartDrawEvent->PAINTING) &&*/
private function drawGrids()
$tmp = $this->iAxis->axisDraw->getNumTicks();
if($this->iAxis->getHorizontal())
if ($this->iAxis->getGridCentered())
$tmpValue = round(($this->iAxis->axisDraw->ticks[$t- 1] - $this->iAxis->axisDraw->ticks[$t])/ 2);
if($this->iAxis->axisDraw->ticks[t]+ $tmpValue < $this->iAxis->iEndPos)
$this->drawBand($this->iAxis->iEndPos + 1, $this->iAxis->axisDraw->ticks[0]+ $tmpValue);
if($this->iAxis->axisDraw->ticks[0] < $this->iAxis->iEndPos)
$this->drawBand($this->iAxis->iEndPos - 1, $this->iAxis->axisDraw->ticks[0]);
if ($this->iAxis->getGridCentered())
$tmpValue = round(($this->iAxis->axisDraw->ticks[$t- 1] - $this->iAxis->axisDraw->ticks[$t])/ 2);
if ($this->iAxis->iStartPos < $this->iAxis->axisDraw->ticks[0] - $tmpValue)
$this->drawBand($this->iAxis->iStartPos,$this->iAxis->axisDraw->ticks[$tmp- 1]- $tmpValue);
if($this->iAxis->axisDraw->ticks[0] > $this->iAxis->iStartPos)
$this->drawBand($this->iAxis->iStartPos + 1, $this->iAxis->axisDraw->ticks[0]);
if ($this->iAxis->getGridCentered())
for ( $t = 0; $t < $tmp; $t++ ) {
$tmpValue = round(($this->iAxis->axisDraw->ticks[$t] - $this->iAxis->axisDraw->ticks[$t- 1])/ 2);
$this->drawBand($this->iAxis->axisDraw->ticks[$t - 1]- $tmpValue,
$this->iAxis->axisDraw->ticks[$t]- $tmpValue);
if($this->tmpBand === $this->getBand1())
for($t = 1; $t < $tmp; ++ $t)
$this->drawBand($this->iAxis->axisDraw->ticks[$t - 1],
$this->iAxis->axisDraw->ticks[$t]);
if($this->tmpBand === $this->getBand1())
if($this->iAxis->getHorizontal())
if ($this->iAxis->getGridCentered())
$tmpValue = round(($this->iAxis->axisDraw->ticks[$t- 2] - $this->iAxis->axisDraw->ticks[$t- 1])/ 2);
if($this->iAxis->axisDraw->ticks[$tmp]- $tmpValue < $this->iAxis->iStartPos)
$this->drawBand($this->iAxis->axisDraw->ticks[$t- 1]- $tmpValue,
$this->iAxis->axisDraw->ticks[$t- 1]+ $tmpValue);
if($this->tmpBand === $this->getBand1())
$tmpValue = round(($this->iAxis->axisDraw->ticks[$t- 2] - $this->iAxis->axisDraw->ticks[$t- 1])/ 2);
if($this->iAxis->axisDraw->ticks[$tmp - 1]+ $tmpValue > $this->iAxis->iStartPos)
$this->drawBand($this->iAxis->axisDraw->ticks[$tmp - 1]- $tmpValue, $this->iAxis->iStartPos);
if($this->iAxis->axisDraw->ticks[$tmp - 1] > $this->iAxis->iStartPos)
$this->drawBand($this->iAxis->axisDraw->ticks[$tmp - 1], $this->iAxis->iStartPos);
if ($this->iAxis->getGridCentered())
$tmpValue = round(($this->iAxis->axisDraw->ticks[$t- 2] - $this->iAxis->axisDraw->ticks[$t- 1])/ 2);
if($this->iAxis->axisDraw->ticks[$tmp - 2]+ $tmpValue < $this->iAxis->iEndPos)
$this->drawBand($this->iAxis->axisDraw->ticks[$tmp - 2]- $tmpValue,
if($this->tmpBand === $this->getBand1())
if ($this->iAxis->iEndPos > $this->iAxis->axisDraw->ticks[$tmp - 1] - $tmpValue)
$this->drawBand($this->iAxis->axisDraw->ticks[$tmp- 1]- $tmpValue, $this->iAxis->iEndPos);
if($this->iAxis->axisDraw->ticks[$tmp - 1] < $this->iAxis->iEndPos)
$this->drawBand($this->iAxis->axisDraw->ticks[$tmp - 1], $this->iAxis->iEndPos);
|