AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.data.TableComputer Improve this Doc

Stock table computer constructor.

Methods Overview

Data
addOutputField()Adds output field to the computer with the given name.
getFieldIndex()Returns field index by the field name.
setCalculationFunction()Sets function that is executed for each row of the table storage.
setContext()Sets computer context. If not set - defaults to Window.
setStartFunction()Sets function that will be executed on each calculation start.

Methods Description

addOutputField

Adds output field to the computer with the given name.

Params:

NameTypeDescription
namestringName of field.
uidstringUnique identifier for field.

Returns:

number - Returns a negative number of column. This number of the column can use for data mapping.

getFieldIndex

Returns field index by the field name.

Params:

NameTypeDescription
namestringField name.

Returns:

number - Returns negative field index.

setCalculationFunction

Sets function that is executed for each row of the table storage.

Params:

NameTypeDescription
calculationFunctionfunction(rowProxy:anychart.data.TableComputer.RowProxy, context:Object)Function that looks like:
function(anychart.data.TableComputer.RowProxy, context){
   // this: context - The context value from anychart.data.TableComputer#setContext method
}

setContext

Sets computer context. If not set - defaults to Window.

Params:

NameTypeDescription
valueObjectContext of the calculator

setStartFunction

Sets function that will be executed on each calculation start.

Params:

NameTypeDescription
startFunctionfunction(context:Object)Function that looks like:
function(context){
   // this: context - The context value from anychart.data.TableComputer#setContext method
}