public interface AQSeriesFunction
Synopsis:
SeriesFunction is a function which accepts a set of parameters and generates a series of data
Description:
SeriesFunctions are specified in the ChartProperties to add a data series generated by a mathematical function.
Functions can be performed on values contained in other series. These series references are specified using a zero-based index.
By default, functions are performed on all values in the series.
However, functions can also be performed on a selected range of values, using zero-based indexes to specify the start & end rows.
Both start & end row parameters are optional.
The currently supported functions (and their parameters) are:
Add (Series A, Series B, Start Row, End Row)
For each row, adds the value in Series A to the value in Series B, and stores the result in the function series.
Average (Series, Start Row, End Row)
Computes the average of all values in the Series, and stores that value in each row of the function series.
LinearRegression (Series, Start Row, End Row)
Apply a linear regression to the Series, and store the values of the resulting line in the function series.
Log (Series, Log Base, Start Row, End Row)
For each row, find the logarithm for the value in the Series using the specified Log Base, and store the result in the function series.
Moving Average (Series, Range, Start Row, End Row)
For each row, perform a Moving Average on the Series values using the specified Range, and store the result in the function series.
Power (Series, Exponent, Start Row, End Row)
For each row, raise the value in the Series to power specified in the Exponent, and store the result in the function series.
Scalar (Series, Scalar Multiplier, Start Row, End Row)
For each row, multiply the value in the Series by the Scalar Multiplier, and store the result in the function series.
Subtract (Series A, Series B, Start Row, End Row)
For each row, subtract the value in Series B from the value in Series A, and store the result in the function series.
Zero ()
For each row, store a value of zero (0) in the function series.
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.Number> |
evaluate(java.util.List<AQFunctionParameter> parameters,
AQChartModel model)
Evaluate the function using the specified parameters and data model.
|
java.lang.String |
getFunctionWithParameterDescriptions()
Get a description of the function, including parameter names.
|
java.lang.String |
getFunctionWithParameterValues()
Get a description of the function, including parameter values.
|
java.util.List<java.lang.String> |
getMetaData()
Get metadata returned by the function.
|
java.lang.String |
getName()
Get the name of the function.
|
java.lang.String[] |
getParameterDescriptions()
Get an array of string parameter descriptions.
|
java.lang.String |
getParameterDescriptionsString()
Get a string containing the parameter descriptions.
|
java.util.List<AQFunctionParameter> |
getParameters()
Get the list of function parameters.
|
java.lang.String |
getParameterValuesString()
Get a string containing the parameter values.
|
boolean |
isValid(java.util.List<AQFunctionParameter> parameters,
AQChartModel model,
int functionSeriesIndex)
Returns TRUE if the specified function parameters are valid when used with the ChartModel.
|
void |
setParameters(java.util.List<AQFunctionParameter> functionParameters)
Set the list of function parameters.
|
boolean |
setParameters(java.lang.String parameterString)
Set the function parameters using by parsing the specified string.
|
java.lang.String getName()
java.lang.String[] getParameterDescriptions()
java.util.List<java.lang.Number> evaluate(java.util.List<AQFunctionParameter> parameters, AQChartModel model)
The result of the evaluation is the list of values generated by the function.
parameters
- List of function parametersmodel
- Data modelboolean isValid(java.util.List<AQFunctionParameter> parameters, AQChartModel model, int functionSeriesIndex)
Common causes for invalid parameters are:
Incorrect series indexes (Indexes are zero-based)
Using String values instead of numeric values
parameters
- List of function parametersmodel
- Data modelfunctionSeriesIndex
- index of function seriesjava.util.List<java.lang.String> getMetaData()
Currently, the only function which generates metadata is LinearRegression.
java.lang.String getFunctionWithParameterDescriptions()
For example:
Add(Series A, Series B, Row Start, Row End)
java.lang.String getFunctionWithParameterValues()
For example:
Add(1,2)
java.lang.String getParameterValuesString()
For example:
If the function is "Add(1,2)", this method returns:
1,2
java.lang.String getParameterDescriptionsString()
For example:
If the function is "Add(Series A, Series B, Row Start, Row End)", this method returns:
Series A, Series B, Row Start, Row End
boolean setParameters(java.lang.String parameterString)
For example:
Calling this:
myAddFunction.setParameters("1,2")
will set the two parameters of myAddFunction to the integer values of 1 and 2, respectively.
parameterString
- String containing parameter valuesjava.util.List<AQFunctionParameter> getParameters()
void setParameters(java.util.List<AQFunctionParameter> functionParameters)
functionParameters
- List of function parameters
Copyright © 2019 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.