Source for file Series.php
Documentation is available at Series.php
* Description: The base class for all TeeChart Series styles
* @copyright (c) 1995-2008 by Steema Software SL. All Rights Reserved. <info@steema.com>
* @link http://www.steema.com
private $customHorizAxis;
private $showInLegend = true;
* Returns True when the Series needs axes to display points.
* For example, Pie Series returns False (it does not need axes).
* Returns true if the series has ZValues.
* Constant field for internal use.
public static $AUTODEPTH = - 1;
* Constant field for internal use.
public static $AUTOZORDER = - 1;
function __get( $property ) {
$method = "get{$property}";
function __set ( $property,$value ) {
$method = "set{$property}";
return $this->$method($value);
// TODO $this->customMarkText = $this->MARKTEXT_RESOLVER;
$this->listenerList->add($this->SeriesPaintListener->class , $l);
$this->listenerList->remove($this->SeriesPaintListener->class , $l);
/* todo $this->Object[] $this->listeners = $this->listenerList->getListenerList();
for ( $i = $this->listeners->length - 2; $i >= 0; $i -= 2) {
if ($this->listeners[$i] == $this->SeriesPaintListener->class) {
switch ($e->getDrawPart()) {
$tmpChartDrawEvent = new ChartDrawEvent();
if ($e->getID() == $tmpChartDrawEvent->PAINTING) {
(($this->SeriesPaintListener) $this->listeners[$i + 1])->seriesPainting($e);
} else if ($e->getID() == $tmpChartDrawEvent->PAINTED) {
(($this->SeriesPaintListener) $this->listeners[$i + 1])->seriesPainted($e);
// todo $this->listenerList->add($this->SeriesMouseListener->class, $l);
// todo $this->listenerList->remove($this->SeriesMouseListener->class, $l);
/* todo $this->Object[] $this->listeners = $this->listenerList->getListenerList();
for ( $i = $this->listeners->length - 2; $i >= 0; $i -= 2) {
if ($this->listeners[$i] == $this->SeriesMouseListener->class) {
$tmpSeriesMouseEvent = new SeriesMouseEvent();
case $tmpSeriesMouseEvent->SERIES_CLICKED: {
(($this->SeriesMouseListener) $this->listeners[$i + 1])->seriesClicked($se);
case $tmpSeriesMouseEvent->SERIES_ENTERED: {
(($this->SeriesMouseListener) $this->listeners[$i + 1])->seriesEntered($se);
case $tmpSeriesMouseEvent->SERIES_EXITED: {
(($this->SeriesMouseListener) $this->listeners[$i + 1])->seriesExited($se);
$tmpSeriesMouseEvent = new SeriesMouseEvent();
/* todo $this->Object[] $this->listeners = $this->listenerList->getListenerList();
for ( $i = $this->listeners->length - 2; $i >= 0; $i -= 2) {
if ($this->listeners[$i] == $listener) {
protected function Series($c = null)
$this->zOrder = self::$AUTOZORDER;
$this->verticalAxis = VerticalAxis::$LEFT;
$this->depth = self::$AUTODEPTH;
// TODO $cursor= Cursors.DEFAULT;
$tmpColor = new Color(0, 0, 0, 0, true);
$this->checkValuesList();
$this->vxValues = new ValueList($this, "ValuesX");// todo $this->Language->getString("ValuesX"));
$this->vyValues = new ValueList($this, "ValuesY");// todo $this->Language->getString("ValuesY"));
$this->chart->addSeries($this);
if($this->function != null)
$this->function->setSeries(null);
* Creates a new series from the Class type of an existing series object.
* @throws InstantiationException
* @throws IllegalAccessException
public function newFromType($type)/* todo throws InstantiationException,
return(new $type($this->chart));
private function initMandatory()
private function checkValuesList()
if($this->valuesList == null)
$this->checkValuesList();
// TODO $this->listenerList = new EventListenerList();
// TODO $this->customMarkText = $this->MARKTEXT_RESOLVER;
// TODO $this->percentDecimal = new DecimalFormat($this->Language->getString("DefPercentFormat"));
* Creates a new Series object and sets the Name, Chart, Sub-Style and
* This is an internal method, you should seldomly use it in your
* @param chart IBaseChart
* @throws InstantiationException
* @throws IllegalAccessException
public function createNewSeries($chart, $type, $aFunction, $subIndex = 0)/* tODO throws
InstantiationException, IllegalAccessException*/
$result->setChart($chart);
$result->setFunction($aFunction->newInstance());
$result->setSubGallery($subIndex);
/* todo $tmpChartDrawEvent = new ChartDrawEvent();
$this->fireSeriesPaint(new ChartDrawEvent($this, $tmpChartDrawEvent->PAINTING,
$tmpChartDrawEvent->SERIES));*/
/* tODO $tmpChartDrawEvent = new ChartDrawEvent();
$this->fireSeriesPaint(new ChartDrawEvent($this, $tmpChartDrawEvent->PAINTED,
$tmpChartDrawEvent->SERIES));*/
if($this->zOrder == self::$AUTOZORDER)
if($this->chart->getAspect()->getView3D())
$this->chart->setMaxZOrder($this->chart->getMaxZOrder() + 1);
* Accesses the stored Color Array, if created, for the Series.<br>
* When attaching new series to any Chart, setting TChart Series.SerieColor
* to Color.EMPTY will make TeeChart assign a different color to each Series.
* Some Series types allow Color.EMPTY in their Pen and Brushes properties,
* thus forcing the use of the actual point color instead of the Pen or
* Brush assigned color. <br>
* <pre><font face="Courier" size="4">
* candleSeries.add( ...., Color.Yellow );
* candleSeries.getColors().setColor( 10, Color.Blue);
* @see Series#getColorEach
$this->ValueList->defaultCapacity);
* Accesses the stored Color Array, if created, for the Series.<br>
return new SeriesXYPoint($this, $index);
* Values defining horizontal point positions.<br>
* By default, any Series has an XValues property. This is the IValueList
* where the point values will be stored at runtime. Also by default,
* XValues is a Public method. Some derived Series publish it: Line series,
* Bar series, Points series, etc. Some others publish it with another,
* more friendly name: GanttSeries.StartValues, etc. <br><br>
* You <b>CAN NOT Delete, Clear or Add values DIRECTLY.</b> You need to
* call the Series equivalent methods to do this.
* Values defining vertical point positions.<br><br>
* You <b>CAN NOT Delete, Clear or Add values DIRECTLY.</b> You need to
* call the Series equivalent methods to do this.
* Copies all properties from one Series component to another.<br>
* Only the common properties shared by both source and destination Series
* The following code copies all properties from Series2 into Series1:
* Series1.Assign( Series2 ) ;<br><br>
* Some Series types restore method values after assigning them. For
* example, Points series restores the Pointer.Visible method to true after
* being assigned to a Line series, which has Pointers invisible by default.
* <b>Note:</b> Series events are not assigned. Series DataSource and
* FunctionType properties are assigned. Assign is used by
* CloneChartSeries and ChangeSeriesType methods for example.
public function assign($source)
// AssignCommonProperties(source);
$this->title = $source->title;
$this->bBrush->assign($source->bBrush);
$this->showInLegend = $source->showInLegend;
if($this->datasource == null)
$index = $s->chart->getSeriesIndexOf($s);
$s->chart->moveSeriesTo($s, $index);
* Replaces ASeries object with a new Series object of another class.
* @throws InstantiationException
* @throws IllegalAccessException
public function changeType($s, $newType)/* todo throws
InstantiationException, IllegalAccessException*/
if($s->get_class() != $newType)
// Only if different classes
* Returns the steema.teechart.styles.ValuesLists object of the series.<br>
* It permits access to the list of TeeChartValueLists of a Series. <br>
* Several standard Series types such as TLineSeries and TBarSeries
* maintain 2 ValueLists, X and Y values. Other Series such as TCandleSeries
* maintain more lists, ie. DateValues, OpenValues, HighValues, LowValues
* @see com.steema.teechart.styles.ValuesLists
return $this->valuesList;
$this->checkValuesList();
$this->valuesList[] = $value;
//Returns if a Series has "X" values (or Y values for non-vertical series like HorizBar)
if(/* $this->iUseNotMandatory && */($this->getCount() > 0))
if(($tmp->getFirst() == 0) && ($tmp->getLast() == $this->getCount() - 1))
for($t = 0; $t < $tmpCount; $t++ )
if($tmp->getValue($t) != $t)
* Returns the URL of the associated bitmap icon for a given Series class.<br>
* This icon is used at ChartListBox and Series Editor dialog.
$name = $this->get_class();
$name = "icons/" + $name->substring($name->lastIndexOf('->') + 1) + "->gif";
return $this->Series->class ->getResource($name);
* Returns the value list that the AListName parameter has.
* @param aListName String
$aListName = $aListName->toUpperCase();
for($t = 2; $t < sizeof($this->valuesList); $t++ )
if($aListName->equals($this->valuesList->getValueList($t)->name->toUpperCase()))
return $this->valuesList->getValueList($t);
* Specifies the custom horizontal axis for the series.<br>
* After adding a new horizontal Custom Axis to a Chart, use
* CustomHorizAxis to associate the Series to the Custom Axis. <br>
* Together with the axis PositionPercent and "stretching" methods, it's
* possible to have unlimited axes floating anywhere on the chart. <br>
* Scroll, zoom, and axis hit-detection also apply to custom-created axes.<br>
* Creating extra axes is only allowed at run-time, as a few lines of code
return $this->customHorizAxis;
* Specifies the custom horizontal axis for the series.<br>
$this->customHorizAxis = $value;
* Specifies the custom horizontal axis for the series.<br>
$tmp = $this->getChart()->getAxes()->getCustom();
* Specifies the custom vertical axis for the series.<br>
return $this->customVertAxis;
* Specifies the custom vertical axis for the series.<br>
$tmp = $this->getChart()->getAxes()->getCustom();
* Specifies the custom vertical axis for the series.<br>
$this->customVertAxis = $value;
$this->verticalAxis = ($value != null) ? VerticalAxis::$CUSTOM :
* Accesses a list of series point labels.
// todo review before the line below
//$this->sLabels = new StringList(($this->getCount() > 0) ? $this->getCount() :
// $this->ValueList->defaultCapacity);
* Accesses a list of series point labels.
* @param value StringList
* The the Datasource Label Field.<br>
* Sets the Datasource Label Field.<br>
* The the Datasource Color Field.<br>
* Sets the Datasource Color Field.<br>
* Returns the number of pixels for horizontal margins
$margins->max = 0;// abstract
* Returns the number of pixels for vertical margins
$margins->max = 0;// $this->abstract
$this->chart->getAspect()->setView3D($is3D);
* Draws the Series "Legend" on the specified rectangle and Graphics.
// tmpChart = new Chart();
// tmpChart.setAutoRepaint(false);
// TODO remove old $this->chart->setAutoRepaint(false);
//Graphics3D g3d = new Graphics3D(chart);
//DrawLegend(g3d, -1, r);
if($this->chart == $tmpChart)
// TODO remove old $this->getChart()->setAutoRepaint(true);
(($this->horizAxis === $a) ||
((!$a->getHorizontal()) &&
(($this->vertAxis === $a) ||
($this->verticalAxis == VerticalAxis::$BOTH)))
* Returns a new Series, copy of this original.<br>
* It returns the SeriesIndex of the new Series.
* @throws InstantiationException
* @throws IllegalAccessException
$result = $this->Series->createNewSeries($this->chart, $this->get_class(), $tmp);
// add values to --> result
// if DataSource is not null, values are already added in Assign.
// if (result.DataSource==null)
$result->assignValues($this);
* Adds all Values from Source seriesto the current Series.
$tmpX = $source->getXValues()->value[$valueIndex];
$tmpY = $source->getYValues()->value[$valueIndex];
// if we are adding values from (for example) an Horizontal Bar series...
// pending: if ...FY.Order<>loNone then (inverted)
$result = $this->vxValues->addChartValue($tmpX);
$this->getYValues()->insertChartValue($result, $tmpY);
$listsCount = sizeof($this->valuesList);
$tmp = sizeof($source->valuesList) - 1;
for($t = 2; $t < $listsCount; $t++ )
$source->valuesList->getValueList($t)->value[$valueIndex] : 0;
$this->valuesList->getValueList($t)->insertChartValue($result, $tmpY);
// Called when a new value is added to the series.
private function addedValue($source, $valueIndex)
if($source->iColors != null)
$source->getColors()->getColor($valueIndex));
if($source->sLabels != null)
$this->sLabels[$tmpIndex]= $source->sLabels[$valueIndex];
$this->notifyNewValue($this, $tmpIndex);
// This method is called whenever the series points are added,
// deleted, modified, etc.
// DB : NOT sure to include it.
private function notifyValue($valueIndex)
foreach (Series s in linkedSeries )
case veClear : if (rOnClear in recalcOptions) clear();
case veDelete : if (rOnDelete in recalcOptions )
if (FunctionType==null) DeletedValue(this,valueIndex);
case veAdd : if (rOnInsert in recalcOptions)
if (FunctionType==null) AddedValue(this,valueIndex);
case veModify : if (rOnModify in recalcOptions) AddValues(this);
case veRefresh: AddValues(this);
// Triggers the OnAfterAdd event when a new point is added.
// DB : Not sure to include it in NET.
private function notifyNewValue($sender, $valueIndex)
if (OnAfterAdd!=null) OnAfterAdd(sender,valueIndex);
NotifyValue(veAdd,valueIndex);
// Allocates memory for the ALabel String parameter and inserts it
private function insertLabel($valueIndex, $text)
private function addValuesFrom($source)
{// "Copy $this->Function", $this->copy $this->values->->->
$this->getXValues()->setDateTime($source->getYValues()->getDateTime());
$this->getYValues()->setDateTime($source->getXValues()->getDateTime());
$this->getXValues()->setDateTime($source->getXValues()->getDateTime());
$this->getYValues()->setDateTime($source->getYValues()->getDateTime());
$sourceCount = $source->getCount();
for($t = 0; $t < $sourceCount; $t++ )
$this->addedValue($source, $t);
$this->getXValues()->setDateTime($source->getXValues()->getDateTime());
$this->getYValues()->setDateTime($source->getYValues()->getDateTime());
$this->getFunction()->addPoints($list);// $this->calculate $this->function
$this->endUpdate();// $this->propagate $this->changes->->->
* Recalculates all dependent Series points again.<br>
* Each Series has a DataSource method. When DataSource is a valid Series
* or DataSet component, Series get all point values from the DataSource
* and adds them as Series points. The RefreshSeries method forces the
* Series to Clear and get all points again from the DataSource component.
* The Refreshing process traverses the Series tree recursively.
for($t = 0; $t < $this->chart->getSeriesCount(); $t++ )
$s = $this->chart->getSeries($t);
if($s->hasDataSource($this))
* Recalculates the function just one time, when finished adding points.
* Recalculates the function just one time, when finished adding points.
// Clears and adds all points values from "source" ArrayList of Series.
if($this->function == null)
// "Copy Function", copy values...
if($this->yMandatory != $s->yMandatory)// $Dec03 #1274
$this->vxValues->dateTime = $s->vyValues->dateTime;
$this->vyValues->dateTime = $s->vxValues->dateTime;
$this->vxValues->dateTime = $s->vxValues->dateTime;
$this->vyValues->dateTime = $s->vyValues->dateTime;
$this->addValuesFrom($s);
$this->vxValues->dateTime = $s->vxValues->dateTime;
$this->vyValues->dateTime = $s->vyValues->dateTime;
$this->function->addPoints($source);// $this->calculate $this->function
for($t = 0; $t < $this->getCount(); $t++ )
if($this->datasource instanceof ArrayList)
$this->a = $this->datasource;
if($this->a->get(0)instanceof $Series)
$this->result = new ArrayList();
for($t = 0; $t < $this->a->size(); $t++ )
$this->result->add($this->a->get($t));
/* ??? repeated from above, except above code returns a duplicated array
if (datasource instanceof ArrayList) {
ArrayList a = (ArrayList) datasource;
if (a.get(0) instanceof Series) {
if($this->datasource instanceof Series)
$result[]= $this->datasource;
if ($this->datasource instanceof Series[]) {
$tmp = $this->datasource;
$result = new ArrayList();
for ( $t = 0; $t < $tmp->length; $t++) {
if($this->datasource == null)
if($this->datasource === $source)
$tmpSeriesMouseEvent = new SeriesMouseEvent();
$this->fireSeriesMouseEvent(new SeriesMouseEvent($this, $tmpSeriesMouseEvent->SERIES_CLICKED, $valueIndex, $e));
public function doClick($valueIndex, $e)
$tmpSeriesMouseEvent = new SeriesMouseEvent();
$this->fireSeriesMouseEvent(new SeriesMouseEvent($this, $tmpSeriesMouseEvent->SERIES_CLICKED, $valueIndex, $e));
* Draws points with different preset Colors.<br>
* If false, all points will be drawn using the Series Series.Color color
* method.<br> If true, each Series point will be "colored" with its
* corresponding point color. The point colors are stored in the
* Series.PointColor array. If a point has an Color.Empty color value,
* then a TeeChart determined, available color value will be used to draw
private function calcMinMaxValue($a, $b, $c, $d)
$axis = $this->yMandatory ? $this->horizAxis : $this->vertAxis;
return $axis->getInverted() ? $axis->calcPosPoint($c) :
return $axis->getInverted() ? $axis->calcPosPoint($b) :
* Returns if this series is Visible.<br>
* An alias to Active property. <br>
* Shows or Hides the component.
* Returns the corresponding X value of a Screen position between Axis
* The Screen position must be between Axis limits.
return $this->horizAxis->calcPosPoint($screenPos);
* Returns the corresponding Y value of a Screen position between Axis
* The resulting Value is based on the Series.GetVertAxis.
return $this->vertAxis->calcPosPoint($screenPos);
$this->getMarks()->getFont()->setSize(7);
$this->getMarks()->getCallout()->setLength(4);
if($this->chart->getSeriesIndexOf($this) == 0)
$g->rectangle($rect);/* <-- $this->rectangle */
if($g->getBrush()->getForegroundColor() == $this->chart->getLegend()->getColor())
/* <-- color conflict ! */
$oldColor = $g->getPen()->getColor();
if($g->getBrush()->getForegroundColor() == new Color(0,0,0))
$g->getPen()->setColor(new Color(255,255,255));
$g->getBrush()->setVisible(false);
$g->rectangle($rect);/* <-- $rectangle */
$g->getPen()->setColor($oldColor);
public function drawLegend($g = null , $valueIndex, $rect)
$g = $this->chart->getGraphics3D();
$g->setPen($this->chart->getLegend()->getSymbol()->getPen());
$tmpColor = ($valueIndex == - 1) ?
$g->getBrush()->setColor($tmpColor);
if (!$tmpColor->isEmpty()) {
// set background color and style
$tmpBack = $this->chart->getLegend()->getColor();
$tmpStyle->assign($this->bBrush);
// After calling PrepareLegendCanvas, set custom symbol pen, if any...
if($this->chart->getLegendPen() != null)
$g->setPen($this->chart->getLegendPen());
// if back color is "default", use Legend back color
$tmpBack = $this->chart->getLegend()->getColor();
$tmpBack = $this->chart->getPanel()->getColor();
//force the use of TILED imagemode, so image always fits the legendshape boundary
$this->chart->setBrushCanvas($g->getBrush()->getColor(), $tmpStyle, $tmpBack);
The code below does NOT use a "divide by 2" (bubble)
algorithm because the tmpMin value might not have any
correspondence with a Series point.
When the Series point values are "floating" (not int)
the "best" solution is to do a lineal all-traverse search.
However, this code can still be optimized.
It will be revisited for next coming releases.
$r = $this->chart->getChartRect();
$tmpMin = $this->calcMinMaxValue($r->x, $r->y, $r->getRight(),
$tmpMax = $this->calcMinMaxValue($r->getRight(), $r->getBottom(),
* Returns the length in pixels of the longest Mark text.
for($t = 0; $t < $count; $t++ )
$tmpResult = max($tmpResult, $this->getMarks()->textWidth($t));
* Returns corresponding Point value suitable for displaying at Series
private function formatValue($value)
return new DecimalFormat($this->valueFormat)->format($value);
return new DecimalFormat($this->Language->getString("DefValueFormat"))->format($value);
private function labelOrValue($valueIndex)
$tmpResult = ($this->sLabels == null) ? "" :
$tmpResult = $this->formatValue($this->getMarkValue($valueIndex));
private function getAXValue($valueIndex)
if(!($this->horizAxis == null))
if($this->horizAxis->getLabels()->getDateTimeFormat()->equals(""))
/* tODO $result = new DateTime($this->vxValues->value[$valueIndex])->
$this->dateTimeDefaultFormat(
$this->horizAxis->getRange()));*/
/* TODO $result = new DateTime($this->vxValues->
$this->value[$valueIndex])->toString(
$this->horizAxis->getLabels()->
$this->getDateTimeFormat());*/
/*todo $result = (new DecimalFormat($this->Language->getString("DefValueFormat")))->format(
$this->vxValues->value[$valueIndex]);*/
return $this->formatValue($this->vxValues->value[$valueIndex]);
return $this->horizAxis->getLabels()->labelValue(
private function getAYValue($valueIndex)
return $this->formatValue($this->getMarkValue($valueIndex));
* Returns the String corresponding to the Series Mark text
* for a given ValueIndex point.<br>
* The Mark text depends on the Marks.Style method.<br>
$tmpResult = $this->getAYValue($valueIndex);
if($this->marks->getStyle() == MarksStyle::$PERCENT)
$tmpResult = $this->marks->percentString(
$tmpResult = $this->labelOrValue($valueIndex);
if($this->marks->getStyle() == MarksStyle::$LABELPERCENT)
$tmpResult = $this->labelOrValue($valueIndex) +
$this->marks->percentString($valueIndex, false);
$tmpResult = $this->labelOrValue($valueIndex) +
$tmp + $this->getAYValue($valueIndex);
if($this->marks->getStyle() == MarksStyle::$LEGEND)
$tmpResult = $this->chart->formattedValueLegend($this,
if($this->marks->getStyle() == MarksStyle::$PERCENTTOTAL)
$tmpResult = $this->marks->percentString($valueIndex, true);
$tmpResult = $this->labelOrValue($valueIndex) +
$this->marks->percentString($valueIndex, true);
$tmpResult = $this->getAXValue($valueIndex);
if($this->marks->getStyle() == MarksStyle::$XY)
$tmpResult = $this->getAXValue($valueIndex) +
$tmp + $this->getAYValue($valueIndex);
// TODO return $this->customMarkText->getMarkText($valueIndex, $tmpResult);
* Returns the String representation of a Index point used to draw the Mark.
* Forces the Chart to Repaint.<br>
* You don't normally call Repaint directly. It can be used within derived
* TChartSeries components when changing their properties internally .
* Returns True when the tmpSeries parameter is of the same class.
* Sorts all points in the series using the Labels (texts) list.<br><br>
* <b>Note:</b> non-mandatory values (X) are modified (they are not
* @param order ValueListOrder
/* TODO public function sortByLabels($order) {
if ($order != ValueListOrder::$NONE) {
$this->iLabelOrder = $order;
public function compare($a, $b) {
$result = $this->getLabels()->getString($a)->compareTo($this->getLabels()->
return ($this->iLabelOrder == ValueListOrder::$DESCENDING) ? -$result :
$this->getValueIndexSwapper()
$this->iLabelOrder = ValueListOrder::$NONE;
$this->notMandatory->fillSequence(); // $values ( $them)
public function sortByLabels() {
$this->sortByLabels(ValueListOrder::$ASCENDING);
$w = $this->getChart()->getSeriesWidth3D();
if($this->getDepth() == self::$AUTODEPTH)
* Determines the Format to display point values.<br>
* It specifies the desired formatting string to be applied to Axis Labels.
* It has effect when Axis associated Series have their XValues.DateTime
* or YValues.DateTime is set to false. <br>
* For DateTime Axis labels use AxisLabels.DateTimeFormat. <br>
* ValueFormat is a standard formatting string specifier. <br>
* Chart Axis uses it to draw the axis labels. <br>
* Chart Series uses it to draw the Marks. <br>
* Default value: Language::getString("DefValueFormat")
* Determines the Format to display point values.<br>
* Default value: Language::getString("DefValueFormat")
* The Format to display point values as percentage.<br>
* PercentFormat is a standard string specifier. It is used to draw the
* Series Marks Percent Style figures.<br>
* Default value: Language::getString("DefPercentFormat")
* @see Series#getValueFormat
* Sets the Format to display point values as percentage.<br>
* Default value: Language::getString("DefPercentFormat")
* Horizontal axis associated to this Series.<br>
* Default value: HorizontalAxis.Bottom
return $this->horizontalAxis;
* Stes the Horizontal axis associated to this Series.<br>
* Default value: HorizontalAxis.Bottom
* @param value HorizontalAxis
if($this->horizontalAxis != $value)
$this->horizontalAxis = $value;
$this->customHorizAxis = null;
* Determines Vertical axis associated to this Series.<br>
* Default value: VerticalAxis.Left
return $this->verticalAxis;
* Determines Vertical axis associated to this Series.<br>
* Default value: VerticalAxis.Left
* @param value VerticalAxis
if($this->verticalAxis != $value)
$this->verticalAxis = $value;
$this->customVertAxis = null;
* Returns "Value" parameter coordinate position in pixels.
* The pixel Screen Horizontal coordinate of the ValueIndex Series
* This coordinate is calculated using the Series associated Horizontal
* The pixel Screen Horizontal coordinate of the specified Value.
* This coordinate is calculated using the Series associated Horizontal
return $this->horizAxis->calcXPosValue($value);
* The pixel Screen Vertical coordinate of the ValueIndex Series
* This coordinate is calculated using the Series associated Vertical Axis.
* The pixel Screen Vertical coordinate of the specified Value.<br>
* This coordinate is calculated using the Series associated Vertical Axis.
return $this->vertAxis->calcYPosValue($value);
/* Draws a point Mark using the APosition coordinates. */
protected function drawMark($valueIndex, $st, $aPosition)
$this->getMarks()->internalDraw($valueIndex,
private function getDefaultColor($valueIndex)
$c = $this->getChart()->getGraphics3D()->getDefaultColor($valueIndex);
// TODO remove above line return $c->transparentColor($this->bBrush->getTransparency());
* The colour of the index point.
$result = $this->iColors->getColor($valueIndex);
return $result->isEmpty() ?
$this->getDefaultColor($valueIndex) : $result;
return $this->getDefaultColor($valueIndex);
$g = $this->chart->getGraphics3D();
$a = $this->chart->getAspect();
$shouldZoomFont = ($a->getView3D() &&
(!$g->getSupports3DText()) && $a->getZoomText() &&
if(($t % $this->marks->getDrawEvery()) == 0)
$tmpMark = $this->getMarks()->markItem($t);
if($tmpMark->getVisible())
$g->setFont($tmpMark->getFont());
$tmpFontH = $g->getFontHeight();
$tmp = $this->chart->multiLineTextWidth($st);
$tmpH = $tmp->count * $tmpFontH;
if($this->marks->shouldDrawSymbol())
$tmpW += $tmpFontH;// - 4;
$g->setPen($tmpMark->getPen());
if($tmpMark->getPen()->getVisible())
$aPos->arrowTo->setX($this->calcXPos($t));
$aPos->arrowTo->setY($this->calcYPos($t));
$aPos->arrowFrom->setX($aPos->arrowTo->getX());
$aPos->arrowFrom->setY($aPos->arrowTo->getY());
$aPos->leftTop->setX($aPos->arrowTo->getX() - ($tmpW / 2));
$aPos->leftTop->setY($aPos->arrowTo->getY() - $tmpH + 1);
if($this->getMarks()->getSymbol() != null)
$tmpR = $this->getMarks()->getSymbol()->getShapeBounds();
$tmpR->y = $aPos->leftTop->getY() + 2;
$tmpR->x = $aPos->leftTop->getX() + 2;
$tmpR->width = $tmpFontH;
$tmpR->height = $tmpFontH;
private function clipRegionCreate($activeRegion)
$tmpR = $this->chart->getChartRect();
if($this->chart->canClip())
// tmpR.height++; out mm 27ago07 causes incr series upon series
$this->chart->getGraphics3D()->clipCube($tmpR, 0, $this->chart->getAspect()->getWidth3D());
// Remove the clipping region
private function clipRegionDone($activeRegion)
$this->chart->getGraphics3D()->unClip();
// Draw the "Marks" of the Series
private function drawMarksSeries($s, $activeRegion)
if(($s->marks != null) && ($s->getMarks()->getVisible()))
if($s->getMarks()->getClip())
$activeRegion = $this->clipRegionCreate($activeRegion);
if($s->getMarks()->getClip())
$activeRegion = $this->clipRegionDone($activeRegion);
// if the ASeries parameter has the same "Z" order than the current series, draw the point
private function tryDrawSeries($s, $valueIndex)
if($s->getActive() && ($s->getZOrder() == $this->getZOrder()) &&
($valueIndex < $s->getCount()))
$s->drawValue($valueIndex);
// Draw one single point (ValueIndex) for all Series
private function drawAllSeriesValue($valueIndex)
$tmp1 = $this->chart->getSeriesIndexOf($this);
$tmp2 = $this->chart->getSeriesCount() - 1;
for($t = $tmp1; $t <= $tmp2; $t++ )
$this->tryDrawSeries($this->chart->getSeries($t), $valueIndex);
for($t = $tmp2; $t >= $tmp1; $t-- )
$this->tryDrawSeries($this->chart->getSeries($t), $valueIndex);
for($t = $tmp1; $t <= $tmp2; $t++ )
$this->tryDrawSeries($this->chart->getSeries($t), $valueIndex);
// Returns True if the series is the first one with the same ZOrder.
// Some series allow sharing the same ZOrder (example: Stacked Bars).
private function firstInZOrder()
for($t = 0; $t < $this->chart->getSeriesCount(); $t++ )
$s = $this->chart->getSeries($t);
* Returns true if there are more series that share the same Z order.<br>
* For example Stacked Bars.
if($this->chart->getAspect()->getApplyZOrder())
for($t = 0; $t < $this->chart->getSeriesCount(); $t++ )
$s = $this->chart->getSeries($t);
if($s->getActive() && (!$s->getHasZValues()) &&
protected function draw()
* Draws the series to the Chart Canvas.
$activeRegion = false;/* <-- IMPORTANT !!!! */
if($this->firstInZOrder())
for($t = $this->chart->getSeriesIndexOf($this); $t < $this->chart->getSeriesCount(); $t++ )
$s = $this->chart->getSeries($t);
if($s->getActive() && ($s->getZOrder() == $this->getZOrder()))
$s->calcFirstLastVisibleIndex();
if($s->getFirstVisible() != - 1)
$tmpFirst = ($tmpFirst == - 1) ?
$tmpLast = ($tmpLast == - 1) ?
max($tmpLast, $s->getLastVisible());
$s->doBeforeDrawValues();
if($this->chart->getAspect()->getClipPoints() && (!$activeRegion))
$activeRegion = $this->clipRegionCreate($activeRegion);
for($t = $tmpFirst; $t <= $tmpLast; $t++ )
$this->drawAllSeriesValue($t);
for($t = $tmpLast; $t >= $tmpFirst; $t-- )
$this->drawAllSeriesValue($t);
// Finish Clipping Region
$activeRegion = $this->clipRegionDone($activeRegion);
// Marks and doAfterDrawValues
for($t = 0; $t < $this->chart->getSeriesCount(); $t++ )
$s = $this->chart->getSeries($t);
($s->getFirstVisible() != - 1))
$activeRegion = $this->drawMarksSeries($s, $activeRegion);
if($this->useAxis && $this->chart->getAspect()->getClipPoints())
$activeRegion = $this->clipRegionCreate($activeRegion);
$activeRegion = $this->clipRegionDone($activeRegion);
$activeRegion = $this->drawMarksSeries($this, $activeRegion);
* Obsolete. Use the Series.Color method instead.
* Object to load data from.<br>
return $this->datasource;
* Object to load data from.<br>
if($this->datasource != $value)
// To protect when disposing the Data.SeriesSource component.
if($this->datasource instanceof SeriesSource) {
$this->datasource->setSeries(null);
$this->datasource = $value;
if($this->datasource instanceof SeriesSource) {
$this->datasource->setSeries($this);
//if (! (datasource is Series)) Function=null; //CI Dec 03
if(!($this->datasource instanceof Series) &&
// TODO !($this->datasource instanceof Series[]) &&
!(is_Array($this->datasource)))
* Adds the collection of objects that implement the IList interface.
/* TODO public function add($list) {
for ( $t = 0; $t < sizeof($list); $t++) {
$this->add($list->get($t));
TODO review before $this->add(($list->get($t))->doubleValue());
return $this->valuesList->getValueList($index);
for($t = 0; $t < sizeof($this->valuesList); $t++ )
if($this->valuesList->getValueList($t)->name->equals($name))
return $this->valuesList->getValueList($t);
for($t = 0; $t < sizeof($this->valuesList); $t++ )
$v = $this->valuesList->getValueList($t);
if($v->getDataMember()->length() != 0)
// Prevents a circular relationship between series and
// series DataSource. Raises an exception if "dest" is already "this".
$a = $dest->dataSourceArray();
for($t = 0; $t < $a->size(); $t++ )
// TODO ($a->get($t))->checkOtherSeries($this);
private function fillFromDataSource()
if($this->datasource instanceof Series)
$this->addValuesFrom($this->datasource);
if(is_Array($this->datasource))
$tmp = $this->datasource;
for ( $t = 0; $t < sizeof($tmp); $t++ ) {
} else if ($this->datasource instanceof SeriesSource) {
$this->datasource->refreshData();
if (!$this->DataSeriesSource->tryRefreshData($this)) {
/** @todo THROWING HERE MAKES EXPLOSION
// throw new TeeChartException(
// "Cannot bind to non-supported datasource: " +
// datasource.toString());
* Refreshes all Series point values, either from database Tables
* You can call this method regularly if you want new or modified data to
* appear in realtime in the Series. The parent Chart will be repainted to
if($this->datasource != null)
$this->fillFromDataSource();
if($this->function != null)
if($this->function->noSourceRequired)
{// $this->For "Custom" $this->function
$this->function->addPoints(null);
$this->horizAxis = $this->chart->getAxes()->getBottom();
$this->horizAxis = $this->chart->getAxes()->getTop();
if($this->customHorizAxis != null)
$this->horizAxis = $this->customHorizAxis;
$this->vertAxis = $this->chart->getAxes()->getLeft();
$this->vertAxis = $this->chart->getAxes()->getRight();
if($this->customVertAxis != null)
$this->vertAxis = $this->customVertAxis;
protected function added()
/* TODO review - if is not commented freeseriescolor makes a repaint which affects to the
series->horizaxis to be null and vertaxistoo, temporary color assigned manually
* Obsolete. Use the Series.Color method instead.
* @see steema.teechart.styles.Series.Color
* Default color for all points.<br>
* The TChart Series SeriesColor method is the default color in which the
* Series points will be drawn. It could be any valid color. If you add
* points with Color.EMPTY color, then they will be drawn with the
* SeriesColor color. This method is the default Color associated to the
* Series. When you place a new Series component in a Chart, TeeChart will
* assign a free color to this method (a Color that no other Series in the
* same Chart uses). Some Series have the ColorEach boolean property.
* Setting this to true will force the Series to paint each point with a
* different color, thus without using its SeriesColor.<br>
* SeriesColor is also used to paint the small rectangle in Chart Legend.
* <br>Default value: Color.Empty
* @see Series#getColorEach
return $this->bBrush->getColor();
* Default color for all points.<br>
* Default value: Color.Empty
$this->bBrush->setColor($value);
// TODO $this->chart->broadcastEvent($this, $tmpSeriesEventStyle->CHANGECOLOR);
* Shows or hides this series.<br>
* It can be changed both at design time or runtime. When hiding, all point
* values are preserved, so there's no need to refill the values again
* when showing them. The Series relatives Chart Axis are rescaled in order
* Shows or hides this series.<br>
* It can be changed both at design time or runtime. When hiding, all point
* values are preserved, so there's no need to refill the values again
* when showing them. The Series relatives Chart Axis are rescaled in order
// TODO $this->chart->broadcastEvent($this, $tmpSeriesEventStyle->CHANGEACTIVE);
* Exchanges one point with another. Also the point color and point label.
* @param a int index of first point to exchange.
* @param b int index of second point to exchange.
for($t = 0; $t < sizeof($this->valuesList); $t++ )
$v = $this->valuesList->getValueList($t);
/* $this->sLabels->exchange($a, $b); */
/* todo return new Swapper() {
public function swap($a, $b) {
$this->swapValueIndex($a, $b);
* Series description to show in Legend and dialogs.<br>
* Every Series has a Title method of type String. It is used in
* TChart.Legend to draw the series descriptions. If Title is empty,
* then the Series class Name will be used to draw the legend. Setting
* Title both at design time and runtime will force the Chart to repaint.
* Series description to show in Legend and dialogs.<br>
/* todo $tmpSeriesEventStyle = new SeriesEventStyle();
$this->chart->broadcastEvent($this, $tmpSeriesEventStyle->CHANGETITLE);
if($this->chart != $value)
$this->chart->removeSeries($this);
$this->chart->addSeries($this);
$this->marks->iSeries = $this;
$this->marks->getCallout()->setChart($this->chart);
if($this->function != null)
$this->function->setChart($this->chart);
$this->chart->invalidate();
for($t = 0; $t < sizeof($this->valuesList); $t++ )
$this->valuesList->getValueList($t)->series = $this;
$this->valuesList->getValueList($t)->setChart($this->chart);
* Adds new point with specified DateTime x and Double y values.
* @return int index of added point
/* public function add($x, $y) {
$this->vxValues->dateTime = true;
return $this->add($x->toDouble(), $y);
* @return int index of added point
/* todo public function add($x, $y) {
$this->vxValues->dateTime = true;
$this->vyValues->dateTime = true;
return $this->add($x->toDouble(), $y->toDouble());
* Adds new point with specified DateTime x, Double y values and Color.
* @return int index of added point
/* TODO public function add($x, $y, $c) {
$this->vxValues->dateTime = true;
return $this->add($x->toDouble(), $y, $c);
* Adds new point with specified DateTime x, Double y values and Text.
* @return int index of added point
/* TODO public function add($x, $y, $text) {
$this->vxValues->dateTime = true;
return $this->add($x->toDouble(), $y, $text);
* Obsolete. Please use add(x,y,Color.<!-- -->Transparent)
$tmpColor = new Color(0, 0, 0, 127);// TRANSPARENT
return $this->add($x, $y, $tmpColor);
* Obsolete. Please use add() method without parameters instead.
* Adds a new point with specified value.
public function add($value = "null")
$tmpColor = new Color(0,0,0,127);// TRANSPARENT
* Adds a new point with specified value.
/* TODO public function add($value) {
return $this->add($this->getCount(), $value);
return $this->add($value, $this->getCount());
* Adds a new point with specified value.
/* TODO public function add($value) {
return $this->add(($this->double) $value);
* Adds a new point with specified value and text.
* Adds a new point with specified x and y values.
public function addXY($x, $y)
$tmp = $this->vxValues->addChartValue($x);
$this->vyValues->insertChartValue($tmp, $y);
$listsCount = sizeof($this->valuesList);
for($t = 2; $t < $listsCount; $t++ ) {
$v = $this->valuesList->getValueList($t);
$v->insertChartValue($tmp, $v->tempValue);
if($this->updating == 0) {
* Adds the pair of floating point x- and y-pixel coordinates
/*todo public function add($p) {
return $this->add($p->x, $p->y);
* Adds a new point with specified x,y values and text.
$tmpColor = new Color(0, 0, 0, 0, true);// EMPTY
* Adds a new point with specified x,y values, text and color.
$tmp = $this->addXY($x, $y);
if(!($color->isEmpty())) {
* Adds a new Datetime point to a Series, label and color.
* @param aDate DateTime datetime value
* @param text String point text
* @return int index of added point
/* TODO public function add($aDate, $y, $text, $color) {
$this->vxValues->dateTime = true;
return $this->add($aDate->toDouble(), $y, $text, $color);
* Adds a new point with specified x and y values and color.
* Adds a new point with specified value, text and color.
* Adds a new point with specified value and color.
* Adds a new null point with specified text.
$tmpColor = new Color(0, 0, 0, 127);// Transparent
* Adds all points in source Series.
//[Description("Adds all points in source Series.")]
/* tODO public function add($source) {
$this->addValuesFrom($source);
/*double[]*/$tmpArray = null;
// if (a instanceof DateTime[]) {
// tmpArray = new double[numPoints];
// for (int i = 0; i <= max; i++) {
// tmpArray[i] = (DateTime) a.get(i);
// } else if ((a instanceof int[]) || (a instanceof float[]) ||
// (a instanceof Decimal[])) {
// tmpArray = new double[numPoints];
// a.CopyTo(tmpArray, 0);
// } else if (a instanceof double[]) {
// tmpArray = (double[]) a;
* Adds the X and Y arrays.
* @param xValues ArrayList
* @param yValues ArrayList
/* TODO public function add($xValues, $yValues) {
$numPoints = $yValues->size();
$this->getXValues()->count = $numPoints;
$this->getXValues()->value = $this->convertArray($xValues, $numPoints);
$this->getYValues()->count = $numPoints;
$this->getYValues()->value = $this->convertArray($yValues, $numPoints);
$this->getXValues()->statsOk = false;
$this->getYValues()->statsOk = false;
* Adds the array of double values.
for($t = 0; $t < sizeof($values); $t++ )
* Adds the array of float values.
/* public function add($values) {
for ( $t = 0; $t < $values->length; $t++) {
* Adds the array of integer values.
/* TODO public function add($values) {
for ( $t = 0; $t < $values->length; $t++) {
$r = new MouseClicked($c, false);
$tmpCursors = new Cursors();
if(($this->getCursor() != $tmpCursors->DEFAULT) ||
if($this->getCursor() != $tmpCursors->DEFAULT)
if(!$this->isMouseInside)
$this->isMouseInside = true;
$tmpSeriesMouseEvent = new SeriesMouseEvent();
$tmpSeriesMouseEvent->SERIES_ENTERED, - 1,
$this->isMouseInside = false;
$tmpSeriesMouseEvent->SERIES_EXITED, - 1,
* Reorders points according to Order property of X,Y,etc value lists.<br>
* Refreshes sort order of Series points if Order type of XValues or
// if NotMandatory list has a ValueSource, do not call FillSequence
* Removes all points, texts and Colors from the Series.<br>
* Dependent Series are notified. If no new points are appended to the
* Series, nothing will be painted.
for($t = 0; $t < sizeof($this->valuesList); $t++ )
$this->valuesList->getValueList($t)->clear();
unset ($this->iColors);// Clears the array
return $this->clicked($p->x, $p->y);
* Returns the ValueIndex of the "clicked" point in the Series.<br>
* Clicked means the X and Y coordinates are in the point screen region
* bounds. If no point is "touched", Clicked returns -1
/* tODO public function clicked($x, $y) {
* Returns the number of points in the Series.
* Removes the index th point.<br>
* X values remain unchanged.<br>
* The Chart will be automatically redrawn. <br>
* Dependent Series will be recalculated.
public function delete($index)
if($this->marks->getPositions()->size() > $index)
$this->marks->getPositions()->remove($index);
if($this->marks->getItems()->size() > $index)
$this->marks->getItems()->remove($index);
* Removes count number of points starting at index.<br>
* When RemoveGap parameter is true, it calls ValueList FillSequence.<br>
* The Chart will be automatically redrawn. <br>
* Dependent Series will be recalculated.
* @param removeGap boolean
/* TODO public function delete($index, $count, $removeGap) {
$this->vxValues->removeRange($index, $count);
$this->vyValues->removeRange($index, $count);
if (($this->sLabels != null) &&
($this->sLabels->size() > $index + $count - 1)) {
$this->sLabels->removeRange($index, $count);
if (($this->iColors != null) &&
($this->iColors->getCount() > $index + $count - 1)) {
$this->iColors->removeRange($index, $count);
if (($this->marks != null) &&
($this->marks->getPositions()->size() >
$this->marks->getPositions()->removeRange($index, $count);
$this->notMandatory->fillSequence();
if ($this->updating == 0) {
public function delete($index, $count) {
$this->delete($index, $count, false);
if(($this->chart != null) &&
($this->chart->getMaxValuesCount() > 0))
$result->MinY = $this->chart->getMinYValue($this->vertAxis);
$maxY = $this->chart->getMaxYValue($this->vertAxis);
if($maxY == $result->MinY)
$maxY = 2.0 * $result->MinY;
$minX = $this->chart->getMinXValue($this->horizAxis);
$maxX = $this->chart->getMaxXValue($this->horizAxis);
$maxX = $minX + $numValues - 1;
$NEGATIVE_INFINITY = intval('-1000000000000');
if (bccomp($NEGATIVE_INFINITY, $result->MinY) == 0) {
if (bccomp($NEGATIVE_INFINITY, $minX) == 0) {
if (bccomp($NEGATIVE_INFINITY, $maxY) == 0) {
if (bccomp($NEGATIVE_INFINITY, $maxX) == 0) {
$result->StepX = $maxX - $minX;
$result->StepX /= ($numValues - 1);
$result->DifY = $maxY - $result->MinY;
$MAX_VALUE = intval('1000000000000');
if($result->DifY > $MAX_VALUE)
$result->DifY = $MAX_VALUE;
if($result->DifY < - $MAX_VALUE)
$result->DifY = - $MAX_VALUE;
$result->tmpY = $result->MinY +
$result->DifY * $result->Random();
// TODO remove old $this->chart->setAutoRepaint(false);
for($t = 1; $t <= $numValues; $t++ )
// $s->tmpY = abs($s->tmpY + $tmpH * $s->Random() - ($tmpH / 2)); //TODO review
$this->addXY($s->tmpX, $s->tmpY);
$this->addXY($s->tmpY, $s->tmpX);
// TODO remove old $this->chart->setAutoRepaint(true);
* Adds the specified NumValues random points.
* @param numValues int the number of sample values to add.
* Returns true if the index th point in the Series is "null" or "empty".
* A point is considered "null" when the color of that point is
* @param index int the point index.
* @return boolean true if the point color is Color.Transparent
public function isNull($index)
($this->iColors->getCount() > $index) && $this->iColors->getColor($index)->isNull();
* Validates Series datasource.<br>
* The isValidSourceOf function returns false if the Value parameter is the
* It's used to validate the DataSource property both at design and
* @param value Series the series to validate.
* @return boolean true if value can be a Series data source.
* Function object to calculate values.<br>
$b = $this->function === $value;
// if (function!=null) function.Dispose();
$this->function = $value;
if($this->function != null)
$this->function->setSeries($this);
* The Depth of the series points or interconnecting lines.<br>
* Sets the Depth of the series points or interconnecting lines.<br>
* Determines where on the depth axis the Series is drawn.<br><br>
* Read-only and run time. <br><br>
* It's valid only when TChart.Aspect.View3D is true and when there's more
* than one Series in the same chart. <br>
* You can't alter the ZOrder property directly. If you want a different
* order, you need to use tChart.SeriesList instead.<br>
* The ZOrder property is calculated for each Series just before the
* TChart.ApplyZOrder controls if Series will be assigned a different
* Z position or not. When False, all Series are drawn at same Z plane.<br>
* TChart.MaxZOrder returns the highest of all Series ZOrder values. <br>
* Default value: AutoZOrder
return($this->zOrder == self::$AUTOZORDER) ? $this->iZOrder :
* Determines where on the depth axis the Series is drawn.<br><br>
* Default value: AutoZOrder
$this->iZOrder = ($this->zOrder == self::$AUTOZORDER) ? 0 :
* Displays this Series Title in Legend.<br>
* It is only meaningful when LegendStyle is Series or LastValues. <br>
return $this->showInLegend;
* Displays this Series Title in Legend.<br>
* Returns the index of the Series' first visible point.
* Returns the index of the Series' last visible point.
* Cursor displayed when mouse is over a series point.<br>
* Each Series determines the intersection of points with mouse coordinates
* each time the mouse moves. There are many different Cursors available.
* The Series ZOrder determines the order in which Series will be examined
* to calculate the clicked Series point. <br>
* Cursor displayed when mouse is over a series point.<br>
* Defines how to draw a mark near to each Series point.<br>
* A mark consist of a colored rectangle with a text string on it and a
* line that indicates which points corresponds to which mark. <br>
* Each different Series type draws it's marks differently. <br>
* Returns whether Series draws its points in ascending/descending order.
* <br>Some Series need to draw their points in descending order (starting
* from the last point to the first) depending on certain situations.
* For example, when the horizontal axis Inverted property is True. <br>
* @return boolean true if values in this series are displayed forward,
$result = !$this->horizAxis->getInverted();
if(($this->chart->getAspect()->getView3D()) &&
(!$this->chart->getAspect()->getOrthogonal()) &&
($this->chart->getAspect()->getRotation() < 270))
return !$this->vertAxis->getInverted();
* Called internally. Draws the "ValueIndex" point of the Series.
public function drawValue($index) { }// abstract
* Sets the specified series point to a null (transparent) point.<br>
* <pre><font face="Courier" size="4">
* lineSeries1.setNull( 123 ); // -- make null (empty) point index 123
* lineSeries1.setIgnoreNulls( false ); // -- allow null points
* lineSeries1.setStairs( true ); // -- set "stairs" mode
public function setNull($valueIndex)
$tmpColor = new Color(0, 0, 0, 127);// Transparent
$this->getColors()->setColor($valueIndex, $tmpColor);
* Creates and prepares the index'th Series style to show at sub-gallery
* Returns the size in pixels corresponding to value parameter in
* horizontal axis scales.<br>
* This coordinate is calculated using the Series associated Horizontal
return $this->horizAxis->calcSizeValue($value);
* Returns the size in pixels corresponding to value parameter in vertical
* This coordinate is calculated using the Series associated Vertical Axis.
return $this->vertAxis->calcSizeValue($value);
private function calcXValue($valueIndex)
if($this->horizAxis != null)
return $this->horizAxis->getLabels()->labelValue(
return $this->formatValue($this->vxValues->value[$valueIndex]);
* Overridden ToString() method.
* @return String the Series Series.Title method.
$tmpResult = $this->title;
$tmpResult = "Series" . " " . $this->chart->getSeriesIndexOf($this);
$tmpResult = $this->Language->getString("Series") + " " +
$this->Integer->toString($this->chart->getSeriesIndexOf($this));
// $tmpResult = parent::toString();
return (string) $tmpResult;
* Obsolete. Please use ToString() method instead.
private function valueToStr($tmpValue)
return date('H:i:s',$tmpValue);
return date('Y-m-d',$tmpValue);
return $this->formatValue($tmpValue);
private function calcPercentSt($value)
/* Returns the formatted String corresponding to the LegendIndex
point. The String is used to show at the Legend.
Uses the LegendTextStyle property to ) the appropiate formatting.*/
* Returns the formatted String corresponding to the LegendIndex point.
* @param legendTextStyle LegendTextStyle
// TODO remove bef-..- if $this->sLabels==null
if(strlen($tmpResult) != 0)
$tmpResult = " " . $tmpResult;
// TODO remove above line before :
// $tmpResult = $this->Language->getString("ColumnSeparator") + $tmpResult;
return $this->valueToStr($tmpValue) . $tmpResult;
// TODO change code bellow
if($tmpResult->length() != 0)
$tmpResult = $tmpResult . " "; // TODO $this->Language->getString("ColumnSeparator");
return $this->valueToStr($tmpResult) . $tmpValue;
if($tmpResult->length() != 0)
// TODO below used temp " " ....$this->Language->getString("ColumnSeparator")*/
$tmpResult = " " . $tmpResult;
return $this->calcPercentSt($tmpValue) . $tmpResult;
if($tmpResult->length() != 0)
// TODO below used temp " " ....$this->Language->getString("ColumnSeparator")*/
$tmpResult = $tmpResult . " ";
return $tmpResult + $this->calcPercentSt($tmpValue);
return $this->calcXValue($valueIndex);
return $this->valueToStr($tmpValue);
return $this->calcPercentSt($tmpValue);
// TODO change " " for $this->Language->getString("ColumnSeparator")
return $this->calcXValue($valueIndex) . " " . $this->valueToStr($tmpValue);
// TODO change " " for $this->Language->getString("ColumnSeparator")
return $this->calcXValue($valueIndex) . " " . $this->calcPercentSt($tmpValue);
* The Maximum Value of the Series X Values List.
* The Maximum Value of the Series Y Values List.
* The Minimum Value of the Series X Values List.
* The Minimum Value of the Series Y Values List.
* The Maximum Z Value. For non-3D series, this is the Z order.
* The Minimum Z Value. For non-3D series, this is the Z order.
* Returns whether or not this Series has Y values as mandatory.
/* TODO public interface MarkTextResolver {
String getMarkText(int valueIndex, String markText);
private transient $MARKTEXT_RESOLVER = $new $MarkTextResolver() ${
public function getMarkText($valueIndex, $markText) {
|