TeeChartPHP
[ class tree: TeeChartPHP ] [ index: TeeChartPHP ] [ all elements ]

Class: Functions

Source Location: /functions/Functions.php

Class Overview

TeeBase
   |
   --Functions

Functions class


Author(s):

Version:

  • 1.0

Copyright:

  • (c) 1995-2010 by Steema Software SL. All Rights Reserved. <info@steema.com>

Variables

Methods


Child classes:

Add
Add class
ADX
ADX class
Average
Average class
Count
Count class
High
<p>Title: High class</p>
Low
<p>Title: Low class</p>
ManySeries
<p>Title: ManySeries class</p>
Perimeter
<p>Title: Perimeter class</p>
Smoothing
Smoothing class
Variance
<p>Title: Variance class</p>

Inherited Variables

Inherited Methods


Class Details

[line 18]
Functions class

Description: Basic abstract function class. Examples of derived functions are: Add, Subtract, High, Low, Average and Count.




Tags:

author:  
version:  1.0
copyright:  (c) 1995-2010 by Steema Software SL. All Rights Reserved. <info@steema.com>
link:  http://www.steema.com


[ Top ]


Class Variables

$canUsePeriod =

[line 26]



Tags:

access:  protected

Type:   mixed


[ Top ]

$dPeriod =

[line 23]



Tags:

access:  protected

Type:   mixed


[ Top ]

$HideSourceList =

[line 29]



Tags:

access:  public

Type:   mixed


[ Top ]

$noSourceRequired =

[line 30]



Tags:

access:  public

Type:   mixed


[ Top ]

$series =

[line 24]



Tags:

access:  protected

Type:   mixed


[ Top ]

$SingleSource =

[line 28]



Tags:

access:  public

Type:   mixed


[ Top ]

$updating =

[line 25]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor Functions [line 48]

Functions Functions( [ $c = null])



Tags:

access:  public


Parameters:

   $c  

[ Top ]

method addFunctionXY [line 204]

void addFunctionXY( $yMandatorySource, $tmpX, $tmpY)



Tags:

access:  protected


Parameters:

   $yMandatorySource  
   $tmpX  
   $tmpY  

[ Top ]

method addPoints [line 411]

void addPoints( source $source)

Gets all points from Source series, performs a function operation and stores results in ParentSeries.




Tags:

access:  public


Overridden in child classes as:

ADX::addPoints()
Perimeter::addPoints()
Smoothing::addPoints()
gets all points from Source series, performs a function operation on points and finally stores results in ParentSeries.

Parameters:

source   $source   ArrayList

[ Top ]

method calculate [line 231]

double calculate( source $source, first $first, last $last)

Performs function operation on SourceSeries series.


First and Last parameters are ValueIndex of first and last point used in calculation.
You can override Calculate function to perform customized calculation on one SourceSeries.




Tags:

access:  public


Overridden in child classes as:

Add::calculate()
Performs function operation on SourceSeries series.
Average::calculate()
Performs function operation on SourceSeries series.
Count::calculate()
Performs function operation on SourceSeries series.
High::calculate()
Performs function operation on SourceSeries series.
Low::calculate()
Performs function operation on SourceSeries series.
Variance::calculate()
Performs function operation on s series.

Parameters:

source   $source   Series
first   $first   int
last   $last   int

[ Top ]

method calculateAllPoints [line 252]

void calculateAllPoints( $source, $notMandatorySource)



Tags:

access:  protected


Parameters:

   $source  
   $notMandatorySource  

[ Top ]

method calculateByPeriod [line 277]

void calculateByPeriod( $source, $notMandatorySource)



Tags:

access:  protected


Parameters:

   $source  
   $notMandatorySource  

[ Top ]

method calculateMany [line 247]

double calculateMany( sourceSeries $sourceSeries, valueIndex $valueIndex)

Performs function operation on list of series (SourceSeriesList).


The ValueIndex parameter defines ValueIndex of point in each Series in list.
You can override CalculateMany function to perform customized calculation on list of SourceSeries.




Tags:

access:  public


Overridden in child classes as:

Add::calculateMany()
Performs function operation on list of series (SourceSeriesList).
Average::calculateMany()
Performs function operation on list of series (SourceSeriesList).
Count::calculateMany()
Performs function operation on list of series (SourceSeriesList).
High::calculateMany()
Performs function operation on list of series (SourceSeriesList).
Low::calculateMany()
Performs function operation on list of series (SourceSeriesList).
ManySeries::calculateMany()
Performs function operation on list of series (SourceSeriesList).
Variance::calculateMany()
Performs function operation on all sourceSeries series.

Parameters:

sourceSeries   $sourceSeries   ArrayList
valueIndex   $valueIndex   int

[ Top ]

method calculatePeriod [line 213]

void calculatePeriod( $source, $tmpX, $firstIndex, $lastIndex)



Tags:

access:  protected


Parameters:

   $source  
   $tmpX  
   $firstIndex  
   $lastIndex  

[ Top ]

method clear [line 453]

void clear( )



Tags:

access:  public


[ Top ]

method doCalculation [line 351]

void doCalculation( $source, $notMandatorySource)



Tags:

access:  protected


Parameters:

   $source  
   $notMandatorySource  

[ Top ]

method getDescription [line 347]

String getDescription( )

Gets descriptive text.



Tags:

access:  public


Overridden in child classes as:

Add::getDescription()
Gets descriptive text.
ADX::getDescription()
Gets descriptive text.
Average::getDescription()
Gets descriptive text.
Count::getDescription()
Gets descriptive text.
High::getDescription()
Gets descriptive text.
Low::getDescription()
Gets descriptive text.
Divide::getDescription()
Gets descriptive text.
Multiply::getDescription()
Gets descriptive text.
Subtract::getDescription()
Gets descriptive text.
Perimeter::getDescription()
Gets descriptive text.
Smoothing::getDescription()
Gets descriptive text.
Variance::getDescription()
Gets descriptive text.

[ Top ]

method getPeriod [line 84]

double getPeriod( )

Controls how many points or X range will trigger a new point

calculation.
Zero means all source points.
For example, Average function uses the Period property to calculate a new average point each time the "Period" number of points or X range is exceed.

NOTE: You may switch between number of points or X range by using the Function PeriodStyle property.
Default value: 0D




Tags:

access:  public


[ Top ]

method getPeriodAlign [line 193]

PeriodAlign getPeriodAlign( )

Controls where to place function calculations inside the full period

space.
The position of calculation output points within range.
When the function Period is greater than zero (so it calculates by groups of points), the function results are added to the series by default at the center position of the Function Period. You can change this by setting PeriodAlign to

  • First (function result will be added to series at start of each
period),
  • Center (function result will be added to series at center of each
period)
  • Last (function result will be added to series at end of each period)

Example

  1. function1.setPeriodAlign(Center);
  2.  // <-- by default is centered

The First and Last constants will plot calculations at the start and end X coordinates of each Period .
Default value: PeriodAlign.Centre




Tags:

access:  public


[ Top ]

method getPeriodStyle [line 158]

PeriodStyle getPeriodStyle( )

Controls how the Period property is interpreted.


Either as number of points or as range.
Range means Period property is specified in a range of values.
Being able to define Period as a range can be very useful when using Date-Time series and when you want to express the Period of the function in a date-time step like OneMonth or OneDay.
So, for example you can now plot the monthly average of sales function just using a normal Average function on a date-time source series and setting the function period to one month :
{ Place a series1 and fill it with datetime data values at runtime (or from a database) }
series2.setFunction( new Average() );
series2.getFunction().setPeriodStyle( Range); series2.getFunction().setPeriod( DateTimeStep[ dtOneMonth ]); series2.setDataSource(series1);

This will result in several points, each one showing the average of each month of data in Series1.
It's mandatory that points in the source Series1 should be sorted by date when calculating functions on datetime periods.

The range can also be used for non-datetime series:

series2.setFunction( new Average() ) ;
series2.getFunction().setPeriodStyle(Range);
series2.getFunction().setPeriod(100);
series2.setDataSource(series1) ;
>br> This will calculate an average for each group of points inside every 100 interval.

(Points with X >=0, X<100 will be used to calculate the first average, points with X >=100, X<200 will be used to calculate the second average and so on... )
Notice this is different than calculating an average for every 100 points.
Default value: PeriodStyle.NumPoints




Tags:

access:  public


[ Top ]

method getSeries [line 107]

Series getSeries( )

Returns the Series parent of Function.
Run-time and read only.
The Series property returns the Series parent of this Function.
TChart uses Series to do the actual drawing.



Tags:

access:  public


[ Top ]

method newInstance [line 66]

void newInstance( $f)



Tags:

access:  public


Parameters:

   $f  

[ Top ]

method readResolve [line 61]

void readResolve( )



Tags:

access:  protected


[ Top ]

method recalculate [line 447]

void recalculate( )

Performs a checkDataSource method call on parent Series.


Basically, all points in parent Series are recalculated.
The recalculating is performed only if internal updating flag is set to false.
To make sure updating is set to false, you can call Function endUpdate() method prior to calling Function recalculate.




Tags:

access:  public


[ Top ]

method setPeriod [line 88]

void setPeriod( $value)



Tags:

access:  public


Parameters:

   $value  

[ Top ]

method setPeriodAlign [line 197]

void setPeriodAlign( $value)



Tags:

access:  public


Parameters:

   $value  

[ Top ]

method setPeriodStyle [line 162]

void setPeriodStyle( $value)



Tags:

access:  public


Parameters:

   $value  

[ Top ]

method setSeries [line 111]

void setSeries( $value)



Tags:

access:  public


Parameters:

   $value  

[ Top ]

method valueList [line 359]

void valueList( $s)



Tags:

access:  protected


Parameters:

   $s  

[ Top ]

method __get [line 34]

void __get( $property)



Overridden in child classes as:

Add::__get()
ADX::__get()
Average::__get()
Count::__get()
High::__get()
Low::__get()
Divide::__get()
Multiply::__get()
Subtract::__get()
Perimeter::__get()
Variance::__get()

Overrides TeeBase::__get() (parent method not documented)

Parameters:

   $property  

[ Top ]

method __set [line 41]

void __set( $property, $value)



Overridden in child classes as:

Add::__set()
ADX::__set()
Average::__set()
Count::__set()
High::__set()
Low::__set()
Divide::__set()
Multiply::__set()
Subtract::__set()
Perimeter::__set()
Variance::__set()

Overrides TeeBase::__set() (parent method not documented)

Parameters:

   $property  
   $value  

[ Top ]


Documentation generated on Wed, 16 Jun 2010 12:05:26 +0200 by phpDocumentor 1.4.1