Top
You are looking at an outdated 7.4.1 version of this document. Switch to the 8.0.1 version to see the up to date information.

class anychart.data.Mapping Improve this Doc

Extends: anychart.data.View

Soecial View which allows to map anychart.data.Set storages.

Methods Overview

Miscellaneous
getIterator()Returns a new iterator for the current view.
getRowsCount()Returns the number of the rows in the current view.
row()Gets a full row of the set by an index.

Methods Description

getIterator

Returns a new iterator for the current view.

Returns:

anychart.data.Iterator - New iterator.

Try it:

getRowsCount

Returns the number of the rows in the current view.

Returns:

number - The number of the rows in the set.

Try it:

row

Gets a full row of the set by an index.
Note: If there is no row with the given index, methods returns undefined.
See sample at anychart.data.Set#row

Params:

Name Type Description
rowIndex number An index of the row to fetch.

Returns:

* - The row.
Example
// Data
 [
   [1, 2, 4, 7],
   [11, 12, 14, 17],
   [21, 22, 24, 27]
 ]
 view.row(2); // returns [21, 22, 24, 27]
 view.row(3); // returns undefined
Sets a row of the set by an index.
Note: Previous value of a row is returned but it is lost completely after that!.

Params:

Name Type Description
rowIndex number An index of the row to fetch.
value * A value to set.

Returns:

* - Previous value of the row.
Example
// Data
 [
   [1, 2, 4, 7],
   [11, 12, 14, 17],
   [21, 22, 24, 27]
 ]
 view.row(2, [2, 2, 2, 2]); // returns [21, 22, 24, 27]
 view.row(3, {'low': 4, 'high': 11}); // returns undefined

Try it: