AnyChart
API Reference
Still have questions?
Contact support
Top
You are looking at an outdated 7.2.0 version of this document. Switch to the 8.3.0 version to see the up to date information.

class anychart.elements.DataGrid Improve this Doc

Extends: anychart.VisualBaseWithBounds

Data grid implementation.

Methods Overview

Miscellaneous
backgroundFill()Gets/sets background fill.
cellBorder()Gets/sets cell border. Actually parses a value to apply width and color to columns splitter.
cellEvenFill()Gets/sets an even cell fill.
cellFill()Gets/sets a default cell fill. Resets cells odd fill and cells even fill.
cellOddFill()Gets/sets a odd cell fill.
column()Gets column by index or creates a new one if column doesn't exist yet.
data()Sets new data.
draw()Draws data grid.
endIndex()Gets/sets end index.
getVisibleItems()Getter for the set of visible (not collapsed) data items.
startIndex()Gets/sets start index.
titleHeight()Gets/sets title height.
verticalOffset()Gets/set vertical offset.

Methods Description

backgroundFill

Gets/sets background fill.

Params:

Name Type Description
fillOrColorOrKeys anychart.graphics.vector.Fill | !Array.<(anychart.graphics.vector.GradientKey|string)> | null .
opacityOrAngleOrCx number .
modeOrCy number | boolean | anychart.graphics.math.Rect | Object .
opacityOrMode number | anychart.graphics.math.Rect | Object | null .
opacity number .
fx number .
fy number .

Returns:

anychart.graphics.vector.Fill anychart.elements.DataGrid string - - Current value or itself for method chaining.

cellBorder

Gets/sets cell border. Actually parses a value to apply width and color to columns splitter.

Params:

Name Type Description
value anychart.graphics.vector.Stroke | string Value to be set.

Returns:

string anychart.graphics.vector.Stroke anychart.elements.DataGrid - - Current value or itself for method chaining.

cellEvenFill

Gets/sets an even cell fill.

Params:

Name Type Description
fillOrColorOrKeys anychart.graphics.vector.Fill | !Array.<(anychart.graphics.vector.GradientKey|string)> | null .
opacityOrAngleOrCx number .
modeOrCy number | boolean | anychart.graphics.math.Rect | Object .
opacityOrMode number | anychart.graphics.math.Rect | Object | null .
opacity number .
fx number .
fy number .

Returns:

anychart.graphics.vector.Fill anychart.elements.DataGrid string - - Current value or itself for method chaining.

cellFill

Gets/sets a default cell fill. Resets cells odd fill and cells even fill.

Params:

Name Type Description
fillOrColorOrKeys anychart.graphics.vector.Fill | !Array.<(anychart.graphics.vector.GradientKey|string)> | null .
opacityOrAngleOrCx number .
modeOrCy number | boolean | anychart.graphics.math.Rect | Object .
opacityOrMode number | anychart.graphics.math.Rect | Object | null .
opacity number .
fx number .
fy number .

Returns:

anychart.graphics.vector.Fill anychart.elements.DataGrid string - - Current value or itself for method chaining.

cellOddFill

Gets/sets a odd cell fill.

Params:

Name Type Description
fillOrColorOrKeys anychart.graphics.vector.Fill | !Array.<(anychart.graphics.vector.GradientKey|string)> | null .
opacityOrAngleOrCx number .
modeOrCy number | boolean | anychart.graphics.math.Rect | Object .
opacityOrMode number | anychart.graphics.math.Rect | Object | null .
opacity number .
fx number .
fy number .

Returns:

anychart.graphics.vector.Fill anychart.elements.DataGrid string - - Current value or itself for method chaining.

column

Gets column by index or creates a new one if column doesn't exist yet. If works like setter, sets a column by index.

Params:

Name Type Description
indexOrValue number | anychart.elements.DataGrid.Column Column index or column.
value anychart.elements.DataGrid.Column Column to be set.

Returns:

anychart.elements.DataGrid.Column anychart.elements.DataGrid - - Column by index of itself for method chaining if used like setter.

data

Sets new data.

Params:

Name Type Description
value anychart.data.Tree New data tree.

Returns:

anychart.elements.DataGrid anychart.data.Tree - - Current data tree or itself for method chaining.

draw

Draws data grid.

endIndex

Gets/sets end index.

Params:

Name Type Description
value number Value to be set.

Returns:

anychart.elements.DataGrid number - - Current value or itself for method chaining.

getVisibleItems

Getter for the set of visible (not collapsed) data items.

Returns:

Array.<anychart.data.Tree.DataItem> -

startIndex

Gets/sets start index.

Params:

Name Type Description
value number Value to be set.

Returns:

anychart.elements.DataGrid number - - Current value or itself for method chaining.

titleHeight

Gets/sets title height.

Params:

Name Type Description
value number Value to be set.

Returns:

number anychart.elements.DataGrid - - Current value or itself for method chaining.

verticalOffset

Gets/set vertical offset.

Params:

Name Type Description
value number Value to be set.

Returns:

number anychart.elements.DataGrid - - Current value or itself for method chaining.