public class Average extends Function
Title: Average class
Description: Average (mean) Function.
Example:
avgFunction = new com.steema.teechart.functions.Average(); avgFunction.setChart(myChart.getChart()); avgFunction.setPeriod(0); //all points avgFunction.setIncludeNulls(false); lineSeries.setDataSource(barSeries); lineSeries.setFunction(avgFunction);
Copyright (c) 2005-2019 by Steema Software SL. All Rights Reserved.
Company: Steema Software SL
canUsePeriod, dPeriod, HideSourceList, noSourceRequired, series, SingleSource, updating
chart, InternalUse
Constructor and Description |
---|
Average()
Initializes a new Average function, using Null values.
|
Average(boolean useNulls)
If UseNulls is true, null values will be treated as zero in average
calculation.
|
Modifier and Type | Method and Description |
---|---|
double |
calculate(Series sourceSeries,
int firstIndex,
int lastIndex)
Performs function operation on SourceSeries series.
First and Last parameters are ValueIndex of first and last point used in calculation. |
double |
calculateMany(java.util.ArrayList sourceSeriesList,
int valueIndex)
Performs function operation on list of series (SourceSeriesList).
The ValueIndex parameter defines ValueIndex of point in each Series in list. |
java.lang.String |
getDescription()
Gets descriptive text.
|
boolean |
getIncludeNulls()
Calculates the average using only the non-null points of a series, or
not.
|
void |
setIncludeNulls(boolean value)
Calculates the average using only the non-null points of a series, or
not.
|
addFunctionXY, addPoints, calculateAllPoints, calculateByPeriod, calculatePeriod, clear, dispose, doCalculation, getPeriod, getPeriodAlign, getPeriodStyle, getSeries, newInstance, readResolve, recalculate, setPeriod, setPeriodAlign, setPeriodStyle, setSeries, valueList
getChart, invalidate, setBooleanProperty, setChart, setColorProperty, setDoubleProperty, setIntegerProperty, setStringProperty
public Average()
public Average(boolean useNulls)
useNulls
- booleanpublic boolean getIncludeNulls()
public void setIncludeNulls(boolean value)
value
- booleanpublic double calculate(Series sourceSeries, int firstIndex, int lastIndex)
public double calculateMany(java.util.ArrayList sourceSeriesList, int valueIndex)
calculateMany
in class Function
sourceSeriesList
- ArrayListvalueIndex
- intpublic java.lang.String getDescription()
getDescription
in class Function