namespace anychart.data Improve this Doc
Classes for handling data structures/sources
The following data types/hierarchy is supported:
- Linear (anychart.data.Set and anychart.data.Mapping)
- Tree (anychart.data.Tree)
Functions Overview
mapAsTable() | Maps passed data as an array of mappings. |
set() | Return instance of class anychart.data.Set. |
table() | Creates and returns new instance of data table. |
tree() | Creates and returns new instance of data tree. |
Classes Overview
anychart.data.Iterator | anychart.data.Iterator class is used to work with data in a View. |
anychart.data.Mapping | Special view which allows to map anychart.data.Set storages. |
anychart.data.Set | Linear data storage. |
anychart.data.Table | Stock data table constructor. |
anychart.data.TableIterator | Table iterator class. Assumes iterator (if any) to return not less keys than the table has. |
anychart.data.TableMapping | Table mapping constructor. |
anychart.data.TableSelectable | Table mapping proxy that supports selection |
anychart.data.TableSelectable.RowProxy | Represents table row with associated mapping. Allows fetching rows values. |
anychart.data.Traverser | Tree data traverser. |
anychart.data.Tree | Tree data model. |
anychart.data.Tree.DataItem | Tree data item. |
anychart.data.View | View is a representation of raw data. |
Functions Description
mapAsTable
Maps passed data as an array of mappings.
Detailed description
Data is expected to be a table, e.g. an array of arrays of values.
The function treats the table as a source for several series of points, that have the same X value.
Each row of the table is treated as a bunch of points, one for each series. Column number 0 is treated as an X value.
Other columns (number per series depends on the opt_mode) are treated as data values.
Params:
Name | Type | Description |
---|---|---|
data | Array.<Array.<*>> | Source data table. |
mode | anychart.enums.MapAsTableMode | string | Mapping mode. |
seriesCount | number | Explicit number of series to make mapping for. If not set, auto-determination by the first table row is used. |
Returns:
Array.<anychart.data.Mapping> - Returns an array of mappings, one per series.set
Return instance of class anychart.data.Set.
Params:
Name | Type | Description |
---|---|---|
data | Array | string | Data set raw data can be set here. |
csvSettings | Object.<string, (string|boolean)> | If CSV string is passed, you can pass CSV parser settings here as a hash map. |
Returns:
anychart.data.Set - Self instance for method chaining.Try it:
table
Creates and returns new instance of data table.
Key column index defaults to zero column.
Params:
Name | Type | Description |
---|---|---|
keyColumnIndex | number | Index of the column in which table index is located. |
Returns:
anychart.data.Table - Self instance for method chaining.Try it:
tree
Creates and returns new instance of data tree.
Params:
Name | Type | Description |
---|---|---|
data | Array.<Object> | Raw data. |
fillMethod | anychart.enums.TreeFillingMethod | Fill method. |
Returns:
anychart.data.Tree - Self instance for method chaining.Try it: