Source for file CustomPoint.php
Documentation is available at CustomPoint.php
* <p>Title: CustomPoint class</p>
* <p>Description: Base Series class inherited by a number of TeeChart
* <p>Copyright (c) 2005-2008 by Steema Software SL. All Rights
* <p>Company: Steema Software SL</p>
protected $iStacked = 0; // TCustomStack.NONE;
function __get( $property ) {
$method = "get{$property}";
function __set ( $property,$value ) {
$method = "set{$property}";
return $this->$method($value);
public function assign($source) {
if ($tmp->point != null) {
/* todo public function addSeriesMouseListener($l) {
$this->listenerList->add($this->SeriesMouseListener->class, $l);
public function removeSeriesMouseListener($l) {
$this->listenerList->remove($this->SeriesMouseListener->class, $l);
$this->styleResolver = $resolver;
$this->styleResolver = null;
private function setOtherStacked() {
if ($this->chart != null) {
for ( $t = 0; $t < $this->chart->getSeriesCount(); $t++ ) {
$s = $this->chart->getSeries($t);
* Defines how multiple series will be displayed.<br><br>
* Stacking options of Points series are:<br> <br>
* CustomSeriesStack.None: No overlap action. All Series displayed in
* individual Z space <br>
* CustomSeriesStack.Overlap: Series displayed in same Z space (all Series
* take same ZOrder position). This will result in overpainting of equal
* CustomSeriesStack.Stack: Stack Series one above the other. Series begin
* with lowest index order at bottom, further Series are then plotted above
* in their respective indexed order with each point taking the cumulative
* value of lower points as their starting value. <br>
* CustomSeriesStack.Stack100: Plots take up full Bottom to Top space of
* the Chart Area resulting in a percentage division by Area to reflect
* Series values. The Y displacement below each line equates to its
* percentage value of total. Thus the Last Line will be parallel with/at
* the top of the Chart and the area below that line reflects its
* percentage proportion. <br>
* Default value: CustomStack::$NONE
* Defines how multiple series will be displayed.
* Default value: CustomStack::$NONE
* @param value CustomStack
$this->setOtherStacked();
* Defines all necessary properties of the Series Pointer.<br>
* It is a subclass of Points series, Line series and all other derived
* Points series classes like Bubble series.<br>
* Each point in a Points series is drawn using the Pointer properties.<br>
* Pointer contains several methods to control the formatting attributes of
* Points like Pen, Brush, Draw3D, Visible, etc. <br>
if ($this->point == null) {
//MM Jan04 set { point=value; }
if ($this->point != null) {
if ($this->styleResolver != null) {
$s = $this->styleResolver->getStyle($this, $valueIndex, $s);
private function axisPosition() {
private function calcStackedPos($valueIndex, $value) {
$value += $this->pointOrigin($valueIndex, false);
return min($this->axisPosition(), $this->calcPosValue($value));
$tmp = $this->pointOrigin($valueIndex, true);
return ($tmp != 0) ? $this->calcPosValue($value * 100.0 / $tmp) :
* For stacked series, PointOrigin returns the sum of ValueIndex values of
* all series, until this series in the Chart.Series collection order.<br>
* @param valueIndex int the point index
* @param sumAll boolean when true, all series are taken into calculation
* @return double point origin value
private function pointOrigin($valueIndex, $sumAll) {
for ( $t = 0; $t < $this->chart->getSeriesCount(); $t++ ) {
$s = $this->chart->getSeries($t);
if ((!$sumAll) && ($s == $this)) {
($this->s->getCount() > $valueIndex)) {
$tmp = $s->getOriginValue($valueIndex);
parent::calcHorizMargins($margins);
parent::calcVerticalMargins($margins);
$this->getPointer()->calcVerticalMargins($margins);
return ($this->point != null) && (abs($tmpX - $x) < $this->point->getHorizSize()) &&
(abs($tmpY - $y) < $this->point->getVertSize());
$tmpColor = ($valueIndex == - 1) ? $this->getColor() :
$this->point->drawLegendShape($g, $tmpColor, $rect, false);
parent::drawLegendShape($g, $valueIndex, $rect);
protected function drawMark($valueIndex, $s, $position) {
$position = $this->getMarks()->applyArrowLength($position);
parent::drawMark($valueIndex, $s, $position);
* Draws series pointer to the Canvas.
* It displays a pointer at the specified px and py screen pixel
* coordinates with the tmpHoriz and tmpVert size dimensions.
public function drawPointer($aX, $aY, $aColor, $valueIndex) {
$this->point->prepareCanvas($this->chart->getGraphics3D(), $aColor);
$this->point->draw($aX, $aY, $aColor, $tmpStyle);
* Returns vertical screen position for a given point.
* This coordinate is calculated using the Series associated Vertical Axis.
return parent::calcYPos($valueIndex);
return $this->calcStackedPos($valueIndex, $this->vyValues->value[$valueIndex]);
* Returns horizontal screen position for a given point.
* This coordinate is calculated using the Series associated Horizontal
return parent::calcXPos($valueIndex);
return $this->calcStackedPos($valueIndex, $this->vxValues->value[$valueIndex]);
return $this->calcStackedPos($valueIndex, 0);
* Called internally. Draws the "ValueIndex" point of the Series.
* Returns the ValueIndex of the "clicked" point in the Series.
if ($this->chart != null) {
$p = $this->chart->getGraphics3D()->calculate2DPosition($x, $y, $this->getStartZ());
$result = parent::clicked($x, $y);
* Returns the Maximum Value of the Series X Values List.
$result = parent::getMaxXValue();
$result = parent::getMaxXValue();
for ( $t = 0; $t < $this->getCount(); $t++ ) {
$this->pointOrigin($t, false) +
* Returns the Minimum Value of the Series X Values List.
return parent::getMinXValue();
* Returns the Maximum Value of the Series Y Values List.
$result = parent::getMaxYValue();
for ( $t = 0; $t < $this->getCount(); $t++ ) {
$this->pointOrigin($t, false) +
return parent::getMaxYValue();
* Returns the Minimum Value of the Series Y Values List.
|